Loading packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -108,4 +108,6 @@ <!-- Recent apps label. Shown as title on recent apps panel --> <string name="recent_tasks_app_label">Apps</string> <!-- Network connection string for Bluetooth Reverse Tethering --> <string name="bluetooth_tethered">Bluetooth tethered"</string> </resources> packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +33 −10 Original line number Diff line number Diff line Loading @@ -85,6 +85,11 @@ public class NetworkController extends BroadcastReceiver { String mWifiSsid; int mWifiIconId; // bluetooth private boolean mBluetoothTethered = false; private int mBluetoothTetherIconId = com.android.internal.R.drawable.stat_sys_tether_bluetooth; // data connectivity (regardless of state, can we access the internet?) // state of inet connection - 0 not connected, 100 connected private int mInetCondition = 0; Loading Loading @@ -649,13 +654,22 @@ public class NetworkController extends BroadcastReceiver { mInetCondition = inetCondition; updateWifiIcons(); break; case ConnectivityManager.TYPE_BLUETOOTH: mInetCondition = inetCondition; if (info != null) { mBluetoothTethered = info.isConnected() ? true: false; } else { mBluetoothTethered = false; } break; } } // ===== Update the views ======================================================= // figure out what to show: first wifi, then 3G, then nothing // figure out what to show- there should be one connected network or nothing // General order of preference is: wifi, 3G than bluetooth. This might vary by product. void refreshViews() { Context context = mContext; Loading @@ -672,12 +686,16 @@ public class NetworkController extends BroadcastReceiver { } combinedSignalIconId = mWifiIconId; dataTypeIconId = 0; } else { if (mDataConnected) { } else if (mDataConnected) { label = mNetworkName; combinedSignalIconId = mDataSignalIconId; dataTypeIconId = mDataTypeIconId; } else if (mBluetoothTethered) { label = mContext.getString(R.string.bluetooth_tethered); combinedSignalIconId = mBluetoothTetherIconId; dataTypeIconId = 0; } else { label = context.getString(R.string.status_bar_settings_signal_meter_disconnected); } combinedSignalIconId = mDataSignalIconId; dataTypeIconId = mDataTypeIconId; } Loading @@ -689,7 +707,8 @@ public class NetworkController extends BroadcastReceiver { + " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId) + " mDataSignalIconId=0x" + Integer.toHexString(mDataSignalIconId) + " mDataTypeIconId=0x" + Integer.toHexString(mDataTypeIconId) + " mWifiIconId=0x" + Integer.toHexString(mWifiIconId)); + " mWifiIconId=0x" + Integer.toHexString(mWifiIconId) + "mBluetoothTetherIconId=0x" + Integer.toHexString(mBluetoothTetherIconId)); } // the phone icon on phones Loading Loading @@ -809,6 +828,10 @@ public class NetworkController extends BroadcastReceiver { pw.print(" mWifiIconId="); pw.println(mWifiIconId); pw.println(" - Bluetooth ----"); pw.print(" mBtReverseTethered="); pw.println(mBluetoothTethered); pw.println(" - connectivity ------"); pw.print(" mInetCondition="); pw.println(mInetCondition); Loading Loading
packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -108,4 +108,6 @@ <!-- Recent apps label. Shown as title on recent apps panel --> <string name="recent_tasks_app_label">Apps</string> <!-- Network connection string for Bluetooth Reverse Tethering --> <string name="bluetooth_tethered">Bluetooth tethered"</string> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +33 −10 Original line number Diff line number Diff line Loading @@ -85,6 +85,11 @@ public class NetworkController extends BroadcastReceiver { String mWifiSsid; int mWifiIconId; // bluetooth private boolean mBluetoothTethered = false; private int mBluetoothTetherIconId = com.android.internal.R.drawable.stat_sys_tether_bluetooth; // data connectivity (regardless of state, can we access the internet?) // state of inet connection - 0 not connected, 100 connected private int mInetCondition = 0; Loading Loading @@ -649,13 +654,22 @@ public class NetworkController extends BroadcastReceiver { mInetCondition = inetCondition; updateWifiIcons(); break; case ConnectivityManager.TYPE_BLUETOOTH: mInetCondition = inetCondition; if (info != null) { mBluetoothTethered = info.isConnected() ? true: false; } else { mBluetoothTethered = false; } break; } } // ===== Update the views ======================================================= // figure out what to show: first wifi, then 3G, then nothing // figure out what to show- there should be one connected network or nothing // General order of preference is: wifi, 3G than bluetooth. This might vary by product. void refreshViews() { Context context = mContext; Loading @@ -672,12 +686,16 @@ public class NetworkController extends BroadcastReceiver { } combinedSignalIconId = mWifiIconId; dataTypeIconId = 0; } else { if (mDataConnected) { } else if (mDataConnected) { label = mNetworkName; combinedSignalIconId = mDataSignalIconId; dataTypeIconId = mDataTypeIconId; } else if (mBluetoothTethered) { label = mContext.getString(R.string.bluetooth_tethered); combinedSignalIconId = mBluetoothTetherIconId; dataTypeIconId = 0; } else { label = context.getString(R.string.status_bar_settings_signal_meter_disconnected); } combinedSignalIconId = mDataSignalIconId; dataTypeIconId = mDataTypeIconId; } Loading @@ -689,7 +707,8 @@ public class NetworkController extends BroadcastReceiver { + " mDataDirectionIconId=0x" + Integer.toHexString(mDataDirectionIconId) + " mDataSignalIconId=0x" + Integer.toHexString(mDataSignalIconId) + " mDataTypeIconId=0x" + Integer.toHexString(mDataTypeIconId) + " mWifiIconId=0x" + Integer.toHexString(mWifiIconId)); + " mWifiIconId=0x" + Integer.toHexString(mWifiIconId) + "mBluetoothTetherIconId=0x" + Integer.toHexString(mBluetoothTetherIconId)); } // the phone icon on phones Loading Loading @@ -809,6 +828,10 @@ public class NetworkController extends BroadcastReceiver { pw.print(" mWifiIconId="); pw.println(mWifiIconId); pw.println(" - Bluetooth ----"); pw.print(" mBtReverseTethered="); pw.println(mBluetoothTethered); pw.println(" - connectivity ------"); pw.print(" mInetCondition="); pw.println(mInetCondition); Loading