Fix double status bar icons
Don't allow the status bar icon slot list to be changed because it confuses the relationship between StatusBarIconList and StatusBarIconController. Set it in the constructor to enforce this. Change-Id: Ieeea0a9efad88179d1cccc0e5702899333de2e72 Fixes: 28524184
This commit is contained in:
@@ -3522,7 +3522,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
|
||||
repositionNavigationBar();
|
||||
updateRowStates();
|
||||
mIconController.defineSlots();
|
||||
mScreenPinningRequest.onConfigurationChanged();
|
||||
mNetworkController.onConfigurationChanged();
|
||||
}
|
||||
|
||||
@@ -112,6 +112,8 @@ public class StatusBarIconController extends StatusBarIconList implements Tunabl
|
||||
|
||||
public StatusBarIconController(Context context, View statusBar, View keyguardStatusBar,
|
||||
PhoneStatusBar phoneStatusBar) {
|
||||
super(context.getResources().getStringArray(
|
||||
com.android.internal.R.array.config_statusBarIcons));
|
||||
mContext = context;
|
||||
mPhoneStatusBar = phoneStatusBar;
|
||||
mSystemIconArea = (LinearLayout) statusBar.findViewById(R.id.system_icon_area);
|
||||
@@ -137,7 +139,6 @@ public class StatusBarIconController extends StatusBarIconList implements Tunabl
|
||||
mDarkModeIconColorSingleTone = context.getColor(R.color.dark_mode_icon_color_single_tone);
|
||||
mLightModeIconColorSingleTone = context.getColor(R.color.light_mode_icon_color_single_tone);
|
||||
mHandler = new Handler();
|
||||
defineSlots();
|
||||
loadDimens();
|
||||
|
||||
TunerService.get(mContext).addTunable(this, ICON_BLACKLIST);
|
||||
@@ -197,11 +198,6 @@ public class StatusBarIconController extends StatusBarIconList implements Tunabl
|
||||
R.dimen.status_bar_icon_padding);
|
||||
}
|
||||
|
||||
public void defineSlots() {
|
||||
defineSlots(mContext.getResources().getStringArray(
|
||||
com.android.internal.R.array.config_statusBarIcons));
|
||||
}
|
||||
|
||||
private void addSystemIcon(int index, StatusBarIcon icon) {
|
||||
String slot = getSlot(index);
|
||||
int viewIndex = getViewIndex(index);
|
||||
|
||||
@@ -25,14 +25,11 @@ public class StatusBarIconList {
|
||||
private ArrayList<String> mSlots = new ArrayList<>();
|
||||
private ArrayList<StatusBarIcon> mIcons = new ArrayList<>();
|
||||
|
||||
public void defineSlots(String[] slots) {
|
||||
mSlots.clear();
|
||||
public StatusBarIconList(String[] slots) {
|
||||
final int N = slots.length;
|
||||
for (int i=0; i < N; i++) {
|
||||
mSlots.add(slots[i]);
|
||||
if (mIcons.size() < mSlots.size()) {
|
||||
mIcons.add(null);
|
||||
}
|
||||
mIcons.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user