New stacked RSSI icons.
The signal strength, network type & flow indicator, and
battery have all been moved out of the policy and into the
status bar implementation itself, mirroring the change on
tablets. This means that they no longer use status bar icon
slots but instead are bespoke layouts and views.
GPS has also been removed and will return as a notification
(again, as was done in the Honeycomb tablet UI).
Bug: 4691638
Change-Id: I60df4871209b64209bfc5b3bf398651cc2e77b24
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 535 B |
|
Before Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 983 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 535 B |
|
Before Width: | Height: | Size: 1010 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 487 B |
|
Before Width: | Height: | Size: 627 B |
|
Before Width: | Height: | Size: 627 B |
|
Before Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 675 B |
|
Before Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 774 B |
|
Before Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 781 B |
|
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 487 B |
|
Before Width: | Height: | Size: 711 B |
|
Before Width: | Height: | Size: 734 B |
|
Before Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 895 B |
|
Before Width: | Height: | Size: 805 B |
|
Before Width: | Height: | Size: 931 B |
|
Before Width: | Height: | Size: 866 B |
|
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 674 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 674 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 528 B |
|
After Width: | Height: | Size: 528 B |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 672 B |
30
packages/SystemUI/res/drawable/stat_sys_battery.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2011, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:maxLevel="4" android:drawable="@drawable/stat_sys_battery_0" />
|
||||
<item android:maxLevel="15" android:drawable="@drawable/stat_sys_battery_15" />
|
||||
<item android:maxLevel="35" android:drawable="@drawable/stat_sys_battery_28" />
|
||||
<item android:maxLevel="49" android:drawable="@drawable/stat_sys_battery_43" />
|
||||
<item android:maxLevel="60" android:drawable="@drawable/stat_sys_battery_57" />
|
||||
<item android:maxLevel="75" android:drawable="@drawable/stat_sys_battery_71" />
|
||||
<item android:maxLevel="90" android:drawable="@drawable/stat_sys_battery_85" />
|
||||
<item android:maxLevel="100" android:drawable="@drawable/stat_sys_battery_100" />
|
||||
</level-list>
|
||||
|
||||
31
packages/SystemUI/res/drawable/stat_sys_battery_charge.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2011, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:maxLevel="4" android:drawable="@drawable/stat_sys_battery_charge_anim0" />
|
||||
<item android:maxLevel="15" android:drawable="@drawable/stat_sys_battery_charge_anim15" />
|
||||
<item android:maxLevel="35" android:drawable="@drawable/stat_sys_battery_charge_anim28" />
|
||||
<item android:maxLevel="49" android:drawable="@drawable/stat_sys_battery_charge_anim43" />
|
||||
<item android:maxLevel="60" android:drawable="@drawable/stat_sys_battery_charge_anim57" />
|
||||
<item android:maxLevel="75" android:drawable="@drawable/stat_sys_battery_charge_anim71" />
|
||||
<item android:maxLevel="90" android:drawable="@drawable/stat_sys_battery_charge_anim85" />
|
||||
<item android:maxLevel="100" android:drawable="@drawable/stat_sys_battery_charge_anim100" />
|
||||
</level-list>
|
||||
|
||||
|
||||
@@ -126,27 +126,10 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<FrameLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginRight="4dp"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/network_signal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/network_type"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/network_direction"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
/>
|
||||
</FrameLayout>
|
||||
<include layout="@layout/stacked_signal_icons"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="24dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/battery"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
57
packages/SystemUI/res/layout/stacked_signal_icons.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/* apps/common/assets/default/default/skins/StatusBar.xml
|
||||
**
|
||||
** Copyright 2011, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/mobile_signal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignLeft="@+id/wifi_signal"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/network_type"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignRight="@id/mobile_signal"
|
||||
android:layout_centerVertical="true"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/wifi_signal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="center"
|
||||
android:paddingLeft="7dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/network_direction"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
@@ -46,10 +46,29 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:paddingRight="6dip"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/signal_battery_cluster"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="6dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
>
|
||||
<include layout="@layout/stacked_signal_icons"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/battery"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingLeft="6dip"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.android.systemui.statusbar.policy.Clock
|
||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.Icon"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -21,29 +21,9 @@
|
||||
all of the currently visible notifications. [CHAR LIMIT=10]-->
|
||||
<string name="status_bar_clear_all_button">Clear all</string>
|
||||
|
||||
<!-- System panel ("Quick Settings") -->
|
||||
|
||||
<!-- Text to display underneath the graphical signal strength meter when
|
||||
no connection is available. [CHAR LIMIT=20] -->
|
||||
<string name="status_bar_settings_signal_meter_disconnected">
|
||||
No Internet connection
|
||||
</string>
|
||||
|
||||
<!-- Text to display underneath the graphical signal strength meter when
|
||||
it is displaying Wi-Fi status and Wi-Fi is connected to a network
|
||||
whose SSID is not available.
|
||||
[CHAR LIMIT=20] -->
|
||||
<string name="status_bar_settings_signal_meter_wifi_nossid">Wi-Fi connected</string>
|
||||
|
||||
<!-- Separator for PLMN and SPN in network name. -->
|
||||
<string name="status_bar_network_name_separator" translatable="false">" – "</string>
|
||||
|
||||
<!-- Notification text: when GPS is getting a fix [CHAR LIMIT=50] -->
|
||||
<string name="gps_notification_searching_text">Searching for GPS</string>
|
||||
|
||||
<!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] -->
|
||||
<string name="gps_notification_found_text">Location set by GPS</string>
|
||||
|
||||
<!-- Title for the pseudo-notification shown when notifications are disabled (do-not-disturb
|
||||
mode) -->
|
||||
<string name="notifications_off_title">Notifications off</string>
|
||||
|
||||
@@ -299,4 +299,23 @@
|
||||
|
||||
<!-- Content description of the ringer silent icon in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_ringer_silent">Ringer silent.</string>
|
||||
|
||||
<!-- Text to display underneath the graphical signal strength meter when
|
||||
no connection is available. [CHAR LIMIT=20] -->
|
||||
<string name="status_bar_settings_signal_meter_disconnected">
|
||||
No Internet connection
|
||||
</string>
|
||||
|
||||
<!-- Text to display underneath the graphical signal strength meter when
|
||||
it is displaying Wi-Fi status and Wi-Fi is connected to a network
|
||||
whose SSID is not available.
|
||||
[CHAR LIMIT=20] -->
|
||||
<string name="status_bar_settings_signal_meter_wifi_nossid">Wi-Fi connected</string>
|
||||
|
||||
<!-- Notification text: when GPS is getting a fix [CHAR LIMIT=50] -->
|
||||
<string name="gps_notification_searching_text">Searching for GPS</string>
|
||||
|
||||
<!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] -->
|
||||
<string name="gps_notification_found_text">Location set by GPS</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -82,7 +82,9 @@ import com.android.systemui.statusbar.NotificationData;
|
||||
import com.android.systemui.statusbar.StatusBar;
|
||||
import com.android.systemui.statusbar.StatusBarIconView;
|
||||
import com.android.systemui.statusbar.policy.DateView;
|
||||
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
import com.android.systemui.statusbar.policy.LocationController;
|
||||
import com.android.systemui.statusbar.policy.NetworkController;
|
||||
|
||||
public class PhoneStatusBar extends StatusBar {
|
||||
static final String TAG = "PhoneStatusBar";
|
||||
@@ -107,6 +109,11 @@ public class PhoneStatusBar extends StatusBar {
|
||||
|
||||
PhoneStatusBarPolicy mIconPolicy;
|
||||
|
||||
// These are no longer handled by the policy, because we need custom strategies for them
|
||||
BatteryController mBatteryController;
|
||||
LocationController mLocationController;
|
||||
NetworkController mNetworkController;
|
||||
|
||||
int mIconSize;
|
||||
Display mDisplay;
|
||||
|
||||
@@ -306,6 +313,32 @@ public class PhoneStatusBar extends StatusBar {
|
||||
setAreThereNotifications();
|
||||
mDateView.setVisibility(View.INVISIBLE);
|
||||
|
||||
// Other icons
|
||||
mLocationController = new LocationController(mContext); // will post a notification
|
||||
mBatteryController = new BatteryController(mContext);
|
||||
mBatteryController.addIconView((ImageView)sb.findViewById(R.id.battery));
|
||||
mNetworkController = new NetworkController(mContext);
|
||||
final ImageView comboRSSI =
|
||||
(ImageView)sb.findViewById(R.id.network_signal);
|
||||
if (comboRSSI != null) {
|
||||
mNetworkController.addCombinedSignalIconView(comboRSSI);
|
||||
}
|
||||
final ImageView mobileRSSI =
|
||||
(ImageView)sb.findViewById(R.id.mobile_signal);
|
||||
if (mobileRSSI != null) {
|
||||
mNetworkController.addPhoneSignalIconView(mobileRSSI);
|
||||
}
|
||||
final ImageView wifiRSSI =
|
||||
(ImageView)sb.findViewById(R.id.wifi_signal);
|
||||
if (wifiRSSI != null) {
|
||||
mNetworkController.addWifiIconView(wifiRSSI);
|
||||
}
|
||||
mNetworkController.addDataTypeIconView(
|
||||
(ImageView)sb.findViewById(R.id.network_type));
|
||||
mNetworkController.addDataDirectionOverlayIconView(
|
||||
(ImageView)sb.findViewById(R.id.network_direction));
|
||||
mNetworkController.setStackedMode(true);
|
||||
|
||||
// Recents Panel
|
||||
updateRecentsPanel();
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import android.telephony.SignalStrength;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Slog;
|
||||
|
||||
import com.android.internal.app.IBatteryStats;
|
||||
import com.android.internal.telephony.IccCard;
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.internal.telephony.cdma.EriInfo;
|
||||
@@ -68,403 +67,14 @@ public class PhoneStatusBarPolicy {
|
||||
private final Context mContext;
|
||||
private final StatusBarManager mService;
|
||||
private final Handler mHandler = new Handler();
|
||||
private final IBatteryStats mBatteryStats;
|
||||
|
||||
// storage
|
||||
private StorageManager mStorageManager;
|
||||
|
||||
// phone
|
||||
private TelephonyManager mPhone;
|
||||
private int mPhoneSignalIconId;
|
||||
|
||||
//***** Signal strength icons
|
||||
//GSM/UMTS
|
||||
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 = {
|
||||
{ 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
|
||||
// 1 is Standard Roaming Indicator OFF
|
||||
// TODO T: image never used, remove and put 0 instead?
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
|
||||
// 2 is Standard Roaming Indicator FLASHING
|
||||
// TODO T: image never used, remove and put 0 instead?
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
|
||||
// 3-12 Standard ERI
|
||||
R.drawable.stat_sys_roaming_cdma_0, //3
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
|
||||
// 13-63 Reserved for Standard ERI
|
||||
R.drawable.stat_sys_roaming_cdma_0, //13
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
|
||||
// 64-127 Reserved for Non Standard (Operator Specific) ERI
|
||||
R.drawable.stat_sys_roaming_cdma_0, //64
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0, //83
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0,
|
||||
R.drawable.stat_sys_roaming_cdma_0 //239
|
||||
|
||||
// 240-255 Reserved
|
||||
};
|
||||
|
||||
//***** Data connection icons
|
||||
private int[] mDataIconList = sDataNetType_g[0];
|
||||
//GSM/UMTS
|
||||
private static final int[][] sDataNetType_g = {
|
||||
{ R.drawable.stat_sys_data_connected_g,
|
||||
R.drawable.stat_sys_data_in_g,
|
||||
R.drawable.stat_sys_data_out_g,
|
||||
R.drawable.stat_sys_data_inandout_g },
|
||||
{ R.drawable.stat_sys_data_fully_connected_g,
|
||||
R.drawable.stat_sys_data_fully_in_g,
|
||||
R.drawable.stat_sys_data_fully_out_g,
|
||||
R.drawable.stat_sys_data_fully_inandout_g }
|
||||
};
|
||||
private static final int[][] sDataNetType_3g = {
|
||||
{ R.drawable.stat_sys_data_connected_3g,
|
||||
R.drawable.stat_sys_data_in_3g,
|
||||
R.drawable.stat_sys_data_out_3g,
|
||||
R.drawable.stat_sys_data_inandout_3g },
|
||||
{ R.drawable.stat_sys_data_fully_connected_3g,
|
||||
R.drawable.stat_sys_data_fully_in_3g,
|
||||
R.drawable.stat_sys_data_fully_out_3g,
|
||||
R.drawable.stat_sys_data_fully_inandout_3g }
|
||||
};
|
||||
private static final int[][] sDataNetType_4g = {
|
||||
{ R.drawable.stat_sys_data_connected_4g,
|
||||
R.drawable.stat_sys_data_in_4g,
|
||||
R.drawable.stat_sys_data_out_4g,
|
||||
R.drawable.stat_sys_data_inandout_4g },
|
||||
{ R.drawable.stat_sys_data_fully_connected_4g,
|
||||
R.drawable.stat_sys_data_fully_in_4g,
|
||||
R.drawable.stat_sys_data_fully_out_4g,
|
||||
R.drawable.stat_sys_data_fully_inandout_4g }
|
||||
};
|
||||
private static final int[][] sDataNetType_e = {
|
||||
{ R.drawable.stat_sys_data_connected_e,
|
||||
R.drawable.stat_sys_data_in_e,
|
||||
R.drawable.stat_sys_data_out_e,
|
||||
R.drawable.stat_sys_data_inandout_e },
|
||||
{ R.drawable.stat_sys_data_fully_connected_e,
|
||||
R.drawable.stat_sys_data_fully_in_e,
|
||||
R.drawable.stat_sys_data_fully_out_e,
|
||||
R.drawable.stat_sys_data_fully_inandout_e }
|
||||
};
|
||||
//3.5G
|
||||
private static final int[][] sDataNetType_h = {
|
||||
{ R.drawable.stat_sys_data_connected_h,
|
||||
R.drawable.stat_sys_data_in_h,
|
||||
R.drawable.stat_sys_data_out_h,
|
||||
R.drawable.stat_sys_data_inandout_h },
|
||||
{ R.drawable.stat_sys_data_fully_connected_h,
|
||||
R.drawable.stat_sys_data_fully_in_h,
|
||||
R.drawable.stat_sys_data_fully_out_h,
|
||||
R.drawable.stat_sys_data_fully_inandout_h }
|
||||
};
|
||||
|
||||
//CDMA
|
||||
// Use 3G icons for EVDO data and 1x icons for 1XRTT data
|
||||
private static final int[][] sDataNetType_1x = {
|
||||
{ R.drawable.stat_sys_data_connected_1x,
|
||||
R.drawable.stat_sys_data_in_1x,
|
||||
R.drawable.stat_sys_data_out_1x,
|
||||
R.drawable.stat_sys_data_inandout_1x },
|
||||
{ R.drawable.stat_sys_data_fully_connected_1x,
|
||||
R.drawable.stat_sys_data_fully_in_1x,
|
||||
R.drawable.stat_sys_data_fully_out_1x,
|
||||
R.drawable.stat_sys_data_fully_inandout_1x }
|
||||
};
|
||||
|
||||
// Accessibility;
|
||||
|
||||
private static final int[] sPhoneSignalStrength = {
|
||||
R.string.accessibility_no_phone,
|
||||
R.string.accessibility_phone_one_bar,
|
||||
R.string.accessibility_phone_two_bars,
|
||||
R.string.accessibility_phone_three_bars,
|
||||
R.string.accessibility_phone_signal_full
|
||||
};
|
||||
|
||||
private static final int[] sDataConnectionStrength = {
|
||||
R.string.accessibility_no_data,
|
||||
R.string.accessibility_data_one_bar,
|
||||
R.string.accessibility_data_two_bars,
|
||||
R.string.accessibility_data_three_bars,
|
||||
R.string.accessibility_data_signal_full
|
||||
};
|
||||
|
||||
private static final int[] sWifiConnectionStrength = {
|
||||
R.string.accessibility_no_wifi,
|
||||
R.string.accessibility_wifi_one_bar,
|
||||
R.string.accessibility_wifi_two_bars,
|
||||
R.string.accessibility_wifi_three_bars,
|
||||
R.string.accessibility_wifi_signal_full
|
||||
};
|
||||
|
||||
// Assume it's all good unless we hear otherwise. We don't always seem
|
||||
// to get broadcasts that it *is* there.
|
||||
IccCard.State mSimState = IccCard.State.READY;
|
||||
int mPhoneState = TelephonyManager.CALL_STATE_IDLE;
|
||||
int mDataState = TelephonyManager.DATA_DISCONNECTED;
|
||||
int mDataActivity = TelephonyManager.DATA_ACTIVITY_NONE;
|
||||
ServiceState mServiceState;
|
||||
SignalStrength mSignalStrength;
|
||||
|
||||
// data connection
|
||||
private boolean mDataIconVisible;
|
||||
private boolean mHspaDataDistinguishable;
|
||||
|
||||
// ringer volume
|
||||
private boolean mVolumeVisible;
|
||||
@@ -500,10 +110,7 @@ public class PhoneStatusBarPolicy {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
|
||||
updateBattery(intent);
|
||||
}
|
||||
else if (action.equals(Intent.ACTION_ALARM_CHANGED)) {
|
||||
if (action.equals(Intent.ACTION_ALARM_CHANGED)) {
|
||||
updateAlarm(intent);
|
||||
}
|
||||
else if (action.equals(Intent.ACTION_SYNC_STATE_CHANGED)) {
|
||||
@@ -513,15 +120,6 @@ public class PhoneStatusBarPolicy {
|
||||
action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
|
||||
updateBluetooth(intent);
|
||||
}
|
||||
else if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION) ||
|
||||
action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION) ||
|
||||
action.equals(WifiManager.RSSI_CHANGED_ACTION)) {
|
||||
updateWifi(intent);
|
||||
}
|
||||
else if (action.equals(LocationManager.GPS_ENABLED_CHANGE_ACTION) ||
|
||||
action.equals(LocationManager.GPS_FIX_CHANGE_ACTION)) {
|
||||
updateGps(intent);
|
||||
}
|
||||
else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
|
||||
action.equals(AudioManager.VIBRATE_SETTING_CHANGED_ACTION)) {
|
||||
updateVolume();
|
||||
@@ -532,52 +130,18 @@ public class PhoneStatusBarPolicy {
|
||||
else if (action.equals(TtyIntent.TTY_ENABLED_CHANGE_ACTION)) {
|
||||
updateTTY(intent);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public PhoneStatusBarPolicy(Context context) {
|
||||
mContext = context;
|
||||
mService = (StatusBarManager)context.getSystemService(Context.STATUS_BAR_SERVICE);
|
||||
mSignalStrength = new SignalStrength();
|
||||
mBatteryStats = BatteryStatsService.getService();
|
||||
|
||||
// storage
|
||||
mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
|
||||
mStorageManager.registerListener(
|
||||
new com.android.systemui.usb.StorageNotification(context));
|
||||
|
||||
// battery
|
||||
mService.setIcon("battery", com.android.internal.R.drawable.stat_sys_battery_unknown, 0,
|
||||
null);
|
||||
|
||||
// phone_signal
|
||||
mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
|
||||
mService.setIcon("phone_signal", mPhoneSignalIconId, 0, null);
|
||||
|
||||
// register for phone state notifications.
|
||||
((TelephonyManager)mContext.getSystemService(Context.TELEPHONY_SERVICE))
|
||||
.listen(mPhoneStateListener,
|
||||
PhoneStateListener.LISTEN_SERVICE_STATE
|
||||
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
||||
| PhoneStateListener.LISTEN_CALL_STATE
|
||||
| PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
|
||||
| PhoneStateListener.LISTEN_DATA_ACTIVITY);
|
||||
|
||||
// data_connection
|
||||
mService.setIcon("data_connection", R.drawable.stat_sys_data_connected_g, 0, null);
|
||||
mService.setIconVisibility("data_connection", false);
|
||||
|
||||
// wifi
|
||||
mService.setIcon("wifi", sWifiSignalImages[0][0], 0, null);
|
||||
mService.setIconVisibility("wifi", false);
|
||||
// wifi will get updated by the sticky intents
|
||||
|
||||
// TTY status
|
||||
mService.setIcon("tty", R.drawable.stat_sys_tty_mode, 0, null);
|
||||
mService.setIconVisibility("tty", false);
|
||||
@@ -596,10 +160,6 @@ public class PhoneStatusBarPolicy {
|
||||
}
|
||||
mService.setIconVisibility("bluetooth", mBluetoothEnabled);
|
||||
|
||||
// Gps status
|
||||
mService.setIcon("gps", R.drawable.stat_sys_gps_acquiring_anim, 0, null);
|
||||
mService.setIconVisibility("gps", false);
|
||||
|
||||
// Alarm clock
|
||||
mService.setIcon("alarm_clock", R.drawable.stat_notify_alarm, 0, null);
|
||||
mService.setIconVisibility("alarm_clock", false);
|
||||
@@ -620,32 +180,15 @@ public class PhoneStatusBarPolicy {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
|
||||
// Register for Intent broadcasts for...
|
||||
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
|
||||
filter.addAction(Intent.ACTION_ALARM_CHANGED);
|
||||
filter.addAction(Intent.ACTION_SYNC_STATE_CHANGED);
|
||||
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
|
||||
filter.addAction(AudioManager.VIBRATE_SETTING_CHANGED_ACTION);
|
||||
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
|
||||
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(LocationManager.GPS_ENABLED_CHANGE_ACTION);
|
||||
filter.addAction(LocationManager.GPS_FIX_CHANGE_ACTION);
|
||||
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
|
||||
try {
|
||||
mHspaDataDistinguishable = mContext.getResources().getBoolean(
|
||||
R.bool.config_hspa_data_distinguishable);
|
||||
} catch (Exception e) {
|
||||
mHspaDataDistinguishable = false;
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateAlarm(Intent intent) {
|
||||
@@ -661,96 +204,6 @@ public class PhoneStatusBarPolicy {
|
||||
//mService.setIconVisibility("sync_failing", isFailing && !isActive);
|
||||
}
|
||||
|
||||
private final void updateBattery(Intent intent) {
|
||||
final int id = intent.getIntExtra("icon-small", 0);
|
||||
int level = intent.getIntExtra("level", 0);
|
||||
String contentDescription = mContext.getString(R.string.accessibility_battery_level, level);
|
||||
mService.setIcon("battery", id, level, contentDescription);
|
||||
}
|
||||
|
||||
private void updateConnectivity(Intent intent) {
|
||||
NetworkInfo info = (NetworkInfo)(intent.getParcelableExtra(
|
||||
ConnectivityManager.EXTRA_NETWORK_INFO));
|
||||
int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0);
|
||||
|
||||
int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
|
||||
|
||||
switch (info.getType()) {
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
mInetCondition = inetCondition;
|
||||
updateDataNetType(info.getSubtype());
|
||||
updateDataIcon();
|
||||
updateSignalStrength(); // apply any change in connectionStatus
|
||||
break;
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
mInetCondition = inetCondition;
|
||||
if (info.isConnected()) {
|
||||
mIsWifiConnected = true;
|
||||
int iconId;
|
||||
String contentDescription = null;
|
||||
if (mLastWifiSignalLevel == -1) {
|
||||
iconId = sWifiSignalImages[mInetCondition][0];
|
||||
contentDescription = mContext.getString(sWifiConnectionStrength[0]);
|
||||
} else {
|
||||
iconId = sWifiSignalImages[mInetCondition][mLastWifiSignalLevel];
|
||||
contentDescription = mContext.getString(
|
||||
sWifiConnectionStrength[mLastWifiSignalLevel]);
|
||||
}
|
||||
mService.setIcon("wifi", iconId, 0, contentDescription);
|
||||
// Show the icon since wi-fi is connected
|
||||
mService.setIconVisibility("wifi", true);
|
||||
} else {
|
||||
mLastWifiSignalLevel = -1;
|
||||
mIsWifiConnected = false;
|
||||
int iconId = sWifiSignalImages[0][0];
|
||||
|
||||
String contentDescription = mContext.getString(R.string.accessibility_no_wifi);
|
||||
mService.setIcon("wifi", iconId, 0, contentDescription);
|
||||
// Hide the icon since we're not connected
|
||||
mService.setIconVisibility("wifi", false);
|
||||
}
|
||||
updateSignalStrength(); // apply any change in mInetCondition
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
|
||||
@Override
|
||||
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
|
||||
mSignalStrength = signalStrength;
|
||||
updateSignalStrength();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceStateChanged(ServiceState state) {
|
||||
mServiceState = state;
|
||||
updateSignalStrength();
|
||||
updateCdmaRoamingIcon(state);
|
||||
updateDataIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStateChanged(int state, String incomingNumber) {
|
||||
// In cdma, if a voice call is made, RSSI should switch to 1x.
|
||||
if (isCdma()) {
|
||||
updateSignalStrength();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataConnectionStateChanged(int state, int networkType) {
|
||||
mDataState = state;
|
||||
updateDataNetType(networkType);
|
||||
updateDataIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataActivity(int direction) {
|
||||
mDataActivity = direction;
|
||||
updateDataIcon();
|
||||
}
|
||||
};
|
||||
|
||||
private final void updateSimState(Intent intent) {
|
||||
String stateExtra = intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE);
|
||||
if (IccCard.INTENT_VALUE_ICC_ABSENT.equals(stateExtra)) {
|
||||
@@ -773,171 +226,6 @@ public class PhoneStatusBarPolicy {
|
||||
} else {
|
||||
mSimState = IccCard.State.UNKNOWN;
|
||||
}
|
||||
updateDataIcon();
|
||||
}
|
||||
|
||||
private boolean isCdma() {
|
||||
return (mSignalStrength != null) && !mSignalStrength.isGsm();
|
||||
}
|
||||
|
||||
private boolean hasService() {
|
||||
if (mServiceState != null) {
|
||||
switch (mServiceState.getState()) {
|
||||
case ServiceState.STATE_OUT_OF_SERVICE:
|
||||
case ServiceState.STATE_POWER_OFF:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateSignalStrength() {
|
||||
int[] iconList;
|
||||
String contentDescription = null;
|
||||
|
||||
// Display signal strength while in "emergency calls only" mode
|
||||
if (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly())) {
|
||||
//Slog.d(TAG, "updateSignalStrength: no service");
|
||||
if (Settings.System.getInt(mContext.getContentResolver(),
|
||||
Settings.System.AIRPLANE_MODE_ON, 0) == 1) {
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_flightmode;
|
||||
contentDescription = mContext.getString(R.string.accessibility_airplane_mode);
|
||||
} else {
|
||||
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
|
||||
contentDescription = mContext.getString(R.string.accessibility_no_phone);
|
||||
}
|
||||
mService.setIcon("phone_signal", mPhoneSignalIconId, 0, contentDescription);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCdma()) {
|
||||
// Though mPhone is a Manager, this call is not an IPC
|
||||
if (mPhone.isNetworkRoaming()) {
|
||||
iconList = sSignalImages_r[mInetCondition];
|
||||
} else {
|
||||
iconList = sSignalImages[mInetCondition];
|
||||
}
|
||||
} else {
|
||||
iconList = sSignalImages[mInetCondition];
|
||||
}
|
||||
|
||||
final int signalLevel = mSignalStrength.getLevel();
|
||||
mPhoneSignalIconId = iconList[signalLevel];
|
||||
contentDescription = mContext.getString(sPhoneSignalStrength[signalLevel]);
|
||||
mService.setIcon("phone_signal", mPhoneSignalIconId, 0, contentDescription);
|
||||
}
|
||||
|
||||
private final void updateDataNetType(int net) {
|
||||
switch (net) {
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
mDataIconList = sDataNetType_e[mInetCondition];
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
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[mInetCondition];
|
||||
} else {
|
||||
mDataIconList = sDataNetType_3g[mInetCondition];
|
||||
}
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_CDMA:
|
||||
// display 1xRTT for IS95A/B
|
||||
mDataIconList = sDataNetType_1x[mInetCondition];
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_1xRTT:
|
||||
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:
|
||||
case TelephonyManager.NETWORK_TYPE_EHRPD:
|
||||
mDataIconList = sDataNetType_3g[mInetCondition];
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_LTE:
|
||||
mDataIconList = sDataNetType_4g[mInetCondition];
|
||||
break;
|
||||
default:
|
||||
mDataIconList = sDataNetType_g[mInetCondition];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateDataIcon() {
|
||||
int iconId;
|
||||
String contentDescription = null;
|
||||
boolean visible = true;
|
||||
|
||||
if (!isCdma()) {
|
||||
// GSM case, we have to check also the sim state
|
||||
if (mSimState == IccCard.State.READY || mSimState == IccCard.State.UNKNOWN) {
|
||||
if (hasService() && mDataState == TelephonyManager.DATA_CONNECTED) {
|
||||
switch (mDataActivity) {
|
||||
case TelephonyManager.DATA_ACTIVITY_IN:
|
||||
iconId = mDataIconList[1];
|
||||
break;
|
||||
case TelephonyManager.DATA_ACTIVITY_OUT:
|
||||
iconId = mDataIconList[2];
|
||||
break;
|
||||
case TelephonyManager.DATA_ACTIVITY_INOUT:
|
||||
iconId = mDataIconList[3];
|
||||
break;
|
||||
default:
|
||||
iconId = mDataIconList[0];
|
||||
break;
|
||||
}
|
||||
contentDescription = mContext.getString(sDataConnectionStrength[mDataActivity]);
|
||||
mService.setIcon("data_connection", iconId, 0, contentDescription);
|
||||
} else {
|
||||
visible = false;
|
||||
}
|
||||
} else {
|
||||
iconId = R.drawable.stat_sys_no_sim;
|
||||
contentDescription = mContext.getString(R.string.accessibility_no_sim);
|
||||
mService.setIcon("data_connection", iconId, 0, contentDescription);
|
||||
}
|
||||
} else {
|
||||
// CDMA case, mDataActivity can be also DATA_ACTIVITY_DORMANT
|
||||
if (hasService() && mDataState == TelephonyManager.DATA_CONNECTED) {
|
||||
switch (mDataActivity) {
|
||||
case TelephonyManager.DATA_ACTIVITY_IN:
|
||||
iconId = mDataIconList[1];
|
||||
break;
|
||||
case TelephonyManager.DATA_ACTIVITY_OUT:
|
||||
iconId = mDataIconList[2];
|
||||
break;
|
||||
case TelephonyManager.DATA_ACTIVITY_INOUT:
|
||||
iconId = mDataIconList[3];
|
||||
break;
|
||||
case TelephonyManager.DATA_ACTIVITY_DORMANT:
|
||||
default:
|
||||
iconId = mDataIconList[0];
|
||||
break;
|
||||
}
|
||||
mService.setIcon("data_connection", iconId, 0, null);
|
||||
} else {
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
mBatteryStats.notePhoneDataConnectionState(mPhone.getNetworkType(), visible);
|
||||
} catch (RemoteException e) {
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
if (mDataIconVisible != visible) {
|
||||
mService.setIconVisibility("data_connection", visible);
|
||||
mDataIconVisible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateVolume() {
|
||||
@@ -990,65 +278,6 @@ public class PhoneStatusBarPolicy {
|
||||
mService.setIconVisibility("bluetooth", mBluetoothEnabled);
|
||||
}
|
||||
|
||||
private final void updateWifi(Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
|
||||
|
||||
final boolean enabled = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
|
||||
WifiManager.WIFI_STATE_UNKNOWN) == WifiManager.WIFI_STATE_ENABLED;
|
||||
|
||||
if (!enabled) {
|
||||
// If disabled, hide the icon. (We show icon when connected.)
|
||||
mService.setIconVisibility("wifi", false);
|
||||
}
|
||||
|
||||
} else if (action.equals(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION)) {
|
||||
final boolean enabled = intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED,
|
||||
false);
|
||||
if (!enabled) {
|
||||
mService.setIconVisibility("wifi", false);
|
||||
}
|
||||
} else if (action.equals(WifiManager.RSSI_CHANGED_ACTION)) {
|
||||
int iconId;
|
||||
String contentDescription = null;
|
||||
final int newRssi = intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI, -200);
|
||||
int newSignalLevel = WifiManager.calculateSignalLevel(newRssi,
|
||||
sWifiSignalImages[0].length);
|
||||
if (newSignalLevel != mLastWifiSignalLevel) {
|
||||
mLastWifiSignalLevel = newSignalLevel;
|
||||
if (mIsWifiConnected) {
|
||||
iconId = sWifiSignalImages[mInetCondition][newSignalLevel];
|
||||
contentDescription = mContext.getString(
|
||||
sWifiConnectionStrength[newSignalLevel]);
|
||||
} else {
|
||||
iconId = sWifiTemporarilyNotConnectedImage;
|
||||
contentDescription = mContext.getString(R.string.accessibility_no_wifi);
|
||||
}
|
||||
mService.setIcon("wifi", iconId, 0, contentDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateGps(Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
final boolean enabled = intent.getBooleanExtra(LocationManager.EXTRA_GPS_ENABLED, false);
|
||||
|
||||
if (action.equals(LocationManager.GPS_FIX_CHANGE_ACTION) && enabled) {
|
||||
// GPS is getting fixes
|
||||
mService.setIcon("gps", com.android.internal.R.drawable.stat_sys_gps_on, 0,
|
||||
mContext.getString(R.string.accessibility_gps_enabled));
|
||||
mService.setIconVisibility("gps", true);
|
||||
} else if (action.equals(LocationManager.GPS_ENABLED_CHANGE_ACTION) && !enabled) {
|
||||
// GPS is off
|
||||
mService.setIconVisibility("gps", false);
|
||||
} else {
|
||||
// GPS is on, but not receiving fixes
|
||||
mService.setIcon("gps", R.drawable.stat_sys_gps_acquiring_anim, 0,
|
||||
mContext.getString(R.string.accessibility_gps_acquiring));
|
||||
mService.setIconVisibility("gps", true);
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateTTY(Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
final boolean enabled = intent.getBooleanExtra(TtyIntent.TTY_ENABLED, false);
|
||||
@@ -1067,49 +296,4 @@ public class PhoneStatusBarPolicy {
|
||||
mService.setIconVisibility("tty", false);
|
||||
}
|
||||
}
|
||||
|
||||
private final void updateCdmaRoamingIcon(ServiceState state) {
|
||||
if (!hasService()) {
|
||||
mService.setIconVisibility("cdma_eri", false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCdma()) {
|
||||
mService.setIconVisibility("cdma_eri", false);
|
||||
return;
|
||||
}
|
||||
|
||||
int[] iconList = sRoamingIndicatorImages_cdma;
|
||||
int iconIndex = state.getCdmaEriIconIndex();
|
||||
int iconMode = state.getCdmaEriIconMode();
|
||||
|
||||
if (iconIndex == -1) {
|
||||
Slog.e(TAG, "getCdmaEriIconIndex returned null, skipping ERI icon update");
|
||||
return;
|
||||
}
|
||||
|
||||
if (iconMode == -1) {
|
||||
Slog.e(TAG, "getCdmeEriIconMode returned null, skipping ERI icon update");
|
||||
return;
|
||||
}
|
||||
|
||||
if (iconIndex == EriInfo.ROAMING_INDICATOR_OFF) {
|
||||
if (false) Slog.v(TAG, "Cdma ROAMING_INDICATOR_OFF, removing ERI icon");
|
||||
mService.setIconVisibility("cdma_eri", false);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (iconMode) {
|
||||
case EriInfo.ROAMING_ICON_MODE_NORMAL:
|
||||
mService.setIcon("cdma_eri", iconList[iconIndex], 0, null);
|
||||
mService.setIconVisibility("cdma_eri", true);
|
||||
break;
|
||||
case EriInfo.ROAMING_ICON_MODE_FLASH:
|
||||
mService.setIcon("cdma_eri", R.drawable.stat_sys_roaming_cdma_flash, 0, null);
|
||||
mService.setIconVisibility("cdma_eri", true);
|
||||
break;
|
||||
|
||||
}
|
||||
mService.setIcon("phone_signal", mPhoneSignalIconId, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,11 @@ public class BatteryController extends BroadcastReceiver {
|
||||
final String action = intent.getAction();
|
||||
if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
|
||||
final int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0);
|
||||
final boolean plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
|
||||
final int icon = plugged ? R.drawable.stat_sys_battery_charge
|
||||
: R.drawable.stat_sys_battery;
|
||||
int N = mIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
final int icon = intent.getIntExtra(BatteryManager.EXTRA_ICON_SMALL, 0);
|
||||
ImageView v = mIconViews.get(i);
|
||||
v.setImageResource(icon);
|
||||
v.setImageLevel(level);
|
||||
@@ -67,7 +69,6 @@ public class BatteryController extends BroadcastReceiver {
|
||||
}
|
||||
N = mLabelViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
//final boolean plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
|
||||
TextView v = mLabelViews.get(i);
|
||||
v.setText(mContext.getString(R.string.status_bar_settings_battery_meter_format,
|
||||
level));
|
||||
|
||||
@@ -127,6 +127,8 @@ public class NetworkController extends BroadcastReceiver {
|
||||
int mLastDataTypeIconId = -1;
|
||||
String mLastLabel = "";
|
||||
|
||||
boolean mDataAndWifiStacked = false;
|
||||
|
||||
// yuck -- stop doing this here and put it in the framework
|
||||
IBatteryStats mBatteryStats;
|
||||
|
||||
@@ -211,6 +213,10 @@ public class NetworkController extends BroadcastReceiver {
|
||||
mLabelViews.add(v);
|
||||
}
|
||||
|
||||
public void setStackedMode(boolean stacked) {
|
||||
mDataAndWifiStacked = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
@@ -648,7 +654,11 @@ public class NetworkController extends BroadcastReceiver {
|
||||
mContentDescriptionWifi = mContext.getString(
|
||||
AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH[mWifiLevel]);
|
||||
} else {
|
||||
mWifiIconId = WifiIcons.WIFI_SIGNAL_STRENGTH[0][0];
|
||||
if (mDataAndWifiStacked) {
|
||||
mWifiIconId = 0;
|
||||
} else {
|
||||
mWifiIconId = WifiIcons.WIFI_SIGNAL_STRENGTH[0][0];
|
||||
}
|
||||
mContentDescriptionWifi = mContext.getString(R.string.accessibility_no_wifi);
|
||||
}
|
||||
}
|
||||
@@ -823,8 +833,13 @@ public class NetworkController extends BroadcastReceiver {
|
||||
N = mWifiIconViews.size();
|
||||
for (int i=0; i<N; i++) {
|
||||
final ImageView v = mWifiIconViews.get(i);
|
||||
v.setImageResource(mWifiIconId);
|
||||
v.setContentDescription(mContentDescriptionWifi);
|
||||
if (mWifiIconId == 0) {
|
||||
v.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
v.setImageResource(mWifiIconId);
|
||||
v.setContentDescription(mContentDescriptionWifi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,19 +50,6 @@ class TelephonyIcons {
|
||||
|
||||
static final int[][] DATA_SIGNAL_STRENGTH = TELEPHONY_SIGNAL_STRENGTH;
|
||||
|
||||
static final int[][] DATA_SIGNAL_STRENGTH_ACTIVE = {
|
||||
{ R.drawable.stat_sys_signal_0,
|
||||
R.drawable.stat_sys_signal_1_flowing,
|
||||
R.drawable.stat_sys_signal_2_flowing,
|
||||
R.drawable.stat_sys_signal_3_flowing,
|
||||
R.drawable.stat_sys_signal_4_flowing },
|
||||
{ R.drawable.stat_sys_signal_0_fully,
|
||||
R.drawable.stat_sys_signal_1_fully_flowing,
|
||||
R.drawable.stat_sys_signal_2_fully_flowing,
|
||||
R.drawable.stat_sys_signal_3_fully_flowing,
|
||||
R.drawable.stat_sys_signal_4_fully_flowing }
|
||||
};
|
||||
|
||||
//***** Data connection icons
|
||||
|
||||
//GSM/UMTS
|
||||
|
||||
@@ -188,14 +188,33 @@ public class TabletStatusBar extends StatusBar implements
|
||||
mNotificationPanel.setOnTouchListener(
|
||||
new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel));
|
||||
|
||||
// the battery and network icons
|
||||
// the battery icon
|
||||
mBatteryController.addIconView((ImageView)mNotificationPanel.findViewById(R.id.battery));
|
||||
mBatteryController.addLabelView(
|
||||
(TextView)mNotificationPanel.findViewById(R.id.battery_text));
|
||||
|
||||
// Bt
|
||||
mBluetoothController.addIconView(
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.bluetooth));
|
||||
mNetworkController.addCombinedSignalIconView(
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.network_signal));
|
||||
|
||||
// network icons: either a combo icon that switches between mobile and data, or distinct
|
||||
// mobile and data icons
|
||||
final ImageView comboRSSI =
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.network_signal);
|
||||
if (comboRSSI != null) {
|
||||
mNetworkController.addCombinedSignalIconView(comboRSSI);
|
||||
}
|
||||
final ImageView mobileRSSI =
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.mobile_signal);
|
||||
if (mobileRSSI != null) {
|
||||
mNetworkController.addPhoneSignalIconView(mobileRSSI);
|
||||
}
|
||||
final ImageView wifiRSSI =
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.wifi_signal);
|
||||
if (wifiRSSI != null) {
|
||||
mNetworkController.addWifiIconView(wifiRSSI);
|
||||
}
|
||||
|
||||
mNetworkController.addDataTypeIconView(
|
||||
(ImageView)mNotificationPanel.findViewById(R.id.network_type));
|
||||
mNetworkController.addDataDirectionOverlayIconView(
|
||||
@@ -444,9 +463,23 @@ public class TabletStatusBar extends StatusBar implements
|
||||
mBatteryController.addIconView((ImageView)sb.findViewById(R.id.battery));
|
||||
mBluetoothController = new BluetoothController(mContext);
|
||||
mBluetoothController.addIconView((ImageView)sb.findViewById(R.id.bluetooth));
|
||||
|
||||
mNetworkController = new NetworkController(mContext);
|
||||
mNetworkController.addCombinedSignalIconView(
|
||||
(ImageView)sb.findViewById(R.id.network_signal));
|
||||
final ImageView comboRSSI =
|
||||
(ImageView)sb.findViewById(R.id.network_signal);
|
||||
if (comboRSSI != null) {
|
||||
mNetworkController.addCombinedSignalIconView(comboRSSI);
|
||||
}
|
||||
final ImageView mobileRSSI =
|
||||
(ImageView)sb.findViewById(R.id.mobile_signal);
|
||||
if (mobileRSSI != null) {
|
||||
mNetworkController.addPhoneSignalIconView(mobileRSSI);
|
||||
}
|
||||
final ImageView wifiRSSI =
|
||||
(ImageView)sb.findViewById(R.id.wifi_signal);
|
||||
if (wifiRSSI != null) {
|
||||
mNetworkController.addWifiIconView(wifiRSSI);
|
||||
}
|
||||
mNetworkController.addDataTypeIconView(
|
||||
(ImageView)sb.findViewById(R.id.network_type));
|
||||
mNetworkController.addDataDirectionOverlayIconView(
|
||||
|
||||