summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-06-11 11:35:23 -0400
committerJason Monk <jmonk@google.com>2015-06-11 11:35:23 -0400
commit052082c529f2a5ee1a16608b284ca261f720dd0e (patch)
treedadcaa23ed750e0a1d8998625551edcd5fe00663 /packages
parentfd9a2dafdc6516a62bdf13c81ec2ac579a8fd998 (diff)
downloadframeworks_base-052082c529f2a5ee1a16608b284ca261f720dd0e.zip
frameworks_base-052082c529f2a5ee1a16608b284ca261f720dd0e.tar.gz
frameworks_base-052082c529f2a5ee1a16608b284ca261f720dd0e.tar.bz2
Fix CarrierText airplane mode with no sims
CarrierText wouldn't always update the text when airplane mode changed, because it depended on the subscriptions to change to know to update. Now have KeyguardUpdateMonitor listen to airplane mode changes so that we update text when needed. Bug: 21705446 Change-Id: I64e1194ebb055ad10acd96b33e22b95fe2454425
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index e6a89f1..273f166 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -117,6 +117,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private static final int MSG_FINGERPRINT_AUTH_FAILED = 326;
private static final int MSG_FACE_UNLOCK_STATE_CHANGED = 327;
private static final int MSG_SIM_SUBSCRIPTION_INFO_CHANGED = 328;
+ private static final int MSG_AIRPLANE_MODE_CHANGED = 329;
private static KeyguardUpdateMonitor sInstance;
@@ -222,6 +223,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
case MSG_SIM_SUBSCRIPTION_INFO_CHANGED:
handleSimSubscriptionInfoChanged();
break;
+ case MSG_AIRPLANE_MODE_CHANGED:
+ handleAirplaneModeChanged();
+ break;
}
}
};
@@ -305,6 +309,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
}
+ private void handleAirplaneModeChanged() {
+ for (int j = 0; j < mCallbacks.size(); j++) {
+ KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
+ if (cb != null) {
+ cb.onRefreshCarrierInfo();
+ }
+ }
+ }
+
/** @return List of SubscriptionInfo records, maybe empty but never null */
List<SubscriptionInfo> getSubscriptionInfo(boolean forceReload) {
List<SubscriptionInfo> sil = mSubscriptionInfo;
@@ -486,6 +499,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
} else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) {
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
mHandler.sendMessage(mHandler.obtainMessage(MSG_PHONE_STATE_CHANGED, state));
+ } else if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(action)) {
+ mHandler.sendEmptyMessage(MSG_AIRPLANE_MODE_CHANGED);
} else if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
dispatchBootCompleted();
}
@@ -721,6 +736,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
filter.addAction(Intent.ACTION_TIME_CHANGED);
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
+ filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);