summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2019-08-01 10:25:31 (GMT)
committerLuK1337 <priv.luk@gmail.com>2019-08-01 10:28:00 (GMT)
commit2413c2481d89d08901f698b90ab60abb02c49f9c (patch)
tree9917e062040a8026f526b35e46e13f53d537360a
parent4d12c537ca94a412e79af2de7483c792542a6879 (diff)
downloadframeworks_base-2413c2481d89d08901f698b90ab60abb02c49f9c.zip
frameworks_base-2413c2481d89d08901f698b90ab60abb02c49f9c.tar.gz
frameworks_base-2413c2481d89d08901f698b90ab60abb02c49f9c.tar.bz2
SystemUI: Fix multiple issues with hiding unprovisioned SIMs
* Use View.GONE instead of View.INVISIBLE when setting dot and mobile group's visibility so that we don't leave empty space. * Always fallback to STATE_HIDDEN when SIM is unprovisioned so that we don't end up showing unnecessary empty icon after toggling airplane mode twice with mobile data off. * Make sure to call IconController.setMobileIcons() after provisioning changes so that signal icon is always hidden. Change-Id: I546a326eb52b0496f5fbd9057d368b1a90827d58
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java3
2 files changed, 15 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
index 1e29033..205dcd0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
@@ -250,17 +250,21 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mVisibleState = state;
switch (state) {
case STATE_ICON:
- mMobileGroup.setVisibility(View.VISIBLE);
- mDotView.setVisibility(View.GONE);
- break;
+ if (mState == null || (mState.visible && mState.provisioned)) {
+ mMobileGroup.setVisibility(View.VISIBLE);
+ mDotView.setVisibility(View.GONE);
+ break;
+ }
case STATE_DOT:
- mMobileGroup.setVisibility(View.INVISIBLE);
- mDotView.setVisibility(View.VISIBLE);
- break;
+ if (mState == null || (mState.visible && mState.provisioned)) {
+ mMobileGroup.setVisibility(View.INVISIBLE);
+ mDotView.setVisibility(View.VISIBLE);
+ break;
+ }
case STATE_HIDDEN:
default:
- mMobileGroup.setVisibility(View.INVISIBLE);
- mDotView.setVisibility(View.INVISIBLE);
+ mMobileGroup.setVisibility(View.GONE);
+ mDotView.setVisibility(View.GONE);
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
index dfc7833..e1cf1d6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
@@ -113,6 +113,9 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
// after disabling one of the SIMs.
state.typeId = 0;
}
+ // Make sure that applyMobileState() gets called
+ mIconController.setMobileIcons(
+ mSlotMobile, MobileIconState.copyStates(mMobileStates));
}
}
}