Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3479,4 +3479,6 @@ <!-- Whether or not swipe up gesture's opt-in setting is available on this device --> <bool name="config_swipe_up_gesture_setting_available">false</bool> <!-- Whether or not we should show the option to show battery percentage --> <bool name="config_battery_percentage_setting_available">true</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2200,6 +2200,7 @@ <java-symbol type="string" name="ext_media_move_failure_message" /> <java-symbol type="style" name="Animation.RecentApplications" /> <java-symbol type="integer" name="dock_enter_exit_duration" /> <java-symbol type="bool" name="config_battery_percentage_setting_available" /> <!-- ImfTest --> <java-symbol type="layout" name="auto_complete_list" /> Loading packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +10 −2 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import com.android.systemui.statusbar.policy.IconLogger; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; import com.android.systemui.util.Utils.DisableStateTracker; import com.android.systemui.R; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -74,6 +75,7 @@ public class BatteryMeterView extends LinearLayout implements private int mTextColor; private int mLevel; private boolean mForceShowPercent; private boolean mShowPercentAvailable; private int mDarkModeBackgroundColor; private int mDarkModeFillColor; Loading Loading @@ -113,6 +115,9 @@ public class BatteryMeterView extends LinearLayout implements atts.recycle(); mSettingObserver = new SettingObserver(new Handler(context.getMainLooper())); mShowPercentAvailable = context.getResources().getBoolean( com.android.internal.R.bool.config_battery_percentage_setting_available); addOnAttachStateChangeListener( new DisableStateTracker(DISABLE_NONE, DISABLE2_SYSTEM_ICONS)); Loading Loading @@ -264,8 +269,11 @@ public class BatteryMeterView extends LinearLayout implements private void updateShowPercent() { final boolean showing = mBatteryPercentView != null; if (0 != Settings.System.getIntForUser(getContext().getContentResolver(), SHOW_BATTERY_PERCENT, 0, mUser) || mForceShowPercent) { final boolean systemSetting = 0 != Settings.System .getIntForUser(getContext().getContentResolver(), SHOW_BATTERY_PERCENT, 0, mUser); if ((mShowPercentAvailable && systemSetting) || mForceShowPercent) { if (!showing) { mBatteryPercentView = loadPercentView(); if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +4 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class KeyguardStatusBarView extends RelativeLayout private static final int LAYOUT_CUTOUT = 1; private static final int LAYOUT_NO_CUTOUT = 2; private boolean mShowPercentAvailable; private boolean mBatteryCharging; private boolean mKeyguardUserSwitcherShowing; private boolean mBatteryListening; Loading Loading @@ -168,6 +169,8 @@ public class KeyguardStatusBarView extends RelativeLayout R.dimen.system_icons_super_container_avatarless_margin_end); mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); mShowPercentAvailable = getContext().getResources().getBoolean( com.android.internal.R.bool.config_battery_percentage_setting_available); } private void updateVisibilities() { Loading @@ -189,7 +192,7 @@ public class KeyguardStatusBarView extends RelativeLayout mMultiUserSwitch.setVisibility(View.GONE); } } mBatteryView.setForceShowPercent(mBatteryCharging); mBatteryView.setForceShowPercent(mBatteryCharging && mShowPercentAvailable); } private void updateSystemIconsLayoutParams() { Loading Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3479,4 +3479,6 @@ <!-- Whether or not swipe up gesture's opt-in setting is available on this device --> <bool name="config_swipe_up_gesture_setting_available">false</bool> <!-- Whether or not we should show the option to show battery percentage --> <bool name="config_battery_percentage_setting_available">true</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2200,6 +2200,7 @@ <java-symbol type="string" name="ext_media_move_failure_message" /> <java-symbol type="style" name="Animation.RecentApplications" /> <java-symbol type="integer" name="dock_enter_exit_duration" /> <java-symbol type="bool" name="config_battery_percentage_setting_available" /> <!-- ImfTest --> <java-symbol type="layout" name="auto_complete_list" /> Loading
packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +10 −2 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import com.android.systemui.statusbar.policy.IconLogger; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; import com.android.systemui.util.Utils.DisableStateTracker; import com.android.systemui.R; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -74,6 +75,7 @@ public class BatteryMeterView extends LinearLayout implements private int mTextColor; private int mLevel; private boolean mForceShowPercent; private boolean mShowPercentAvailable; private int mDarkModeBackgroundColor; private int mDarkModeFillColor; Loading Loading @@ -113,6 +115,9 @@ public class BatteryMeterView extends LinearLayout implements atts.recycle(); mSettingObserver = new SettingObserver(new Handler(context.getMainLooper())); mShowPercentAvailable = context.getResources().getBoolean( com.android.internal.R.bool.config_battery_percentage_setting_available); addOnAttachStateChangeListener( new DisableStateTracker(DISABLE_NONE, DISABLE2_SYSTEM_ICONS)); Loading Loading @@ -264,8 +269,11 @@ public class BatteryMeterView extends LinearLayout implements private void updateShowPercent() { final boolean showing = mBatteryPercentView != null; if (0 != Settings.System.getIntForUser(getContext().getContentResolver(), SHOW_BATTERY_PERCENT, 0, mUser) || mForceShowPercent) { final boolean systemSetting = 0 != Settings.System .getIntForUser(getContext().getContentResolver(), SHOW_BATTERY_PERCENT, 0, mUser); if ((mShowPercentAvailable && systemSetting) || mForceShowPercent) { if (!showing) { mBatteryPercentView = loadPercentView(); if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +4 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class KeyguardStatusBarView extends RelativeLayout private static final int LAYOUT_CUTOUT = 1; private static final int LAYOUT_NO_CUTOUT = 2; private boolean mShowPercentAvailable; private boolean mBatteryCharging; private boolean mKeyguardUserSwitcherShowing; private boolean mBatteryListening; Loading Loading @@ -168,6 +169,8 @@ public class KeyguardStatusBarView extends RelativeLayout R.dimen.system_icons_super_container_avatarless_margin_end); mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); mShowPercentAvailable = getContext().getResources().getBoolean( com.android.internal.R.bool.config_battery_percentage_setting_available); } private void updateVisibilities() { Loading @@ -189,7 +192,7 @@ public class KeyguardStatusBarView extends RelativeLayout mMultiUserSwitch.setVisibility(View.GONE); } } mBatteryView.setForceShowPercent(mBatteryCharging); mBatteryView.setForceShowPercent(mBatteryCharging && mShowPercentAvailable); } private void updateSystemIconsLayoutParams() { Loading