OSDN Git Service

Avoid showing emergency calls when not possible
authorJason Monk <jmonk@google.com>
Thu, 8 Jan 2015 16:12:39 +0000 (11:12 -0500)
committerJason Monk <jmonk@google.com>
Thu, 8 Jan 2015 16:12:39 +0000 (11:12 -0500)
Tablets aren't phones, so we shouldn't be showing an emergency calls
only message when in airplane mode or no sims are in them.

Bug: 18897573
Change-Id: I8cf31fe73dfd6dfd672a5ee58524815475a76c9c

packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java

index f2ebcf6..ddb96a2 100644 (file)
@@ -184,6 +184,11 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
                 // Make sure signal gets cleared out when no sims.
                 mInfo.mobileSignalIconId = 0;
                 mInfo.dataTypeIconId = 0;
+                // Show a No SIMs description to avoid emergency calls message.
+                mInfo.enabled = true;
+                mInfo.enabledDesc = mContext.getString(
+                        R.string.keyguard_missing_sim_message_short);
+                mInfo.signalContentDescription = mInfo.enabledDesc;
             }
             refreshState(mInfo);
         }
index 5eebf3c..08460f8 100644 (file)
@@ -1192,7 +1192,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
                 int length = mSignalsChangedCallbacks.size();
                 for (int i = 0; i < length; i++) {
                     mSignalsChangedCallbacks.get(i).onMobileDataSignalChanged(mCurrentState.enabled
-                            && !mCurrentState.isEmergency && !mCurrentState.airplaneMode,
+                            && !mCurrentState.isEmergency,
                             getQsCurrentIconId(), contentDescription,
                             qsTypeIcon,
                             mCurrentState.dataConnected && mCurrentState.activityIn,