diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-15 19:49:53 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-15 19:49:53 -0700 |
commit | 5b7c5e055233154d2a82cc2d084cf983d12bb3a7 (patch) | |
tree | 098c91ffe7ea93e74e1b4906cea5f0c2360ec556 /packages/SystemUI | |
parent | 4e0bfd70d090b5653dd00c5a671db0519086dcfe (diff) | |
parent | f434dd1660f222a1ee85e77c98893b90857805c2 (diff) | |
download | frameworks_base-5b7c5e055233154d2a82cc2d084cf983d12bb3a7.zip frameworks_base-5b7c5e055233154d2a82cc2d084cf983d12bb3a7.tar.gz frameworks_base-5b7c5e055233154d2a82cc2d084cf983d12bb3a7.tar.bz2 |
am f434dd16: am 134b28a7: Merge "Update Inet Connection Status display" into gingerbread
Merge commit 'f434dd1660f222a1ee85e77c98893b90857805c2'
* commit 'f434dd1660f222a1ee85e77c98893b90857805c2':
Update Inet Connection Status display
Diffstat (limited to 'packages/SystemUI')
23 files changed, 48 insertions, 32 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully.png Binary files differnew file mode 100644 index 0000000..95ba181 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully.png Binary files differnew file mode 100644 index 0000000..adf668d --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully.png Binary files differnew file mode 100644 index 0000000..7bf6b51 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully.png Binary files differnew file mode 100644 index 0000000..78738ac --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully.png Binary files differnew file mode 100644 index 0000000..ac88143 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png Binary files differnew file mode 100644 index 0000000..3e317dd --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png Binary files differnew file mode 100644 index 0000000..72329f8 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png Binary files differnew file mode 100644 index 0000000..558c49c --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png Binary files differnew file mode 100644 index 0000000..6440bdd --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png Binary files differnew file mode 100644 index 0000000..fe20423 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png Binary files differdeleted file mode 100644 index bfbf18e..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png Binary files differdeleted file mode 100644 index 896ba4d..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png Binary files differdeleted file mode 100644 index af79eff..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png Binary files differdeleted file mode 100644 index 92c09c8..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png Binary files differdeleted file mode 100644 index f04fb11..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png Binary files differdeleted file mode 100644 index cb7b7b3..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png Binary files differdeleted file mode 100644 index 5376e92..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png Binary files differdeleted file mode 100644 index fd54363..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png Binary files differdeleted file mode 100644 index 6c4873a..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png Binary files differdeleted file mode 100644 index a3320cb..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png Binary files differdeleted file mode 100755 index 2f4fd4f..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_flightmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png Binary files differdeleted file mode 100644 index 5aa23f6..0000000 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null.png +++ /dev/null diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java index 5dedcc9..7ccf210 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java @@ -120,19 +120,29 @@ public class StatusBarPolicy { //***** Signal strength icons //GSM/UMTS - private static final int[] sSignalImages = new int[] { - R.drawable.stat_sys_signal_0, - R.drawable.stat_sys_signal_1, - R.drawable.stat_sys_signal_2, - R.drawable.stat_sys_signal_3, - R.drawable.stat_sys_signal_4 + private static final int[][] sSignalImages = { + { R.drawable.stat_sys_signal_0, + R.drawable.stat_sys_signal_1, + R.drawable.stat_sys_signal_2, + R.drawable.stat_sys_signal_3, + R.drawable.stat_sys_signal_4 }, + { R.drawable.stat_sys_signal_0_fully, + R.drawable.stat_sys_signal_1_fully, + R.drawable.stat_sys_signal_2_fully, + R.drawable.stat_sys_signal_3_fully, + R.drawable.stat_sys_signal_4_fully } }; - private static final int[] sSignalImages_r = new int[] { - R.drawable.stat_sys_r_signal_0, - R.drawable.stat_sys_r_signal_1, - R.drawable.stat_sys_r_signal_2, - R.drawable.stat_sys_r_signal_3, - R.drawable.stat_sys_r_signal_4 + private static final int[][] sSignalImages_r = { + { R.drawable.stat_sys_r_signal_0, + R.drawable.stat_sys_r_signal_1, + R.drawable.stat_sys_r_signal_2, + R.drawable.stat_sys_r_signal_3, + R.drawable.stat_sys_r_signal_4 }, + { R.drawable.stat_sys_r_signal_0_fully, + R.drawable.stat_sys_r_signal_1_fully, + R.drawable.stat_sys_r_signal_2_fully, + R.drawable.stat_sys_r_signal_3_fully, + R.drawable.stat_sys_r_signal_4_fully } }; private static final int[] sRoamingIndicatorImages_cdma = new int[] { R.drawable.stat_sys_roaming_cdma_0, //Standard Roaming Indicator @@ -330,7 +340,9 @@ public class StatusBarPolicy { private int mLastWifiSignalLevel = -1; private boolean mIsWifiConnected = false; - private int mLastWifiInetConnectivityState = 0; + + // state of inet connection - 0 not connected, 100 connected + private int mInetCondition = 0; // sync state // If sync is active the SyncActive icon is displayed. If sync is not active but @@ -381,7 +393,8 @@ public class StatusBarPolicy { else if (action.equals(TtyIntent.TTY_ENABLED_CHANGE_ACTION)) { updateTTY(intent); } - else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { + else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION) || + action.equals(ConnectivityManager.INET_CONDITION_ACTION)) { // TODO - stop using other means to get wifi/mobile info updateConnectivity(intent); } @@ -489,6 +502,7 @@ public class StatusBarPolicy { filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED); filter.addAction(TtyIntent.TTY_ENABLED_CHANGE_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); + filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); mContext.registerReceiver(mIntentReceiver, filter, null, mHandler); // load config to determine if to distinguish Hspa data icon @@ -704,19 +718,19 @@ public class StatusBarPolicy { if (info.isConnected()) { updateDataNetType(info.getSubtype(), connectionStatus); updateDataIcon(); + updateSignalStrength(); // apply any change in connectionStatus } break; case ConnectivityManager.TYPE_WIFI: if (info.isConnected()) { mIsWifiConnected = true; - mLastWifiInetConnectivityState = + mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0); int iconId; if (mLastWifiSignalLevel == -1) { - iconId = sWifiSignalImages[mLastWifiInetConnectivityState][0]; + iconId = sWifiSignalImages[mInetCondition][0]; } else { - iconId = sWifiSignalImages[mLastWifiInetConnectivityState] - [mLastWifiSignalLevel]; + iconId = sWifiSignalImages[mInetCondition][mLastWifiSignalLevel]; } mService.setIcon("wifi", iconId, 0); // Show the icon since wi-fi is connected @@ -724,13 +738,14 @@ public class StatusBarPolicy { } else { mLastWifiSignalLevel = -1; mIsWifiConnected = false; - mLastWifiInetConnectivityState = 0; + mInetCondition = 0; int iconId = sWifiSignalImages[0][0]; mService.setIcon("wifi", iconId, 0); // Hide the icon since we're not connected mService.setIconVisibility("wifi", false); } + updateSignalStrength(); // apply any change in mInetCondition break; } } @@ -764,6 +779,7 @@ public class StatusBarPolicy { mDataState = state; updateDataNetType(networkType, 0); updateDataIcon(); + updateSignalStrength(); // apply the change in connection status } @Override @@ -858,12 +874,12 @@ public class StatusBarPolicy { // Though mPhone is a Manager, this call is not an IPC if (mPhone.isNetworkRoaming()) { - iconList = sSignalImages_r; + iconList = sSignalImages_r[mInetCondition]; } else { - iconList = sSignalImages; + iconList = sSignalImages[mInetCondition]; } } else { - iconList = this.sSignalImages; + iconList = sSignalImages[mInetCondition]; // If 3G(EV) and 1x network are available than 3G should be // displayed, displayed RSSI should be from the EV side. @@ -925,37 +941,37 @@ public class StatusBarPolicy { } private final void updateDataNetType(int net, int inetCondition) { - int connected = (inetCondition > INET_CONDITION_THRESHOLD ? 1 : 0); + mInetCondition = (inetCondition > INET_CONDITION_THRESHOLD ? 1 : 0); switch (net) { case TelephonyManager.NETWORK_TYPE_EDGE: - mDataIconList = sDataNetType_e[connected]; + mDataIconList = sDataNetType_e[mInetCondition]; break; case TelephonyManager.NETWORK_TYPE_UMTS: - mDataIconList = sDataNetType_3g[connected]; + mDataIconList = sDataNetType_3g[mInetCondition]; break; case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: if (mHspaDataDistinguishable) { - mDataIconList = sDataNetType_h[connected]; + mDataIconList = sDataNetType_h[mInetCondition]; } else { - mDataIconList = sDataNetType_3g[connected]; + mDataIconList = sDataNetType_3g[mInetCondition]; } break; case TelephonyManager.NETWORK_TYPE_CDMA: // display 1xRTT for IS95A/B - mDataIconList = sDataNetType_1x[connected]; + mDataIconList = sDataNetType_1x[mInetCondition]; break; case TelephonyManager.NETWORK_TYPE_1xRTT: - mDataIconList = sDataNetType_1x[connected]; + mDataIconList = sDataNetType_1x[mInetCondition]; break; case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: - mDataIconList = sDataNetType_3g[connected]; + mDataIconList = sDataNetType_3g[mInetCondition]; break; default: - mDataIconList = sDataNetType_g[connected]; + mDataIconList = sDataNetType_g[mInetCondition]; break; } } @@ -1104,7 +1120,7 @@ public class StatusBarPolicy { if (newSignalLevel != mLastWifiSignalLevel) { mLastWifiSignalLevel = newSignalLevel; if (mIsWifiConnected) { - iconId = sWifiSignalImages[mLastWifiInetConnectivityState][newSignalLevel]; + iconId = sWifiSignalImages[mInetCondition][newSignalLevel]; } else { iconId = sWifiTemporarilyNotConnectedImage; } |