diff options
author | John Spurlock <jspurlock@google.com> | 2013-09-11 14:50:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-11 14:50:08 +0000 |
commit | ec7a6ea84578be91e04a54331ea4ca63e7fb69e1 (patch) | |
tree | 67d304da9e62fb7448d3cbd6bd75cc3e87fbe6de /packages | |
parent | c19d683d9ea5dafdd8e355dc3fa34b362bc379e9 (diff) | |
parent | 43670879fa9accd7add74554c9049d9600579af2 (diff) | |
download | frameworks_base-ec7a6ea84578be91e04a54331ea4ca63e7fb69e1.zip frameworks_base-ec7a6ea84578be91e04a54331ea4ca63e7fb69e1.tar.gz frameworks_base-ec7a6ea84578be91e04a54331ea4ca63e7fb69e1.tar.bz2 |
Merge "Add activity indicator icons to quick settings tiles." into klp-dev
Diffstat (limited to 'packages')
41 files changed, 156 insertions, 26 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..6ff215b --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..cf5e825 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..5d8fd07 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_in.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_in.png Binary files differnew file mode 100644 index 0000000..ebd2001 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_in.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_inout.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_inout.png Binary files differnew file mode 100644 index 0000000..cf5e825 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_inout.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_out.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_out.png Binary files differnew file mode 100644 index 0000000..5d8fd07 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_wifi_out.png diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..e6a2f17 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..fd40015 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..0a6d20a --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..9c8f3e7 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..7e773f0 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..2ecfd0b --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..f3245a0 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..9f02b9d --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..8452087 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..61b0df9 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..e450506 --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..f8b63cb --- /dev/null +++ b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..da4ffa2 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..e1c7972 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..b8c8b4e --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_in.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_in.png Binary files differnew file mode 100644 index 0000000..5d0ad7c --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_in.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_inout.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_inout.png Binary files differnew file mode 100644 index 0000000..e1c7972 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_inout.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_out.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_out.png Binary files differnew file mode 100644 index 0000000..b8c8b4e --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_wifi_out.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..46fd826 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..c824b97 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..fb9ecd0 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_in.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_in.png Binary files differnew file mode 100644 index 0000000..6cf0a4b --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_in.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_inout.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_inout.png Binary files differnew file mode 100644 index 0000000..c824b97 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_inout.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_out.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_out.png Binary files differnew file mode 100644 index 0000000..fb9ecd0 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_wifi_out.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_in.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_in.png Binary files differnew file mode 100644 index 0000000..1094bc3 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_in.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_inout.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_inout.png Binary files differnew file mode 100644 index 0000000..1037b02 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_inout.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_out.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_out.png Binary files differnew file mode 100644 index 0000000..f5595e3 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_signal_out.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_in.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_in.png Binary files differnew file mode 100644 index 0000000..7183a07 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_in.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_inout.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_inout.png Binary files differnew file mode 100644 index 0000000..3746328 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_inout.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_out.png b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_out.png Binary files differnew file mode 100644 index 0000000..dbf54ce --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/ic_qs_wifi_out.png diff --git a/packages/SystemUI/res/layout/quick_settings_tile_rssi.xml b/packages/SystemUI/res/layout/quick_settings_tile_rssi.xml index 34506b1..cabfaa5 100644 --- a/packages/SystemUI/res/layout/quick_settings_tile_rssi.xml +++ b/packages/SystemUI/res/layout/quick_settings_tile_rssi.xml @@ -13,32 +13,49 @@ See the License for the specific language governing permissions and limitations under the License. --> -<LinearLayout +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="top" - android:orientation="vertical"> + android:layout_gravity="top"> <FrameLayout + android:id="@+id/rssi_images" android:layout_marginTop="@dimen/qs_tile_margin_above_icon" android:layout_marginBottom="@dimen/qs_tile_margin_below_icon" android:layout_width="@dimen/qs_tile_icon_size" android:layout_height="@dimen/qs_tile_icon_size" android:layout_gravity="top|center_horizontal" + android:layout_centerHorizontal="true" > <ImageView android:id="@+id/rssi_image" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center" + android:layout_centerInParent="true" /> <ImageView android:id="@+id/rssi_overlay_image" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center" + android:layout_centerInParent="true" /> </FrameLayout> + <ImageView + android:id="@+id/activity_in" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_qs_signal_in" + android:layout_toRightOf="@id/rssi_images" + android:layout_alignBottom="@id/rssi_images" + /> + <ImageView + android:id="@+id/activity_out" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_qs_signal_out" + android:layout_toRightOf="@id/rssi_images" + android:layout_alignBottom="@id/rssi_images" + /> <TextView style="@style/TextAppearance.QuickSettings.TileView" android:id="@+id/rssi_textview" @@ -47,5 +64,7 @@ android:layout_gravity="top|center_horizontal" android:gravity="top|center_horizontal" android:text="@string/quick_settings_rssi_label" + android:layout_centerHorizontal="true" + android:layout_below="@id/rssi_images" /> -</LinearLayout>
\ No newline at end of file +</RelativeLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/quick_settings_tile_wifi.xml b/packages/SystemUI/res/layout/quick_settings_tile_wifi.xml new file mode 100644 index 0000000..e61c595 --- /dev/null +++ b/packages/SystemUI/res/layout/quick_settings_tile_wifi.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 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_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="top"> + <ImageView + android:id="@+id/image" + android:layout_marginTop="@dimen/qs_tile_margin_above_icon" + android:layout_marginBottom="@dimen/qs_tile_margin_below_icon" + android:layout_width="@dimen/qs_tile_icon_size" + android:layout_height="@dimen/qs_tile_icon_size" + android:layout_gravity="top|center_horizontal" + android:layout_centerHorizontal="true" + android:scaleType="centerInside" + /> + <ImageView + android:id="@+id/activity_in" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_qs_wifi_in" + android:layout_toRightOf="@id/image" + android:layout_alignBottom="@id/image" + /> + <ImageView + android:id="@+id/activity_out" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_qs_wifi_out" + android:layout_toRightOf="@id/image" + android:layout_alignBottom="@id/image" + /> + <TextView + style="@style/TextAppearance.QuickSettings.TileView" + android:id="@+id/text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top|center_horizontal" + android:gravity="top|center_horizontal" + android:layout_centerHorizontal="true" + android:layout_below="@id/image" + /> +</RelativeLayout>
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 0d591ba..68ee2b5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.animation.ValueAnimator; import android.app.ActivityManagerNative; import android.app.AlertDialog; import android.app.Dialog; @@ -62,6 +63,7 @@ import android.widget.ImageView; import android.widget.TextView; import com.android.systemui.R; +import com.android.systemui.statusbar.phone.QuickSettingsModel.ActivityState; import com.android.systemui.statusbar.phone.QuickSettingsModel.BluetoothState; import com.android.systemui.statusbar.phone.QuickSettingsModel.RSSIState; import com.android.systemui.statusbar.phone.QuickSettingsModel.State; @@ -401,8 +403,9 @@ class QuickSettings { private void addSystemTiles(ViewGroup parent, LayoutInflater inflater) { // Wi-fi - final QuickSettingsBasicTile wifiTile - = new QuickSettingsBasicTile(mContext); + final QuickSettingsTileView wifiTile = (QuickSettingsTileView) + inflater.inflate(R.layout.quick_settings_tile, parent, false); + wifiTile.setContent(R.layout.quick_settings_tile_wifi, inflater); wifiTile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -433,12 +436,15 @@ class QuickSettings { return true; }} ); } - mModel.addWifiTile(wifiTile, new QuickSettingsModel.RefreshCallback() { + mModel.addWifiTile(wifiTile, new NetworkActivityCallback() { @Override - public void refreshView(QuickSettingsTileView unused, State state) { + public void refreshView(QuickSettingsTileView view, State state) { WifiState wifiState = (WifiState) state; - wifiTile.setImageResource(wifiState.iconId); - wifiTile.setText(wifiState.label); + ImageView iv = (ImageView) view.findViewById(R.id.image); + iv.setImageResource(wifiState.iconId); + setActivity(view, wifiState); + TextView tv = (TextView) view.findViewById(R.id.text); + tv.setText(wifiState.label); wifiTile.setContentDescription(mContext.getString( R.string.accessibility_quick_settings_wifi, wifiState.signalContentDescription, @@ -462,7 +468,7 @@ class QuickSettings { startSettingsActivity(intent); } }); - mModel.addRSSITile(rssiTile, new QuickSettingsModel.RefreshCallback() { + mModel.addRSSITile(rssiTile, new NetworkActivityCallback() { @Override public void refreshView(QuickSettingsTileView view, State state) { RSSIState rssiState = (RSSIState) state; @@ -478,6 +484,8 @@ class QuickSettings { } else { iov.setImageDrawable(null); } + setActivity(view, rssiState); + tv.setText(state.label); view.setContentDescription(mContext.getResources().getString( R.string.accessibility_quick_settings_mobile, @@ -942,4 +950,25 @@ class QuickSettings { } }; + + private abstract static class NetworkActivityCallback + implements QuickSettingsModel.RefreshCallback { + private final long mDefaultDuration = new ValueAnimator().getDuration(); + private final long mShortDuration = mDefaultDuration / 3; + + public void setActivity(View view, ActivityState state) { + setVisibility(view.findViewById(R.id.activity_in), state.activityIn); + setVisibility(view.findViewById(R.id.activity_out), state.activityOut); + } + + private void setVisibility(View view, boolean visible) { + final float newAlpha = visible ? 1 : 0; + if (view.getAlpha() != newAlpha) { + view.animate() + .setDuration(visible ? mShortDuration : mDefaultDuration) + .alpha(newAlpha) + .start(); + } + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java index b9e3059..9d0418d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java @@ -70,13 +70,17 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, int batteryLevel; boolean pluggedIn; } - static class RSSIState extends State { + static class ActivityState extends State { + boolean activityIn; + boolean activityOut; + } + static class RSSIState extends ActivityState { int signalIconId; String signalContentDescription; int dataTypeIconId; String dataContentDescription; } - static class WifiState extends State { + static class WifiState extends ActivityState { String signalContentDescription; boolean connected; } @@ -430,6 +434,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, // NetworkSignalChanged callback @Override public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, + boolean activityIn, boolean activityOut, String wifiSignalContentDescription, String enabledDesc) { // TODO: If view is in awaiting state, disable Resources r = mContext.getResources(); @@ -438,6 +443,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, boolean wifiNotConnected = (wifiSignalIconId > 0) && (enabledDesc == null); mWifiState.enabled = enabled; mWifiState.connected = wifiConnected; + mWifiState.activityIn = enabled && activityIn; + mWifiState.activityOut = enabled && activityOut; if (wifiConnected) { mWifiState.iconId = wifiSignalIconId; mWifiState.label = removeDoubleQuotes(enabledDesc); @@ -468,7 +475,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, @Override public void onMobileDataSignalChanged( boolean enabled, int mobileSignalIconId, String signalContentDescription, - int dataTypeIconId, String dataContentDescription, String enabledDesc) { + int dataTypeIconId, boolean activityIn, boolean activityOut, + String dataContentDescription,String enabledDesc) { if (deviceHasMobileData()) { // TODO: If view is in awaiting state, disable Resources r = mContext.getResources(); @@ -481,6 +489,8 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, mRSSIState.dataTypeIconId = enabled && (dataTypeIconId > 0) && !mWifiState.enabled ? dataTypeIconId : 0; + mRSSIState.activityIn = enabled && activityIn; + mRSSIState.activityOut = enabled && activityOut; mRSSIState.dataContentDescription = enabled && (dataTypeIconId > 0) && !mWifiState.enabled ? dataContentDescription : r.getString(R.string.accessibility_no_data); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 1e7e692..a715450 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -165,9 +165,11 @@ public class NetworkController extends BroadcastReceiver implements DemoMode { public interface NetworkSignalChangedCallback { void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, - String wifitSignalContentDescriptionId, String description); + boolean activityIn, boolean activityOut, + String wifiSignalContentDescriptionId, String description); void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId, String mobileSignalContentDescriptionId, int dataTypeIconId, + boolean activityIn, boolean activityOut, String dataTypeContentDescriptionId, String description); void onAirplaneModeChanged(boolean enabled); } @@ -313,22 +315,33 @@ public class NetworkController extends BroadcastReceiver implements DemoMode { boolean wifiEnabled = mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature); String wifiDesc = wifiEnabled ? mWifiSsid : null; - cb.onWifiSignalChanged(wifiEnabled, mQSWifiIconId, mContentDescriptionWifi, wifiDesc); - + boolean wifiIn = wifiEnabled && mWifiSsid != null + && (mWifiActivity == WifiManager.DATA_ACTIVITY_INOUT + || mWifiActivity == WifiManager.DATA_ACTIVITY_IN); + boolean wifiOut = wifiEnabled && mWifiSsid != null + && (mWifiActivity == WifiManager.DATA_ACTIVITY_INOUT + || mWifiActivity == WifiManager.DATA_ACTIVITY_OUT); + cb.onWifiSignalChanged(wifiEnabled, mQSWifiIconId, wifiIn, wifiOut, + mContentDescriptionWifi, wifiDesc); + + boolean mobileIn = mDataConnected && (mDataActivity == TelephonyManager.DATA_ACTIVITY_INOUT + || mDataActivity == TelephonyManager.DATA_ACTIVITY_IN); + boolean mobileOut = mDataConnected && (mDataActivity == TelephonyManager.DATA_ACTIVITY_INOUT + || mDataActivity == TelephonyManager.DATA_ACTIVITY_OUT); if (isEmergencyOnly()) { cb.onMobileDataSignalChanged(false, mQSPhoneSignalIconId, - mContentDescriptionPhoneSignal, mQSDataTypeIconId, mContentDescriptionDataType, - null); + mContentDescriptionPhoneSignal, mQSDataTypeIconId, mobileIn, mobileOut, + mContentDescriptionDataType, null); } else { if (mIsWimaxEnabled && mWimaxConnected) { // Wimax is special cb.onMobileDataSignalChanged(true, mQSPhoneSignalIconId, - mContentDescriptionPhoneSignal, mQSDataTypeIconId, + mContentDescriptionPhoneSignal, mQSDataTypeIconId, mobileIn, mobileOut, mContentDescriptionDataType, mNetworkName); } else { // Normal mobile data cb.onMobileDataSignalChanged(mHasMobileDataFeature, mQSPhoneSignalIconId, - mContentDescriptionPhoneSignal, mQSDataTypeIconId, + mContentDescriptionPhoneSignal, mQSDataTypeIconId, mobileIn, mobileOut, mContentDescriptionDataType, mNetworkName); } } @@ -1125,6 +1138,11 @@ public class NetworkController extends BroadcastReceiver implements DemoMode { + " mBluetoothTetherIconId=0x" + Integer.toHexString(mBluetoothTetherIconId)); } + // update QS + for (NetworkSignalChangedCallback cb : mSignalsChangedCallbacks) { + notifySignalsChangedCallbacks(cb); + } + if (mLastPhoneSignalIconId != mPhoneSignalIconId || mLastWifiIconId != mWifiIconId || mLastWimaxIconId != mWimaxIconId @@ -1136,9 +1154,6 @@ public class NetworkController extends BroadcastReceiver implements DemoMode { for (SignalCluster cluster : mSignalClusters) { refreshSignalCluster(cluster); } - for (NetworkSignalChangedCallback cb : mSignalsChangedCallbacks) { - notifySignalsChangedCallbacks(cb); - } } if (mLastAirplaneMode != mAirplaneMode) { |