diff options
author | John Spurlock <jspurlock@google.com> | 2013-09-05 02:18:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-05 02:18:31 +0000 |
commit | 079db748746ebb1565279114fb957135f75ba4cf (patch) | |
tree | 647b37ae6ef820d9411915f00caaca3847d5279d /packages/SystemUI/src | |
parent | 631228b0249de11b5dad37e7a09a251a5558430a (diff) | |
parent | fcc901c10bffdfb9c6b31e676dec36b47d949979 (diff) | |
download | frameworks_base-079db748746ebb1565279114fb957135f75ba4cf.zip frameworks_base-079db748746ebb1565279114fb957135f75ba4cf.tar.gz frameworks_base-079db748746ebb1565279114fb957135f75ba4cf.tar.bz2 |
Merge "Remove signal/wifi activity indicator icon overlays." into klp-dev
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java | 34 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java | 160 |
2 files changed, 12 insertions, 182 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index ff84243..f1c8e01 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -39,15 +39,15 @@ public class SignalClusterView NetworkController mNC; private boolean mWifiVisible = false; - private int mWifiStrengthId = 0, mWifiActivityId = 0; + private int mWifiStrengthId = 0; private boolean mMobileVisible = false; - private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0; + private int mMobileStrengthId = 0, mMobileTypeId = 0; private boolean mIsAirplaneMode = false; private int mAirplaneIconId = 0; private String mWifiDescription, mMobileDescription, mMobileTypeDescription; ViewGroup mWifiGroup, mMobileGroup; - ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType, mAirplane; + ImageView mWifi, mMobile, mMobileType, mAirplane; View mSpacer; public SignalClusterView(Context context) { @@ -73,10 +73,8 @@ public class SignalClusterView mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo); mWifi = (ImageView) findViewById(R.id.wifi_signal); - mWifiActivity = (ImageView) findViewById(R.id.wifi_inout); mMobileGroup = (ViewGroup) findViewById(R.id.mobile_combo); mMobile = (ImageView) findViewById(R.id.mobile_signal); - mMobileActivity = (ImageView) findViewById(R.id.mobile_inout); mMobileType = (ImageView) findViewById(R.id.mobile_type); mSpacer = findViewById(R.id.spacer); mAirplane = (ImageView) findViewById(R.id.airplane); @@ -88,10 +86,8 @@ public class SignalClusterView protected void onDetachedFromWindow() { mWifiGroup = null; mWifi = null; - mWifiActivity = null; mMobileGroup = null; mMobile = null; - mMobileActivity = null; mMobileType = null; mSpacer = null; mAirplane = null; @@ -100,22 +96,19 @@ public class SignalClusterView } @Override - public void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon, - String contentDescription) { + public void setWifiIndicators(boolean visible, int strengthIcon, String contentDescription) { mWifiVisible = visible; mWifiStrengthId = strengthIcon; - mWifiActivityId = activityIcon; mWifiDescription = contentDescription; apply(); } @Override - public void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon, + public void setMobileDataIndicators(boolean visible, int strengthIcon, int typeIcon, String contentDescription, String typeContentDescription) { mMobileVisible = visible; mMobileStrengthId = strengthIcon; - mMobileActivityId = activityIcon; mMobileTypeId = typeIcon; mMobileDescription = contentDescription; mMobileTypeDescription = typeContentDescription; @@ -149,16 +142,11 @@ public class SignalClusterView if (mWifi != null) { mWifi.setImageDrawable(null); } - if (mWifiActivity != null) { - mWifiActivity.setImageDrawable(null); - } if (mMobile != null) { mMobile.setImageDrawable(null); } - if (mMobileActivity != null) { - mMobileActivity.setImageDrawable(null); - } + if (mMobileType != null) { mMobileType.setImageDrawable(null); } @@ -176,7 +164,6 @@ public class SignalClusterView if (mWifiVisible) { mWifi.setImageResource(mWifiStrengthId); - mWifiActivity.setImageResource(mWifiActivityId); mWifiGroup.setContentDescription(mWifiDescription); mWifiGroup.setVisibility(View.VISIBLE); @@ -185,13 +172,12 @@ public class SignalClusterView } if (DEBUG) Log.d(TAG, - String.format("wifi: %s sig=%d act=%d", + String.format("wifi: %s sig=%d", (mWifiVisible ? "VISIBLE" : "GONE"), - mWifiStrengthId, mWifiActivityId)); + mWifiStrengthId)); if (mMobileVisible && !mIsAirplaneMode) { mMobile.setImageResource(mMobileStrengthId); - mMobileActivity.setImageResource(mMobileActivityId); mMobileType.setImageResource(mMobileTypeId); mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription); @@ -214,9 +200,9 @@ public class SignalClusterView } if (DEBUG) Log.d(TAG, - String.format("mobile: %s sig=%d act=%d typ=%d", + String.format("mobile: %s sig=%d typ=%d", (mMobileVisible ? "VISIBLE" : "GONE"), - mMobileStrengthId, mMobileActivityId, mMobileTypeId)); + mMobileStrengthId, mMobileTypeId)); mMobileType.setVisibility( !mWifiVisible ? View.VISIBLE : View.GONE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 34e3013..fe50a7c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -37,7 +37,6 @@ import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.util.Log; import android.view.View; -import android.widget.ImageView; import android.widget.TextView; import com.android.internal.telephony.IccCardConstants; @@ -81,7 +80,6 @@ public class NetworkController extends BroadcastReceiver { int mQSDataTypeIconId; int mAirplaneIconId; boolean mDataActive; - int mMobileActivityIconId; // overlay arrows for data direction int mLastSignalLevel; boolean mShowPhoneRSSIForData = false; boolean mShowAtLeastThreeGees = false; @@ -101,7 +99,6 @@ public class NetworkController extends BroadcastReceiver { String mWifiSsid; int mWifiIconId = 0; int mQSWifiIconId = 0; - int mWifiActivityIconId = 0; // overlay arrows for wifi direction int mWifiActivity = WifiManager.DATA_ACTIVITY_NONE; // bluetooth @@ -135,13 +132,6 @@ public class NetworkController extends BroadcastReceiver { // our ui Context mContext; - ArrayList<ImageView> mPhoneSignalIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mDataDirectionIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mDataDirectionOverlayIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mWifiIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mWimaxIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mCombinedSignalIconViews = new ArrayList<ImageView>(); - ArrayList<ImageView> mDataTypeIconViews = new ArrayList<ImageView>(); ArrayList<TextView> mCombinedLabelViews = new ArrayList<TextView>(); ArrayList<TextView> mMobileLabelViews = new ArrayList<TextView>(); ArrayList<TextView> mWifiLabelViews = new ArrayList<TextView>(); @@ -151,7 +141,6 @@ public class NetworkController extends BroadcastReceiver { new ArrayList<NetworkSignalChangedCallback>(); int mLastPhoneSignalIconId = -1; int mLastDataDirectionIconId = -1; - int mLastDataDirectionOverlayIconId = -1; int mLastWifiIconId = -1; int mLastWimaxIconId = -1; int mLastCombinedSignalIconId = -1; @@ -163,9 +152,9 @@ public class NetworkController extends BroadcastReceiver { boolean mDataAndWifiStacked = false; public interface SignalCluster { - void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon, + void setWifiIndicators(boolean visible, int strengthIcon, String contentDescription); - void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon, + void setMobileDataIndicators(boolean visible, int strengthIcon, int typeIcon, String contentDescription, String typeContentDescription); void setIsAirplaneMode(boolean is, int airplaneIcon); } @@ -261,33 +250,6 @@ public class NetworkController extends BroadcastReceiver { return (mServiceState != null && mServiceState.isEmergencyOnly()); } - public void addPhoneSignalIconView(ImageView v) { - mPhoneSignalIconViews.add(v); - } - - public void addDataDirectionIconView(ImageView v) { - mDataDirectionIconViews.add(v); - } - - public void addDataDirectionOverlayIconView(ImageView v) { - mDataDirectionOverlayIconViews.add(v); - } - - public void addWifiIconView(ImageView v) { - mWifiIconViews.add(v); - } - public void addWimaxIconView(ImageView v) { - mWimaxIconViews.add(v); - } - - public void addCombinedSignalIconView(ImageView v) { - mCombinedSignalIconViews.add(v); - } - - public void addDataTypeIconView(ImageView v) { - mDataTypeIconViews.add(v); - } - public void addCombinedLabelView(TextView v) { mCombinedLabelViews.add(v); } @@ -319,7 +281,6 @@ public class NetworkController extends BroadcastReceiver { // only show wifi in the cluster if connected or if wifi-only mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature), mWifiIconId, - mWifiActivityIconId, mContentDescriptionWifi); if (mIsWimaxEnabled && mWimaxConnected) { @@ -327,7 +288,6 @@ public class NetworkController extends BroadcastReceiver { cluster.setMobileDataIndicators( true, mAlwaysShowCdmaRssi ? mPhoneSignalIconId : mWimaxIconId, - mMobileActivityIconId, mDataTypeIconId, mContentDescriptionWimax, mContentDescriptionDataType); @@ -336,7 +296,6 @@ public class NetworkController extends BroadcastReceiver { cluster.setMobileDataIndicators( mHasMobileDataFeature, mShowPhoneRSSIForData ? mPhoneSignalIconId : mDataSignalIconId, - mMobileActivityIconId, mDataTypeIconId, mContentDescriptionPhoneSignal, mContentDescriptionDataType); @@ -1008,7 +967,6 @@ public class NetworkController extends BroadcastReceiver { Context context = mContext; int combinedSignalIconId = 0; - int combinedActivityIconId = 0; String combinedLabel = ""; String wifiLabel = ""; String mobileLabel = ""; @@ -1046,56 +1004,23 @@ public class NetworkController extends BroadcastReceiver { // Now for things that should only be shown when actually using mobile data. if (mDataConnected) { combinedSignalIconId = mDataSignalIconId; - switch (mDataActivity) { - case TelephonyManager.DATA_ACTIVITY_IN: - mMobileActivityIconId = R.drawable.stat_sys_signal_in; - break; - case TelephonyManager.DATA_ACTIVITY_OUT: - mMobileActivityIconId = R.drawable.stat_sys_signal_out; - break; - case TelephonyManager.DATA_ACTIVITY_INOUT: - mMobileActivityIconId = R.drawable.stat_sys_signal_inout; - break; - default: - mMobileActivityIconId = 0; - break; - } combinedLabel = mobileLabel; - combinedActivityIconId = mMobileActivityIconId; combinedSignalIconId = mDataSignalIconId; // set by updateDataIcon() mContentDescriptionCombinedSignal = mContentDescriptionDataType; - } else { - mMobileActivityIconId = 0; } } if (mWifiConnected) { if (mWifiSsid == null) { wifiLabel = context.getString(R.string.status_bar_settings_signal_meter_wifi_nossid); - mWifiActivityIconId = 0; // no wifis, no bits } else { wifiLabel = mWifiSsid; if (DEBUG) { wifiLabel += "xxxxXXXXxxxxXXXX"; } - switch (mWifiActivity) { - case WifiManager.DATA_ACTIVITY_IN: - mWifiActivityIconId = R.drawable.stat_sys_wifi_in; - break; - case WifiManager.DATA_ACTIVITY_OUT: - mWifiActivityIconId = R.drawable.stat_sys_wifi_out; - break; - case WifiManager.DATA_ACTIVITY_INOUT: - mWifiActivityIconId = R.drawable.stat_sys_wifi_inout; - break; - case WifiManager.DATA_ACTIVITY_NONE: - mWifiActivityIconId = 0; - break; - } } - combinedActivityIconId = mWifiActivityIconId; combinedLabel = wifiLabel; combinedSignalIconId = mWifiIconId; // set by updateWifiIcons() mContentDescriptionCombinedSignal = mContentDescriptionWifi; @@ -1178,7 +1103,6 @@ public class NetworkController extends BroadcastReceiver { + " combinedSignalIconId=0x" + Integer.toHexString(combinedSignalIconId) + "/" + getResourceName(combinedSignalIconId) - + " combinedActivityIconId=0x" + Integer.toHexString(combinedActivityIconId) + " mobileLabel=" + mobileLabel + " wifiLabel=" + wifiLabel + " emergencyOnly=" + emergencyOnly @@ -1197,7 +1121,6 @@ public class NetworkController extends BroadcastReceiver { } if (mLastPhoneSignalIconId != mPhoneSignalIconId - || mLastDataDirectionOverlayIconId != combinedActivityIconId || mLastWifiIconId != mWifiIconId || mLastWimaxIconId != mWimaxIconId || mLastDataTypeIconId != mDataTypeIconId @@ -1224,105 +1147,30 @@ public class NetworkController extends BroadcastReceiver { // the phone icon on phones if (mLastPhoneSignalIconId != mPhoneSignalIconId) { mLastPhoneSignalIconId = mPhoneSignalIconId; - N = mPhoneSignalIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mPhoneSignalIconViews.get(i); - if (mPhoneSignalIconId == 0) { - v.setVisibility(View.GONE); - } else { - v.setVisibility(View.VISIBLE); - v.setImageResource(mPhoneSignalIconId); - v.setContentDescription(mContentDescriptionPhoneSignal); - } - } } // the data icon on phones if (mLastDataDirectionIconId != mDataDirectionIconId) { mLastDataDirectionIconId = mDataDirectionIconId; - N = mDataDirectionIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mDataDirectionIconViews.get(i); - v.setImageResource(mDataDirectionIconId); - v.setContentDescription(mContentDescriptionDataType); - } } // the wifi icon on phones if (mLastWifiIconId != mWifiIconId) { mLastWifiIconId = mWifiIconId; - N = mWifiIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mWifiIconViews.get(i); - if (mWifiIconId == 0) { - v.setVisibility(View.GONE); - } else { - v.setVisibility(View.VISIBLE); - v.setImageResource(mWifiIconId); - v.setContentDescription(mContentDescriptionWifi); - } - } } // the wimax icon on phones if (mLastWimaxIconId != mWimaxIconId) { mLastWimaxIconId = mWimaxIconId; - N = mWimaxIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mWimaxIconViews.get(i); - if (mWimaxIconId == 0) { - v.setVisibility(View.GONE); - } else { - v.setVisibility(View.VISIBLE); - v.setImageResource(mWimaxIconId); - v.setContentDescription(mContentDescriptionWimax); - } - } } // the combined data signal icon if (mLastCombinedSignalIconId != combinedSignalIconId) { mLastCombinedSignalIconId = combinedSignalIconId; - N = mCombinedSignalIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mCombinedSignalIconViews.get(i); - v.setImageResource(combinedSignalIconId); - v.setContentDescription(mContentDescriptionCombinedSignal); - } } // the data network type overlay if (mLastDataTypeIconId != mDataTypeIconId) { mLastDataTypeIconId = mDataTypeIconId; - N = mDataTypeIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mDataTypeIconViews.get(i); - if (mDataTypeIconId == 0) { - v.setVisibility(View.GONE); - } else { - v.setVisibility(View.VISIBLE); - v.setImageResource(mDataTypeIconId); - v.setContentDescription(mContentDescriptionDataType); - } - } - } - - // the data direction overlay - if (mLastDataDirectionOverlayIconId != combinedActivityIconId) { - if (DEBUG) { - Log.d(TAG, "changing data overlay icon id to " + combinedActivityIconId); - } - mLastDataDirectionOverlayIconId = combinedActivityIconId; - N = mDataDirectionOverlayIconViews.size(); - for (int i=0; i<N; i++) { - final ImageView v = mDataDirectionOverlayIconViews.get(i); - if (combinedActivityIconId == 0) { - v.setVisibility(View.GONE); - } else { - v.setVisibility(View.VISIBLE); - v.setImageResource(combinedActivityIconId); - v.setContentDescription(mContentDescriptionDataType); - } - } } // the combinedLabel in the notification panel @@ -1481,10 +1329,6 @@ public class NetworkController extends BroadcastReceiver { pw.print(Integer.toHexString(mLastDataDirectionIconId)); pw.print("/"); pw.println(getResourceName(mLastDataDirectionIconId)); - pw.print(" mLastDataDirectionOverlayIconId=0x"); - pw.print(Integer.toHexString(mLastDataDirectionOverlayIconId)); - pw.print("/"); - pw.println(getResourceName(mLastDataDirectionOverlayIconId)); pw.print(" mLastWifiIconId=0x"); pw.print(Integer.toHexString(mLastWifiIconId)); pw.print("/"); |