Merge "Show No SIM icon in QS when there is no SIM" into oc-mr1-dev
am: af5cce3dbe
Change-Id: Icf72e87ab33048c0a51e03a91398c85bc60390f8
diff --git a/packages/SystemUI/res/drawable/ic_qs_no_sim.xml b/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
index 69869fe..5dcd9f7 100644
--- a/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_no_sim.xml
@@ -1,5 +1,5 @@
<!--
-Copyright (C) 2014 The Android Open Source Project
+Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,10 +16,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
+ android:viewportWidth="18.4"
+ android:viewportHeight="18.4">
- <path
- android:fillColor="#FFFFFFFF"
- android:pathData="M19.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-7.0,0.0L7.7,5.3L19.0,16.7L19.0,5.0zM3.7,3.9L2.4,5.2L5.0,7.8L5.0,19.0c0.0,1.1 0.9,2.0 2.0,2.0l10.0,0.0c0.4,0.0 0.7,-0.1 1.0,-0.3l1.9,1.9l1.3,-1.3L3.7,3.9z"/>
+ <group
+ android:translateX="0.7"
+ android:translateY="1.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M13.91,11.84L5.14,3.08l1.81,-1.81h5.41c0.85,0 1.54,0.69 1.54,1.54l0.01,9.03zM15.06,14.95L2.54,2.44c-0.28,-0.28 -0.71,-0.28 -0.99,0s-0.28,0.71 0,0.98l1.53,1.53v8.67c0,0.85 0.69,1.54 1.54,1.54h7.74c0.27,0 0.52,-0.07 0.74,-0.2l0.96,0.96c0.28,0.28 0.71,0.28 0.99,0 0.28,-0.26 0.28,-0.69 0.01,-0.97z"/>
+ </group>
</vector>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
index 3d8f9ff..5f26093 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java
@@ -44,7 +44,10 @@
}
protected void updateIcon(ImageView iv, State state) {
- if (!Objects.equals(state.icon, iv.getTag(R.id.qs_icon_tag))) {
+ if (!(state.icon instanceof SignalIcon)) {
+ super.updateIcon(iv, state);
+ return;
+ } else if (!Objects.equals(state.icon, iv.getTag(R.id.qs_icon_tag))) {
mSignalDrawable.setLevel(((SignalIcon) state.icon).getState());
iv.setImageDrawable(mSignalDrawable);
iv.setTag(R.id.qs_icon_tag, state.icon);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index 0e0f949..f900da0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -183,8 +183,13 @@
state.value = mDataController.isMobileDataSupported()
&& mDataController.isMobileDataEnabled();
- state.icon = new SignalIcon(cb.mobileSignalIconId);
- if (cb.airplaneModeEnabled) {
+ if (cb.noSim) {
+ state.icon = ResourceIcon.get(R.drawable.ic_qs_no_sim);
+ } else {
+ state.icon = new SignalIcon(cb.mobileSignalIconId);
+ }
+
+ if (cb.airplaneModeEnabled | cb.noSim) {
state.state = Tile.STATE_INACTIVE;
} else {
state.state = Tile.STATE_ACTIVE;