Merge "new signal strength assets"
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 459 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 431 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1x.png
Normal file
|
After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 458 B |
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 458 B |
|
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 450 B |
|
Before Width: | Height: | Size: 763 B After Width: | Height: | Size: 450 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3g.png
Normal file
|
After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 424 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 424 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_edge.png
Normal file
|
After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 517 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_gprs.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_hsdpa.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
packages/SystemUI/res/drawable-mdpi/stat_sys_signal_roam.png
Normal file
|
After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 554 B |
|
After Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 492 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 492 B |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 616 B |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 616 B |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 497 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 497 B |
@@ -80,21 +80,24 @@
|
||||
android:layout_width="48dip"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/battery"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="18dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/network"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="14dp"
|
||||
android:src="@drawable/ic_sysbar_wifi_mini"
|
||||
android:layout_marginTop="19dp"
|
||||
android:layout_marginRight="4dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/battery"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="19dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="2dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
android:layout_below="@id/date"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:src="@drawable/ic_sysbar_battery_mini"
|
||||
android:baseline="17dp"
|
||||
/>
|
||||
|
||||
@@ -98,7 +97,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_toRightOf="@id/battery_text"
|
||||
android:layout_alignBaseline="@id/battery"
|
||||
android:src="@drawable/ic_sysbar_wifi_mini"
|
||||
android:baseline="21dp"
|
||||
/>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import android.telephony.ServiceState;
|
||||
import android.telephony.SignalStrength;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Slog;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -57,8 +58,6 @@ public class NetworkController extends BroadcastReceiver {
|
||||
boolean mHspaDataDistinguishable;
|
||||
final TelephonyManager mPhone;
|
||||
boolean mDataConnected;
|
||||
int mPhoneSignalIconId;
|
||||
int mDataIconId;
|
||||
IccCard.State mSimState = IccCard.State.READY;
|
||||
int mPhoneState = TelephonyManager.CALL_STATE_IDLE;
|
||||
int mDataState = TelephonyManager.DATA_DISCONNECTED;
|
||||
@@ -66,6 +65,10 @@ public class NetworkController extends BroadcastReceiver {
|
||||
ServiceState mServiceState;
|
||||
SignalStrength mSignalStrength;
|
||||
int[] mDataIconList = TelephonyIcons.DATA_G[0];
|
||||
int mPhoneSignalIconId;
|
||||
int mDataDirectionIconId;
|
||||
int mDataSignalIconId;
|
||||
int mDataTypeIconId;
|
||||
|
||||
// wifi
|
||||
final WifiManager mWifiManager;
|
||||
@@ -81,11 +84,17 @@ public class NetworkController extends BroadcastReceiver {
|
||||
|
||||
// our ui
|
||||
Context mContext;
|
||||
ArrayList<ImageView> mPhoneIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mDataIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mPhoneSignalIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mDataDirectionIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mWifiIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mCombinedSignalIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<ImageView> mDataTypeIconViews = new ArrayList<ImageView>();
|
||||
ArrayList<TextView> mLabelViews = new ArrayList<TextView>();
|
||||
int mLastPhoneSignalIconId = -1;
|
||||
int mLastCombinedDataIconId = -1;
|
||||
int mLastDataDirectionIconId = -1;
|
||||
int mLastWifiIconId = -1;
|
||||
int mLastCombinedSignalIconId = -1;
|
||||
int mLastDataTypeIconId = -1;
|
||||
String mLastLabel = "";
|
||||
|
||||
// yuck -- stop doing this here and put it in the framework
|
||||
@@ -124,12 +133,24 @@ public class NetworkController extends BroadcastReceiver {
|
||||
mBatteryStats = BatteryStatsService.getService();
|
||||
}
|
||||
|
||||
public void addPhoneIconView(ImageView v) {
|
||||
mPhoneIconViews.add(v);
|
||||
public void addPhoneSignalIconView(ImageView v) {
|
||||
mPhoneSignalIconViews.add(v);
|
||||
}
|
||||
|
||||
public void addCombinedDataIconView(ImageView v) {
|
||||
mDataIconViews.add(v);
|
||||
public void addDataDirectionIconView(ImageView v) {
|
||||
mDataDirectionIconViews.add(v);
|
||||
}
|
||||
|
||||
public void addWifiIconView(ImageView v) {
|
||||
mWifiIconViews.add(v);
|
||||
}
|
||||
|
||||
public void addCombinedSignalIconView(ImageView v) {
|
||||
mCombinedSignalIconViews.add(v);
|
||||
}
|
||||
|
||||
public void addDataTypeIconView(ImageView v) {
|
||||
mDataTypeIconViews.add(v);
|
||||
}
|
||||
|
||||
public void addLabelView(TextView v) {
|
||||
@@ -315,12 +336,15 @@ public class NetworkController extends BroadcastReceiver {
|
||||
if (Settings.System.getInt(mContext.getContentResolver(),
|
||||
Settings.System.AIRPLANE_MODE_ON, 0) == 1) {
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_flightmode;
|
||||
mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
|
||||
} else {
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
|
||||
mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
|
||||
}
|
||||
} else {
|
||||
if (mSignalStrength == null) {
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
|
||||
mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null
|
||||
} else if (isCdma()) {
|
||||
// If 3G(EV) and 1x network are available than 3G should be
|
||||
// displayed, displayed RSSI should be from the EV side.
|
||||
@@ -338,6 +362,7 @@ public class NetworkController extends BroadcastReceiver {
|
||||
iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition];
|
||||
}
|
||||
mPhoneSignalIconId = iconList[iconLevel];
|
||||
mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel];
|
||||
} else {
|
||||
int asu = mSignalStrength.getGsmSignalStrength();
|
||||
|
||||
@@ -360,6 +385,7 @@ public class NetworkController extends BroadcastReceiver {
|
||||
iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition];
|
||||
}
|
||||
mPhoneSignalIconId = iconList[iconLevel];
|
||||
mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,36 +394,47 @@ public class NetworkController extends BroadcastReceiver {
|
||||
switch (net) {
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
mDataIconList = TelephonyIcons.DATA_E[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_edge;
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_3g;
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_HSDPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSUPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPA:
|
||||
if (mHspaDataDistinguishable) {
|
||||
mDataIconList = TelephonyIcons.DATA_H[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_hsdpa;
|
||||
} else {
|
||||
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_3g;
|
||||
}
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_CDMA:
|
||||
// display 1xRTT for IS95A/B
|
||||
mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_1x;
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_1xRTT:
|
||||
mDataIconList = TelephonyIcons.DATA_1X[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_1x;
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_A:
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_B:
|
||||
mDataIconList = TelephonyIcons.DATA_3G[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_3g;
|
||||
break;
|
||||
// TODO - add support for NETWORK_TYPE_LTE and NETWORK_TYPE_EHRPD
|
||||
default:
|
||||
mDataIconList = TelephonyIcons.DATA_G[mInetCondition];
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_gprs;
|
||||
break;
|
||||
}
|
||||
if ((isCdma() && isCdmaEri()) || mPhone.isNetworkRoaming()) {
|
||||
mDataTypeIconId = R.drawable.stat_sys_signal_roam;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCdmaEri() {
|
||||
@@ -434,7 +471,7 @@ public class NetworkController extends BroadcastReceiver {
|
||||
iconId = mDataIconList[0];
|
||||
break;
|
||||
}
|
||||
mDataIconId = iconId;
|
||||
mDataDirectionIconId = iconId;
|
||||
} else {
|
||||
iconId = 0;
|
||||
visible = false;
|
||||
@@ -475,7 +512,7 @@ public class NetworkController extends BroadcastReceiver {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
mDataIconId = iconId;
|
||||
mDataDirectionIconId = iconId;
|
||||
mDataConnected = visible;
|
||||
}
|
||||
|
||||
@@ -572,8 +609,10 @@ public class NetworkController extends BroadcastReceiver {
|
||||
void refreshViews() {
|
||||
Context context = mContext;
|
||||
|
||||
int combinedDataIconId;
|
||||
int combinedSignalIconId;
|
||||
int dataTypeIconId;
|
||||
String label;
|
||||
int N;
|
||||
|
||||
if (mWifiConnected) {
|
||||
if (mWifiSsid == null) {
|
||||
@@ -582,35 +621,84 @@ public class NetworkController extends BroadcastReceiver {
|
||||
label = context.getString(R.string.system_panel_signal_meter_wifi_ssid_format,
|
||||
mWifiSsid);
|
||||
}
|
||||
combinedDataIconId = mWifiIconId;
|
||||
} else if (mDataConnected) {
|
||||
label = context.getString(R.string.system_panel_signal_meter_data_connected);
|
||||
combinedDataIconId = mDataIconId;
|
||||
combinedSignalIconId = mWifiIconId;
|
||||
dataTypeIconId = 0;
|
||||
} else {
|
||||
label = context.getString(R.string.system_panel_signal_meter_disconnected);
|
||||
combinedDataIconId = 0;
|
||||
if (mDataConnected) {
|
||||
label = context.getString(R.string.system_panel_signal_meter_data_connected);
|
||||
} else {
|
||||
label = context.getString(R.string.system_panel_signal_meter_disconnected);
|
||||
}
|
||||
combinedSignalIconId = mDataSignalIconId;
|
||||
dataTypeIconId = mDataTypeIconId;
|
||||
}
|
||||
|
||||
int N;
|
||||
if (false) {
|
||||
Slog.d(TAG, "refreshViews combinedSignalIconId=0x"
|
||||
+ Integer.toHexString(mPhoneSignalIconId)
|
||||
+ " mPhoneSignalIconId=0x" + Integer.toHexString(mPhoneSignalIconId)
|
||||
+ " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId)
|
||||
+ " mDataSignalIconId=0x" + Integer.toHexString(mDataSignalIconId)
|
||||
+ " mDataTypeIconId=0x" + Integer.toHexString(mDataTypeIconId)
|
||||
+ " mWifiIconId=0x" + Integer.toHexString(mWifiIconId));
|
||||
}
|
||||
|
||||
// the phone icon on phones
|
||||
if (mLastPhoneSignalIconId != mPhoneSignalIconId) {
|
||||
mLastPhoneSignalIconId = mPhoneSignalIconId;
|
||||
N = mPhoneIconViews.size();
|
||||
N = mPhoneSignalIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
ImageView v = mPhoneIconViews.get(i);
|
||||
final ImageView v = mPhoneSignalIconViews.get(i);
|
||||
v.setImageResource(mPhoneSignalIconId);
|
||||
}
|
||||
}
|
||||
|
||||
if (mLastCombinedDataIconId != combinedDataIconId) {
|
||||
mLastCombinedDataIconId = combinedDataIconId;
|
||||
N = mDataIconViews.size();
|
||||
// the data icon on phones
|
||||
if (mLastDataDirectionIconId != mDataDirectionIconId) {
|
||||
mLastDataDirectionIconId = mDataDirectionIconId;
|
||||
N = mDataDirectionIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
ImageView v = mDataIconViews.get(i);
|
||||
v.setImageResource(combinedDataIconId);
|
||||
final ImageView v = mDataDirectionIconViews.get(i);
|
||||
v.setImageResource(mDataDirectionIconId);
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
v.setImageResource(mWifiIconId);
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
// the data network type overlay
|
||||
if (mLastDataTypeIconId != dataTypeIconId) {
|
||||
mLastDataTypeIconId = dataTypeIconId;
|
||||
N = mDataTypeIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
final ImageView v = mDataTypeIconViews.get(i);
|
||||
if (dataTypeIconId == 0) {
|
||||
v.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.setImageResource(dataTypeIconId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the label in the notification panel
|
||||
if (!mLastLabel.equals(label)) {
|
||||
mLastLabel = label;
|
||||
N = mLabelViews.size();
|
||||
|
||||
@@ -48,6 +48,8 @@ class TelephonyIcons {
|
||||
R.drawable.stat_sys_r_signal_4_fully }
|
||||
};
|
||||
|
||||
static final int[][] DATA_SIGNAL_STRENGTH = TELEPHONY_SIGNAL_STRENGTH;
|
||||
|
||||
//***** Data connection icons
|
||||
|
||||
//GSM/UMTS
|
||||
|
||||
@@ -157,7 +157,7 @@ public class TabletStatusBar extends StatusBar {
|
||||
mBatteryController.addIconView((ImageView)mNotificationPanel.findViewById(R.id.battery));
|
||||
mBatteryController.addLabelView(
|
||||
(TextView)mNotificationPanel.findViewById(R.id.battery_text));
|
||||
mNetworkController.addCombinedDataIconView(
|
||||
mNetworkController.addCombinedSignalIconView(
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.network));
|
||||
mNetworkController.addLabelView(
|
||||
(TextView)mNotificationPanel.findViewById(R.id.network_text));
|
||||
@@ -282,7 +282,7 @@ public class TabletStatusBar extends StatusBar {
|
||||
mBatteryController = new BatteryController(mContext);
|
||||
mBatteryController.addIconView((ImageView)sb.findViewById(R.id.battery));
|
||||
mNetworkController = new NetworkController(mContext);
|
||||
mNetworkController.addCombinedDataIconView((ImageView)sb.findViewById(R.id.network));
|
||||
mNetworkController.addCombinedSignalIconView((ImageView)sb.findViewById(R.id.network));
|
||||
|
||||
// The navigation buttons
|
||||
mNavigationArea = sb.findViewById(R.id.navigationArea);
|
||||
|
||||