diff options
author | TK MUN <tk.mun@samsung.com> | 2011-02-23 18:55:55 +0900 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-03-09 22:37:08 -0800 |
commit | 4bdab1751f0db3b2f03e8c58ef5c11a543dfa3c7 (patch) | |
tree | 6411cda792c42125741dde1fbf27a5e1ea97db0e /packages/SystemUI | |
parent | 33029221619f14577bd0d0e7c2f815abc8f1b8ea (diff) | |
download | frameworks_base-4bdab1751f0db3b2f03e8c58ef5c11a543dfa3c7.zip frameworks_base-4bdab1751f0db3b2f03e8c58ef5c11a543dfa3c7.tar.gz frameworks_base-4bdab1751f0db3b2f03e8c58ef5c11a543dfa3c7.tar.bz2 |
DO NOT MERGE WiMAX support
- In Connectivity service, start WiMAX service
- 4G icon display in StatusBarPolicy
- Add DHCP renew
- Add radio for WiMAX
Change-Id: Iffff012b270d80e84ec8fbd4486921a8adb847dd
Signed-off-by: TK MUN <tk.mun@samsung.com>
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java index 9ef6e6f..a4789a1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java @@ -74,6 +74,7 @@ import com.android.internal.telephony.cdma.TtyIntent; import com.android.server.am.BatteryStatsService; import com.android.systemui.R; +import android.net.wimax.WimaxManagerConstants; /** * This class contains all of the policy about which icons are installed in the status @@ -341,6 +342,19 @@ public class StatusBarPolicy { private int mLastWifiSignalLevel = -1; private boolean mIsWifiConnected = false; + //4G + private static final int[][] sDataNetType_4g = { + { R.drawable.stat_sys_data_connected_4g, + R.drawable.stat_sys_data_out_4g, + R.drawable.stat_sys_data_in_4g, + R.drawable.stat_sys_data_inandout_4g }, + { R.drawable.stat_sys_data_fully_connected_4g, + R.drawable.stat_sys_data_fully_out_4g, + R.drawable.stat_sys_data_fully_in_4g, + R.drawable.stat_sys_data_fully_inandout_4g } + }; + private boolean mIsWimaxConnected = false; + // state of inet connection - 0 not connected, 100 connected private int mInetCondition = 0; @@ -398,6 +412,9 @@ public class StatusBarPolicy { // TODO - stop using other means to get wifi/mobile info updateConnectivity(intent); } + else if (action.equals(WimaxManagerConstants.WIMAX_DATA_USED_ACTION)) { + updateWiMAX(intent); + } } }; @@ -438,6 +455,15 @@ public class StatusBarPolicy { mService.setIconVisibility("wifi", false); // wifi will get updated by the sticky intents + // wimax + //enable/disable wimax depending on the value in config.xml + boolean isWimaxEnabled = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_wimaxEnabled); + if (isWimaxEnabled) { + mService.setIcon("wimax", R.drawable.stat_sys_data_connected_4g, 0); + mService.setIconVisibility("wimax", false); + } + // TTY status mService.setIcon("tty", R.drawable.stat_sys_tty_mode, 0); mService.setIconVisibility("tty", false); @@ -503,6 +529,8 @@ public class StatusBarPolicy { filter.addAction(TtyIntent.TTY_ENABLED_CHANGE_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); + filter.addAction(WimaxManagerConstants.WIMAX_DATA_USED_ACTION); + mContext.registerReceiver(mIntentReceiver, filter, null, mHandler); // load config to determine if to distinguish Hspa data icon @@ -744,6 +772,17 @@ public class StatusBarPolicy { } updateSignalStrength(); // apply any change in mInetCondition break; + case ConnectivityManager.TYPE_WIMAX: + mInetCondition = inetCondition; + if (info.isConnected()) { + mIsWimaxConnected = true; + mService.setIconVisibility("wimax", true); + } else { + mIsWimaxConnected = false; + mService.setIconVisibility("wimax", false); + } + updateWiMAX(intent); + break; } } @@ -1124,6 +1163,17 @@ public class StatusBarPolicy { } } + private final void updateWiMAX(Intent intent) { + final String action = intent.getAction(); + int iconId = sDataNetType_4g[0][0]; + if (action.equals(WimaxManagerConstants.WIMAX_DATA_USED_ACTION)) { + int nUpDown = intent.getIntExtra(WimaxManagerConstants.EXTRA_UP_DOWN_DATA, 0); + iconId = sDataNetType_4g[mInetCondition][nUpDown]; + mService.setIcon("wimax", iconId, 0); + mService.setIconVisibility("wimax", mIsWimaxConnected); + } + } + private final void updateGps(Intent intent) { final String action = intent.getAction(); final boolean enabled = intent.getBooleanExtra(LocationManager.EXTRA_GPS_ENABLED, false); |