Skip to content

Commit 4cef33e

Browse files
SKULSHADYGenkzsz11
authored andcommitted
base: Allow to use old style icons as default [1/2]
* Some devices don't have much statusbar space due to a big notch. Let's add a bool for them to set the old style icons as default. Users can later disable it if they want. neobuddy89: Code optimization. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: Genkzsz11 <genkzsz11@nusantaradevs.org>
1 parent 6a81c43 commit 4cef33e

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

core/res/res/values/nad_config.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,7 @@
146146

147147
<!-- Whether to allow process with media UID to access CameraServiceProxy -->
148148
<bool name="config_allowMediaUidForCameraServiceProxy">false</bool>
149+
150+
<!-- Whether to use old mobile type icons as default -->
151+
<bool name="config_useOldMobileIcons">false</bool>
149152
</resources>

core/res/res/values/nad_symbols.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,7 @@
115115

116116
<!-- Whether to allow process with media UID to access CameraServiceProxy -->
117117
<java-symbol type="bool" name="config_allowMediaUidForCameraServiceProxy" />
118+
119+
<!-- Whether to use old mobile type icons as default -->
120+
<java-symbol type="bool" name="config_useOldMobileIcons" />
118121
</resources>

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public static class IconManager implements DemoMode, TunerService.Tunable {
220220
protected DemoStatusIcons mDemoStatusIcons;
221221

222222
private boolean mOldStyleType;
223+
private boolean mConfigUseOldMobileType;
223224

224225
private static final String USE_OLD_MOBILETYPE =
225226
"system:" + Settings.System.USE_OLD_MOBILETYPE;
@@ -229,6 +230,8 @@ public IconManager(ViewGroup group, CommandQueue commandQueue) {
229230
mContext = group.getContext();
230231
mIconSize = mContext.getResources().getDimensionPixelSize(
231232
com.android.internal.R.dimen.status_bar_icon_size);
233+
mConfigUseOldMobileType = mContext.getResources().
234+
getBoolean(com.android.internal.R.bool.config_useOldMobileIcons);
232235

233236
DisableStateTracker tracker =
234237
new DisableStateTracker(DISABLE_NONE, DISABLE2_SYSTEM_ICONS, commandQueue);
@@ -469,7 +472,7 @@ public void onTuningChanged(String key, String newValue) {
469472
switch (key) {
470473
case USE_OLD_MOBILETYPE:
471474
mOldStyleType =
472-
TunerService.parseIntegerSwitch(newValue, false);
475+
TunerService.parseIntegerSwitch(newValue, mConfigUseOldMobileType);
473476
updateOldStyleMobileDataIcons();
474477
break;
475478
default:

0 commit comments

Comments
 (0)