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 d17601c1c054..f0bfb9272d60 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 13253b4f03c6..a4747b5aec78 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -75,6 +75,8 @@ public class SignalClusterView private boolean mWifiVisible = false; private int mWifiStrengthId = 0; private int mLastWifiStrengthId = -1; + private int mWifiActivityId = 0; + private int mLastWifiActivityId = -1; private boolean mIsAirplaneMode = false; private int mAirplaneIconId = 0; private int mLastAirplaneIconId = -1; @@ -89,6 +91,7 @@ public class SignalClusterView ViewGroup mEthernetGroup, mWifiGroup; View mNoSimsCombo; ImageView mVpn, mEthernet, mWifi, mAirplane, mNoSims, mEthernetDark, mWifiDark, mNoSimsDark; + ImageView mWifiActivity; View mWifiAirplaneSpacer; View mWifiSignalSpacer; LinearLayout mMobileSignalGroup; @@ -180,6 +183,7 @@ public class SignalClusterView 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); @@ -264,6 +268,10 @@ public class SignalClusterView mWifiVisible = statusIcon.visible && !mBlockWifi; mWifiStrengthId = statusIcon.icon; 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(); } @@ -283,6 +291,10 @@ public class SignalClusterView 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(); } @@ -405,6 +417,10 @@ public class SignalClusterView mWifiDark.setImageDrawable(null); mLastWifiStrengthId = -1; } + if (mWifiActivity != null) { + mWifiActivity.setImageDrawable(null); + mLastWifiActivityId = -1; + } for (PhoneState state : mPhoneStates) { if (state.mMobile != null) { @@ -421,6 +437,10 @@ public class SignalClusterView state.mMobileType.setImageDrawable(null); state.mLastMobileTypeId = -1; } + if (state.mMobileActivity != null) { + state.mMobileActivity.setImageDrawable(null); + state.mLastMobileActivityId = -1; + } } if (mAirplane != null) { @@ -474,6 +494,12 @@ public class SignalClusterView setIconForView(mWifiDark, mWifiStrengthId); mLastWifiStrengthId = mWifiStrengthId; } + if (mWifiActivityId != mLastWifiActivityId) { + if (mWifiActivityId != 0) { + setIconForView(mWifiActivity, mWifiActivityId); + } + mLastWifiActivityId = mWifiActivityId; + } mWifiGroup.setContentDescription(mWifiDescription); mWifiGroup.setVisibility(View.VISIBLE); } else { @@ -485,6 +511,8 @@ public class SignalClusterView (mWifiVisible ? "VISIBLE" : "GONE"), mWifiStrengthId)); + mWifiActivity.setVisibility(mWifiActivityId != 0 ? View.VISIBLE : View.GONE); + boolean anyMobileVisible = false; int firstMobileTypeId = 0; for (PhoneState state : mPhoneStates) { @@ -561,6 +589,8 @@ public class SignalClusterView applyDarkIntensity( StatusBarIconController.getDarkIntensity(mTintArea, mWifi, mDarkIntensity), mWifi, mWifiDark); + setTint(mWifiActivity, + StatusBarIconController.getTint(mTintArea, mWifiActivity, mIconTint)); applyDarkIntensity( StatusBarIconController.getDarkIntensity(mTintArea, mEthernet, mDarkIntensity), mEthernet, mEthernetDark); @@ -585,15 +615,17 @@ public class SignalClusterView 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) @@ -608,6 +640,7 @@ public class SignalClusterView 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) { @@ -622,6 +655,11 @@ public class SignalClusterView mMobileType.setImageResource(mMobileTypeId); mLastMobileTypeId = mMobileTypeId; } + + if (mLastMobileActivityId != mMobileActivityId) { + mMobileActivity.setImageResource(mMobileActivityId); + mLastMobileActivityId = mMobileActivityId; + } mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription); mMobileGroup.setVisibility(View.VISIBLE); @@ -644,6 +682,7 @@ public class SignalClusterView 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; } @@ -705,6 +744,8 @@ public class SignalClusterView setTint(mMobileType, StatusBarIconController.getTint(tintArea, mMobileType, tint)); setTint(mMobileRoaming, StatusBarIconController.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 622595f7654c..2f7cd0033f4c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -690,6 +690,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; @@ -735,6 +736,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(); } @@ -801,7 +821,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 0a3197c039cf..1b520b4cbb27 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. |