diff options
11 files changed, 261 insertions, 3 deletions
diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_in.xml b/packages/SystemUI/res/drawable/stat_sys_signal_in.xml new file mode 100644 index 000000000000..7e6e09b9c846 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_in.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="17dp" + android:height="17dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:name="in" + android:fillColor="#FFFFFFFF" + android:pathData="M8.7,12.2l-2.0,3.5l-2.0,-3.5z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml b/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml new file mode 100644 index 000000000000..b7b6f0f56749 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="17dp" + android:height="17dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:name="in" + android:fillColor="#FFFFFFFF" + android:pathData="M8.7,12.2l-2.0,3.5l-2.0,-3.5z" /> + <path + android:name="out" + android:fillColor="#FFFFFFFF" + android:pathData="M0.5,15.7l2.0,-3.5l2.0,3.5z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_out.xml b/packages/SystemUI/res/drawable/stat_sys_signal_out.xml new file mode 100644 index 000000000000..910c0355f5a9 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_out.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="17dp" + android:height="17dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:name="out" + android:fillColor="#FFFFFFFF" + android:pathData="M0.5,15.7l2.0,-3.5l2.0,3.5z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_in.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_in.xml new file mode 100644 index 000000000000..666127be8dda --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_wifi_in.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="18.41dp" + android:height="17dp" + android:viewportWidth="26.0" + android:viewportHeight="24.0"> + <path + android:name="in" + android:fillColor="#FFFFFFFF" + android:pathData="M8.7,18.3l-2.0,3.5l-2.0,-3.5z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_inout.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_inout.xml new file mode 100644 index 000000000000..eeba0304a0f2 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_wifi_inout.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="18.41dp" + android:height="17dp" + android:viewportWidth="26.0" + android:viewportHeight="24.0"> + <path + android:name="in" + android:fillColor="#FFFFFFFF" + android:pathData="M8.7,18.3l-2.0,3.5l-2.0,-3.5z" /> + <path + android:name="out" + android:fillColor="#FFFFFFFF" + android:pathData="M0.5,21.8l2.0,-3.5l2.0,3.5z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_out.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_out.xml new file mode 100644 index 000000000000..d577d1a48704 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_wifi_out.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true" + android:width="18.41dp" + android:height="17dp" + android:viewportWidth="26.0" + android:viewportHeight="24.0"> + <path + android:name="out" + android:fillColor="#FFFFFFFF" + android:pathData="M0.5,21.8l2.0,-3.5l2.0,3.5z" /> +</vector> diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml index 8b1007497468..d988acc78411 100644 --- a/packages/SystemUI/res/layout/mobile_signal_group.xml +++ b/packages/SystemUI/res/layout/mobile_signal_group.xml @@ -54,4 +54,10 @@ android:src="@drawable/stat_sys_roaming" android:contentDescription="@string/accessibility_data_connection_roaming" android:visibility="gone" /> + <ImageView + android:id="@+id/mobile_inout" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:visibility="gone" + /> </FrameLayout> diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml index 222a31dca426..4d03f0f3459d 100644 --- a/packages/SystemUI/res/layout/signal_cluster_view.xml +++ b/packages/SystemUI/res/layout/signal_cluster_view.xml @@ -70,6 +70,11 @@ android:layout_width="wrap_content" android:alpha="0.0" /> + <ImageView + android:id="@+id/wifi_inout" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + /> </FrameLayout> <View android:id="@+id/wifi_signal_spacer" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 89041f9695ea..b3386ae98b29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -83,6 +83,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController private int mWifiStrengthId = 0; private int mLastWifiBadgeId = -1; private int mLastWifiStrengthId = -1; + private int mWifiActivityId = 0; + private int mLastWifiActivityId = -1; private boolean mIsAirplaneMode = false; private int mAirplaneIconId = 0; private int mLastAirplaneIconId = -1; @@ -97,6 +99,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController ViewGroup mEthernetGroup, mWifiGroup; View mNoSimsCombo; ImageView mVpn, mEthernet, mWifi, mAirplane, mNoSims, mEthernetDark, mWifiDark, mNoSimsDark; + ImageView mWifiActivity; View mWifiAirplaneSpacer; View mWifiSignalSpacer; LinearLayout mMobileSignalGroup; @@ -177,6 +180,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo); mWifi = (ImageView) findViewById(R.id.wifi_signal); mWifiDark = (ImageView) findViewById(R.id.wifi_signal_dark); + mWifiActivity = (ImageView) findViewById(R.id.wifi_inout); mAirplane = (ImageView) findViewById(R.id.airplane); mNoSims = (ImageView) findViewById(R.id.no_sims); mNoSimsDark = (ImageView) findViewById(R.id.no_sims_dark); @@ -267,6 +271,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController mWifiStrengthId = statusIcon.icon; mWifiBadgeId = statusIcon.iconOverlay; mWifiDescription = statusIcon.contentDescription; + mWifiActivityId = activityIn && activityOut ? R.drawable.stat_sys_wifi_inout + : activityIn ? R.drawable.stat_sys_wifi_in + : activityOut ? R.drawable.stat_sys_wifi_out + : 0; apply(); } @@ -286,6 +294,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController state.mMobileTypeDescription = typeContentDescription; state.mIsMobileTypeIconWide = statusType != 0 && isWide; state.mRoaming = roaming; + state.mMobileActivityId = activityIn && activityOut ? R.drawable.stat_sys_signal_inout + : activityIn ? R.drawable.stat_sys_signal_in + : activityOut ? R.drawable.stat_sys_signal_out + : 0; apply(); } @@ -409,6 +421,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController mLastWifiStrengthId = -1; mLastWifiBadgeId = -1; } + if (mWifiActivity != null) { + mWifiActivity.setImageDrawable(null); + mLastWifiActivityId = -1; + } for (PhoneState state : mPhoneStates) { if (state.mMobile != null) { @@ -425,6 +441,10 @@ public class SignalClusterView extends LinearLayout implements NetworkController state.mMobileType.setImageDrawable(null); state.mLastMobileTypeId = -1; } + if (state.mMobileActivity != null) { + state.mMobileActivity.setImageDrawable(null); + state.mLastMobileActivityId = -1; + } } if (mAirplane != null) { @@ -484,6 +504,12 @@ public class SignalClusterView extends LinearLayout implements NetworkController mLastWifiStrengthId = mWifiStrengthId; mLastWifiBadgeId = mWifiBadgeId; } + if (mWifiActivityId != mLastWifiActivityId) { + if (mWifiActivityId != 0) { + setIconForView(mWifiActivity, mWifiActivityId); + } + mLastWifiActivityId = mWifiActivityId; + } mWifiGroup.setContentDescription(mWifiDescription); mWifiGroup.setVisibility(View.VISIBLE); } else { @@ -495,6 +521,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController (mWifiVisible ? "VISIBLE" : "GONE"), mWifiStrengthId)); + mWifiActivity.setVisibility(mWifiActivityId != 0 ? View.VISIBLE : View.GONE); + boolean anyMobileVisible = false; int firstMobileTypeId = 0; for (PhoneState state : mPhoneStates) { @@ -603,6 +631,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController applyDarkIntensity( DarkIconDispatcher.getDarkIntensity(mTintArea, mWifi, mDarkIntensity), mWifi, mWifiDark); + setTint(mWifiActivity, + StatusBarIconController.getTint(mTintArea, mWifiActivity, mIconTint)); applyDarkIntensity( DarkIconDispatcher.getDarkIntensity(mTintArea, mEthernet, mDarkIntensity), mEthernet, mEthernetDark); @@ -627,15 +657,17 @@ public class SignalClusterView extends LinearLayout implements NetworkController private class PhoneState { private final int mSubId; private boolean mMobileVisible = false; - private int mMobileStrengthId = 0, mMobileTypeId = 0; + private int mMobileStrengthId = 0, mMobileTypeId = 0, mMobileActivityId = 0; private int mLastMobileStrengthId = -1; private int mLastMobileTypeId = -1; + private int mLastMobileActivityId = -1; private boolean mIsMobileTypeIconWide; private String mMobileDescription, mMobileTypeDescription; private ViewGroup mMobileGroup; private ImageView mMobile, mMobileDark, mMobileType, mMobileRoaming; public boolean mRoaming; + private ImageView mMobileActivity; public PhoneState(int subId, Context context) { ViewGroup root = (ViewGroup) LayoutInflater.from(context) @@ -650,6 +682,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController mMobileDark = (ImageView) root.findViewById(R.id.mobile_signal_dark); mMobileType = (ImageView) root.findViewById(R.id.mobile_type); mMobileRoaming = (ImageView) root.findViewById(R.id.mobile_roaming); + mMobileActivity = (ImageView) root.findViewById(R.id.mobile_inout); } public boolean apply(boolean isSecondaryIcon) { @@ -664,6 +697,11 @@ public class SignalClusterView extends LinearLayout implements NetworkController mMobileType.setImageResource(mMobileTypeId); mLastMobileTypeId = mMobileTypeId; } + + if (mLastMobileActivityId != mMobileActivityId) { + mMobileActivity.setImageResource(mMobileActivityId); + mLastMobileActivityId = mMobileActivityId; + } mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription); mMobileGroup.setVisibility(View.VISIBLE); @@ -686,6 +724,7 @@ public class SignalClusterView extends LinearLayout implements NetworkController mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE); mMobileRoaming.setVisibility(mRoaming ? View.VISIBLE : View.GONE); + mMobileActivity.setVisibility(mMobileActivityId != 0 ? View.VISIBLE : View.GONE); return mMobileVisible; } @@ -747,6 +786,8 @@ public class SignalClusterView extends LinearLayout implements NetworkController setTint(mMobileType, DarkIconDispatcher.getTint(tintArea, mMobileType, tint)); setTint(mMobileRoaming, DarkIconDispatcher.getTint(tintArea, mMobileRoaming, tint)); + setTint(mMobileActivity, + StatusBarIconController.getTint(tintArea, mMobileActivity, tint)); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index a85426c6f01d..51d931e28720 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -717,6 +717,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mDemoMode = true; mDemoInetCondition = mInetCondition; mDemoWifiState = mWifiSignalController.getState(); + mDemoWifiState.ssid = "DemoMode"; } else if (mDemoMode && command.equals(COMMAND_EXIT)) { if (DEBUG) Log.d(TAG, "Exiting demo mode"); mDemoMode = false; @@ -762,6 +763,25 @@ public class NetworkControllerImpl extends BroadcastReceiver : Math.min(Integer.parseInt(level), WifiIcons.WIFI_LEVEL_COUNT - 1); mDemoWifiState.connected = mDemoWifiState.level >= 0; } + String activity = args.getString("activity"); + if (activity != null) { + switch (activity) { + case "inout": + mWifiSignalController.setActivity(WifiManager.DATA_ACTIVITY_INOUT); + break; + case "in": + mWifiSignalController.setActivity(WifiManager.DATA_ACTIVITY_IN); + break; + case "out": + mWifiSignalController.setActivity(WifiManager.DATA_ACTIVITY_OUT); + break; + default: + mWifiSignalController.setActivity(WifiManager.DATA_ACTIVITY_NONE); + break; + } + } else { + mWifiSignalController.setActivity(WifiManager.DATA_ACTIVITY_NONE); + } mDemoWifiState.enabled = show; mWifiSignalController.notifyListeners(); } @@ -831,7 +851,23 @@ public class NetworkControllerImpl extends BroadcastReceiver } String activity = args.getString("activity"); if (activity != null) { - controller.setActivity(Integer.parseInt(activity)); + controller.getState().dataConnected = true; + switch (activity) { + case "inout": + controller.setActivity(TelephonyManager.DATA_ACTIVITY_INOUT); + break; + case "in": + controller.setActivity(TelephonyManager.DATA_ACTIVITY_IN); + break; + case "out": + controller.setActivity(TelephonyManager.DATA_ACTIVITY_OUT); + break; + default: + controller.setActivity(TelephonyManager.DATA_ACTIVITY_NONE); + break; + } + } else { + controller.setActivity(TelephonyManager.DATA_ACTIVITY_NONE); } controller.getState().enabled = show; controller.notifyListeners(); diff --git a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java index 0a962f1f2519..7c98e13780f4 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java @@ -163,7 +163,7 @@ public class DemoModeFragment extends PreferenceFragment implements OnPreference intent.putExtra("sims", "1"); intent.putExtra("nosim", "false"); intent.putExtra("level", "4"); - intent.putExtra("datatypel", ""); + intent.putExtra("datatype", "lte"); getContext().sendBroadcast(intent); // Need to send this after so that the sim controller already exists. |