am 5404812d: Merge "When out of range, show device-appropriate no-signal bars." into honeycomb
* commit '5404812dee9dccbbd43df81752f3061742235982': When out of range, show device-appropriate no-signal bars.
This commit is contained in:
@@ -34,6 +34,7 @@ import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Binder;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Telephony;
|
||||
import android.telephony.PhoneStateListener;
|
||||
@@ -85,7 +86,7 @@ public class NetworkController extends BroadcastReceiver {
|
||||
boolean mWifiEnabled, mWifiConnected;
|
||||
int mWifiLevel;
|
||||
String mWifiSsid;
|
||||
int mWifiIconId;
|
||||
int mWifiIconId = 0;
|
||||
|
||||
// bluetooth
|
||||
private boolean mBluetoothTethered = false;
|
||||
@@ -123,6 +124,9 @@ public class NetworkController extends BroadcastReceiver {
|
||||
public NetworkController(Context context) {
|
||||
mContext = context;
|
||||
|
||||
// set up the default wifi icon, used when no radios have ever appeared
|
||||
updateWifiIcons();
|
||||
|
||||
// telephony
|
||||
mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
mPhone.listen(mPhoneStateListener,
|
||||
@@ -256,6 +260,10 @@ public class NetworkController extends BroadcastReceiver {
|
||||
}
|
||||
mDataState = state;
|
||||
mDataNetType = networkType;
|
||||
if (state < 0) {
|
||||
// device without a data connection
|
||||
mSignalStrength = null;
|
||||
}
|
||||
updateDataNetType();
|
||||
updateDataIcon();
|
||||
refreshViews();
|
||||
@@ -321,6 +329,11 @@ public class NetworkController extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasMobileDataFeature() {
|
||||
// XXX: HAX: replace when a more reliable method is available
|
||||
return (! "wifi-only".equals(SystemProperties.get("ro.carrier")));
|
||||
}
|
||||
|
||||
private int getCdmaLevel() {
|
||||
if (mSignalStrength == null) return 0;
|
||||
final int cdmaDbm = mSignalStrength.getCdmaDbm();
|
||||
@@ -723,11 +736,13 @@ public class NetworkController extends BroadcastReceiver {
|
||||
dataTypeIconId = 0;
|
||||
} else {
|
||||
label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
|
||||
combinedSignalIconId = mDataSignalIconId;
|
||||
// On devices without mobile radios, we want to show the wifi icon
|
||||
combinedSignalIconId =
|
||||
hasMobileDataFeature() ? mDataSignalIconId : mWifiIconId;
|
||||
dataTypeIconId = 0;
|
||||
}
|
||||
|
||||
if (false) {
|
||||
if (DEBUG) {
|
||||
Slog.d(TAG, "refreshViews combinedSignalIconId=0x"
|
||||
+ Integer.toHexString(combinedSignalIconId)
|
||||
+ "/" + getResourceName(combinedSignalIconId)
|
||||
|
||||
@@ -20,11 +20,13 @@ import com.android.systemui.R;
|
||||
|
||||
class WifiIcons {
|
||||
static final int[][] WIFI_SIGNAL_STRENGTH = {
|
||||
{ R.drawable.stat_sys_wifi_signal_1,
|
||||
{ R.drawable.stat_sys_wifi_signal_0,
|
||||
R.drawable.stat_sys_wifi_signal_1,
|
||||
R.drawable.stat_sys_wifi_signal_2,
|
||||
R.drawable.stat_sys_wifi_signal_3,
|
||||
R.drawable.stat_sys_wifi_signal_4 },
|
||||
{ R.drawable.stat_sys_wifi_signal_1_fully,
|
||||
{ R.drawable.stat_sys_wifi_signal_0,
|
||||
R.drawable.stat_sys_wifi_signal_1_fully,
|
||||
R.drawable.stat_sys_wifi_signal_2_fully,
|
||||
R.drawable.stat_sys_wifi_signal_3_fully,
|
||||
R.drawable.stat_sys_wifi_signal_4_fully }
|
||||
|
||||
Reference in New Issue
Block a user