am e47dc360: Merge "SysUI: Actual MSIM status bar support" into lmp-mr1-dev
* commit 'e47dc36071884600c2b3c1dfe1ffe031fc9f0fde': SysUI: Actual MSIM status bar support
This commit is contained in:
25
packages/SystemUI/res/drawable/stat_sys_no_sims.xml
Normal file
25
packages/SystemUI/res/drawable/stat_sys_no_sims.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2014 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:width="17dp"
|
||||||
|
android:height="17dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#4DFFFFFF"
|
||||||
|
android:pathData="M19.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-7.0,0.0L7.7,5.3L19.0,16.7L19.0,5.0zM3.7,3.9L2.4,5.2L5.0,7.8L5.0,19.0c0.0,1.1 0.9,2.0 2.0,2.0l10.0,0.0c0.4,0.0 0.7,-0.1 1.0,-0.3l1.9,1.9l1.3,-1.3L3.7,3.9z"/>
|
||||||
|
</vector>
|
||||||
36
packages/SystemUI/res/layout/mobile_signal_group.xml
Normal file
36
packages/SystemUI/res/layout/mobile_signal_group.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/mobile_combo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mobile_signal"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mobile_type"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
/>
|
||||||
|
</FrameLayout>
|
||||||
@@ -50,27 +50,18 @@
|
|||||||
android:layout_height="4dp"
|
android:layout_height="4dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/mobile_signal_group"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
>
|
>
|
||||||
<FrameLayout
|
</LinearLayout>
|
||||||
android:id="@+id/mobile_combo"
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/no_sims"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
android:layout_width="wrap_content"
|
||||||
<ImageView
|
android:src="@drawable/stat_sys_no_sims"
|
||||||
android:id="@+id/mobile_signal"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
/>
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mobile_type"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
/>
|
|
||||||
</FrameLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/wifi_airplane_spacer"
|
android:id="@+id/wifi_airplane_spacer"
|
||||||
android:layout_width="4dp"
|
android:layout_width="4dp"
|
||||||
|
|||||||
@@ -515,6 +515,9 @@
|
|||||||
type icon is wide. -->
|
type icon is wide. -->
|
||||||
<dimen name="wide_type_icon_start_padding">2dp</dimen>
|
<dimen name="wide_type_icon_start_padding">2dp</dimen>
|
||||||
|
|
||||||
|
<!-- Extra padding between multiple phone signal icons. -->
|
||||||
|
<dimen name="secondary_telephony_padding">2dp</dimen>
|
||||||
|
|
||||||
<!-- Extra padding between the mobile data type icon and the strength indicator when the data
|
<!-- Extra padding between the mobile data type icon and the strength indicator when the data
|
||||||
type icon is wide for the tile in quick settings. -->
|
type icon is wide for the tile in quick settings. -->
|
||||||
<dimen name="wide_type_icon_start_padding_qs">3dp</dimen>
|
<dimen name="wide_type_icon_start_padding_qs">3dp</dimen>
|
||||||
|
|||||||
@@ -147,16 +147,15 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
|
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
|
||||||
private boolean mWifiEnabled;
|
private final CallbackInfo mInfo = new CallbackInfo();
|
||||||
private boolean mWifiConnected;
|
|
||||||
private boolean mAirplaneModeEnabled;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
|
public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
|
||||||
boolean activityIn, boolean activityOut,
|
boolean activityIn, boolean activityOut,
|
||||||
String wifiSignalContentDescriptionId, String description) {
|
String wifiSignalContentDescriptionId, String description) {
|
||||||
mWifiEnabled = enabled;
|
mInfo.wifiEnabled = enabled;
|
||||||
mWifiConnected = connected;
|
mInfo.wifiConnected = connected;
|
||||||
|
refreshState(mInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -164,28 +163,35 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
|
|||||||
int mobileSignalIconId,
|
int mobileSignalIconId,
|
||||||
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
||||||
boolean activityIn, boolean activityOut,
|
boolean activityIn, boolean activityOut,
|
||||||
String dataTypeContentDescriptionId, String description, boolean noSim,
|
String dataTypeContentDescriptionId, String description,
|
||||||
boolean isDataTypeIconWide) {
|
boolean isDataTypeIconWide) {
|
||||||
final CallbackInfo info = new CallbackInfo(); // TODO pool?
|
mInfo.enabled = enabled;
|
||||||
info.enabled = enabled;
|
mInfo.mobileSignalIconId = mobileSignalIconId;
|
||||||
info.wifiEnabled = mWifiEnabled;
|
mInfo.signalContentDescription = mobileSignalContentDescriptionId;
|
||||||
info.wifiConnected = mWifiConnected;
|
mInfo.dataTypeIconId = dataTypeIconId;
|
||||||
info.airplaneModeEnabled = mAirplaneModeEnabled;
|
mInfo.dataContentDescription = dataTypeContentDescriptionId;
|
||||||
info.mobileSignalIconId = mobileSignalIconId;
|
mInfo.activityIn = activityIn;
|
||||||
info.signalContentDescription = mobileSignalContentDescriptionId;
|
mInfo.activityOut = activityOut;
|
||||||
info.dataTypeIconId = dataTypeIconId;
|
mInfo.enabledDesc = description;
|
||||||
info.dataContentDescription = dataTypeContentDescriptionId;
|
mInfo.isDataTypeIconWide = isDataTypeIconWide;
|
||||||
info.activityIn = activityIn;
|
refreshState(mInfo);
|
||||||
info.activityOut = activityOut;
|
}
|
||||||
info.enabledDesc = description;
|
|
||||||
info.noSim = noSim;
|
@Override
|
||||||
info.isDataTypeIconWide = isDataTypeIconWide;
|
public void onNoSimVisibleChanged(boolean visible) {
|
||||||
refreshState(info);
|
mInfo.noSim = visible;
|
||||||
|
if (mInfo.noSim) {
|
||||||
|
// Make sure signal gets cleared out when no sims.
|
||||||
|
mInfo.mobileSignalIconId = 0;
|
||||||
|
mInfo.dataTypeIconId = 0;
|
||||||
|
}
|
||||||
|
refreshState(mInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAirplaneModeChanged(boolean enabled) {
|
public void onAirplaneModeChanged(boolean enabled) {
|
||||||
mAirplaneModeEnabled = enabled;
|
mInfo.airplaneModeEnabled = enabled;
|
||||||
|
refreshState(mInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMobileDataEnabled(boolean enabled) {
|
public void onMobileDataEnabled(boolean enabled) {
|
||||||
@@ -203,7 +209,8 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean getToggleState() {
|
public Boolean getToggleState() {
|
||||||
return mDataController.isMobileDataSupported()
|
return mDataController.isMobileDataSupported()
|
||||||
? mDataController.isMobileDataEnabled() : null;
|
? mDataController.isMobileDataEnabled()
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -217,11 +217,15 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
|
|||||||
int mobileSignalIconId,
|
int mobileSignalIconId,
|
||||||
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
||||||
boolean activityIn, boolean activityOut,
|
boolean activityIn, boolean activityOut,
|
||||||
String dataTypeContentDescriptionId, String description, boolean noSim,
|
String dataTypeContentDescriptionId, String description,
|
||||||
boolean isDataTypeIconWide) {
|
boolean isDataTypeIconWide) {
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onNoSimVisibleChanged(boolean noSims) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAirplaneModeChanged(boolean enabled) {
|
public void onAirplaneModeChanged(boolean enabled) {
|
||||||
// noop
|
// noop
|
||||||
|
|||||||
@@ -17,8 +17,10 @@
|
|||||||
package com.android.systemui.statusbar;
|
package com.android.systemui.statusbar;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
@@ -29,6 +31,9 @@ import com.android.systemui.R;
|
|||||||
import com.android.systemui.statusbar.policy.NetworkControllerImpl;
|
import com.android.systemui.statusbar.policy.NetworkControllerImpl;
|
||||||
import com.android.systemui.statusbar.policy.SecurityController;
|
import com.android.systemui.statusbar.policy.SecurityController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
// Intimately tied to the design of res/layout/signal_cluster_view.xml
|
// Intimately tied to the design of res/layout/signal_cluster_view.xml
|
||||||
public class SignalClusterView
|
public class SignalClusterView
|
||||||
extends LinearLayout
|
extends LinearLayout
|
||||||
@@ -41,23 +46,24 @@ public class SignalClusterView
|
|||||||
NetworkControllerImpl mNC;
|
NetworkControllerImpl mNC;
|
||||||
SecurityController mSC;
|
SecurityController mSC;
|
||||||
|
|
||||||
|
private boolean mNoSimsVisible = false;
|
||||||
private boolean mVpnVisible = false;
|
private boolean mVpnVisible = false;
|
||||||
private boolean mWifiVisible = false;
|
private boolean mWifiVisible = false;
|
||||||
private int mWifiStrengthId = 0;
|
private int mWifiStrengthId = 0;
|
||||||
private boolean mMobileVisible = false;
|
|
||||||
private int mMobileStrengthId = 0, mMobileTypeId = 0;
|
|
||||||
private boolean mIsAirplaneMode = false;
|
private boolean mIsAirplaneMode = false;
|
||||||
private int mAirplaneIconId = 0;
|
private int mAirplaneIconId = 0;
|
||||||
private int mAirplaneContentDescription;
|
private int mAirplaneContentDescription;
|
||||||
private String mWifiDescription, mMobileDescription, mMobileTypeDescription;
|
private String mWifiDescription;
|
||||||
private boolean mIsMobileTypeIconWide;
|
private ArrayList<PhoneState> mPhoneStates = new ArrayList<PhoneState>();
|
||||||
|
|
||||||
ViewGroup mWifiGroup, mMobileGroup;
|
ViewGroup mWifiGroup;
|
||||||
ImageView mVpn, mWifi, mMobile, mMobileType, mAirplane;
|
ImageView mVpn, mWifi, mAirplane, mNoSims;
|
||||||
View mWifiAirplaneSpacer;
|
View mWifiAirplaneSpacer;
|
||||||
View mWifiSignalSpacer;
|
View mWifiSignalSpacer;
|
||||||
|
LinearLayout mMobileSignalGroup;
|
||||||
|
|
||||||
private int mWideTypeIconStartPadding;
|
private int mWideTypeIconStartPadding;
|
||||||
|
private int mSecondaryTelephonyPadding;
|
||||||
private int mEndPadding;
|
private int mEndPadding;
|
||||||
private int mEndPaddingNothingVisible;
|
private int mEndPaddingNothingVisible;
|
||||||
|
|
||||||
@@ -90,6 +96,8 @@ public class SignalClusterView
|
|||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
mWideTypeIconStartPadding = getContext().getResources().getDimensionPixelSize(
|
mWideTypeIconStartPadding = getContext().getResources().getDimensionPixelSize(
|
||||||
R.dimen.wide_type_icon_start_padding);
|
R.dimen.wide_type_icon_start_padding);
|
||||||
|
mSecondaryTelephonyPadding = getContext().getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.secondary_telephony_padding);
|
||||||
mEndPadding = getContext().getResources().getDimensionPixelSize(
|
mEndPadding = getContext().getResources().getDimensionPixelSize(
|
||||||
R.dimen.signal_cluster_battery_padding);
|
R.dimen.signal_cluster_battery_padding);
|
||||||
mEndPaddingNothingVisible = getContext().getResources().getDimensionPixelSize(
|
mEndPaddingNothingVisible = getContext().getResources().getDimensionPixelSize(
|
||||||
@@ -103,12 +111,14 @@ public class SignalClusterView
|
|||||||
mVpn = (ImageView) findViewById(R.id.vpn);
|
mVpn = (ImageView) findViewById(R.id.vpn);
|
||||||
mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo);
|
mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo);
|
||||||
mWifi = (ImageView) findViewById(R.id.wifi_signal);
|
mWifi = (ImageView) findViewById(R.id.wifi_signal);
|
||||||
mMobileGroup = (ViewGroup) findViewById(R.id.mobile_combo);
|
|
||||||
mMobile = (ImageView) findViewById(R.id.mobile_signal);
|
|
||||||
mMobileType = (ImageView) findViewById(R.id.mobile_type);
|
|
||||||
mAirplane = (ImageView) findViewById(R.id.airplane);
|
mAirplane = (ImageView) findViewById(R.id.airplane);
|
||||||
|
mNoSims = (ImageView) findViewById(R.id.no_sims);
|
||||||
mWifiAirplaneSpacer = findViewById(R.id.wifi_airplane_spacer);
|
mWifiAirplaneSpacer = findViewById(R.id.wifi_airplane_spacer);
|
||||||
mWifiSignalSpacer = findViewById(R.id.wifi_signal_spacer);
|
mWifiSignalSpacer = findViewById(R.id.wifi_signal_spacer);
|
||||||
|
mMobileSignalGroup = (LinearLayout) findViewById(R.id.mobile_signal_group);
|
||||||
|
for (PhoneState state : mPhoneStates) {
|
||||||
|
mMobileSignalGroup.addView(state.mMobileGroup);
|
||||||
|
}
|
||||||
|
|
||||||
apply();
|
apply();
|
||||||
}
|
}
|
||||||
@@ -118,10 +128,9 @@ public class SignalClusterView
|
|||||||
mVpn = null;
|
mVpn = null;
|
||||||
mWifiGroup = null;
|
mWifiGroup = null;
|
||||||
mWifi = null;
|
mWifi = null;
|
||||||
mMobileGroup = null;
|
|
||||||
mMobile = null;
|
|
||||||
mMobileType = null;
|
|
||||||
mAirplane = null;
|
mAirplane = null;
|
||||||
|
mMobileSignalGroup.removeAllViews();
|
||||||
|
mMobileSignalGroup = null;
|
||||||
|
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
}
|
}
|
||||||
@@ -149,17 +158,55 @@ public class SignalClusterView
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMobileDataIndicators(boolean visible, int strengthIcon, int typeIcon,
|
public void setMobileDataIndicators(boolean visible, int strengthIcon, int typeIcon,
|
||||||
String contentDescription, String typeContentDescription, boolean isTypeIconWide) {
|
String contentDescription, String typeContentDescription, boolean isTypeIconWide,
|
||||||
mMobileVisible = visible;
|
int subId) {
|
||||||
mMobileStrengthId = strengthIcon;
|
PhoneState state = getOrInflateState(subId);
|
||||||
mMobileTypeId = typeIcon;
|
state.mMobileVisible = visible;
|
||||||
mMobileDescription = contentDescription;
|
state.mMobileStrengthId = strengthIcon;
|
||||||
mMobileTypeDescription = typeContentDescription;
|
state.mMobileTypeId = typeIcon;
|
||||||
mIsMobileTypeIconWide = isTypeIconWide;
|
state.mMobileDescription = contentDescription;
|
||||||
|
state.mMobileTypeDescription = typeContentDescription;
|
||||||
|
state.mIsMobileTypeIconWide = isTypeIconWide;
|
||||||
|
|
||||||
apply();
|
apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setNoSims(boolean show) {
|
||||||
|
mNoSimsVisible = show;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSubs(List<SubscriptionInfo> subs) {
|
||||||
|
// Clear out all old subIds.
|
||||||
|
mPhoneStates.clear();
|
||||||
|
if (mMobileSignalGroup != null) {
|
||||||
|
mMobileSignalGroup.removeAllViews();
|
||||||
|
}
|
||||||
|
final int n = subs.size();
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
inflatePhoneState(subs.get(i).getSubscriptionId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private PhoneState getOrInflateState(int subId) {
|
||||||
|
for (PhoneState state : mPhoneStates) {
|
||||||
|
if (state.mSubId == subId) {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inflatePhoneState(subId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private PhoneState inflatePhoneState(int subId) {
|
||||||
|
PhoneState state = new PhoneState(subId, mContext);
|
||||||
|
if (mMobileSignalGroup != null) {
|
||||||
|
mMobileSignalGroup.addView(state.mMobileGroup);
|
||||||
|
}
|
||||||
|
mPhoneStates.add(state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIsAirplaneMode(boolean is, int airplaneIconId, int contentDescription) {
|
public void setIsAirplaneMode(boolean is, int airplaneIconId, int contentDescription) {
|
||||||
mIsAirplaneMode = is;
|
mIsAirplaneMode = is;
|
||||||
@@ -175,8 +222,9 @@ public class SignalClusterView
|
|||||||
// ignore content description, so populate manually
|
// ignore content description, so populate manually
|
||||||
if (mWifiVisible && mWifiGroup != null && mWifiGroup.getContentDescription() != null)
|
if (mWifiVisible && mWifiGroup != null && mWifiGroup.getContentDescription() != null)
|
||||||
event.getText().add(mWifiGroup.getContentDescription());
|
event.getText().add(mWifiGroup.getContentDescription());
|
||||||
if (mMobileVisible && mMobileGroup != null && mMobileGroup.getContentDescription() != null)
|
for (PhoneState state : mPhoneStates) {
|
||||||
event.getText().add(mMobileGroup.getContentDescription());
|
state.populateAccessibilityEvent(event);
|
||||||
|
}
|
||||||
return super.dispatchPopulateAccessibilityEvent(event);
|
return super.dispatchPopulateAccessibilityEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,12 +236,13 @@ public class SignalClusterView
|
|||||||
mWifi.setImageDrawable(null);
|
mWifi.setImageDrawable(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMobile != null) {
|
for (PhoneState state : mPhoneStates) {
|
||||||
mMobile.setImageDrawable(null);
|
if (state.mMobile != null) {
|
||||||
}
|
state.mMobile.setImageDrawable(null);
|
||||||
|
}
|
||||||
if (mMobileType != null) {
|
if (state.mMobileType != null) {
|
||||||
mMobileType.setImageDrawable(null);
|
state.mMobileType.setImageDrawable(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mAirplane != null) {
|
if(mAirplane != null) {
|
||||||
@@ -227,19 +276,17 @@ public class SignalClusterView
|
|||||||
(mWifiVisible ? "VISIBLE" : "GONE"),
|
(mWifiVisible ? "VISIBLE" : "GONE"),
|
||||||
mWifiStrengthId));
|
mWifiStrengthId));
|
||||||
|
|
||||||
if (mMobileVisible && !mIsAirplaneMode) {
|
boolean anyMobileVisible = false;
|
||||||
mMobile.setImageResource(mMobileStrengthId);
|
for (PhoneState state : mPhoneStates) {
|
||||||
mMobileType.setImageResource(mMobileTypeId);
|
if (state.apply(anyMobileVisible)) {
|
||||||
mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription);
|
anyMobileVisible = true;
|
||||||
mMobileGroup.setVisibility(View.VISIBLE);
|
}
|
||||||
} else {
|
|
||||||
mMobileGroup.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIsAirplaneMode) {
|
if (mIsAirplaneMode) {
|
||||||
mAirplane.setImageResource(mAirplaneIconId);
|
mAirplane.setImageResource(mAirplaneIconId);
|
||||||
mAirplane.setContentDescription(mAirplaneContentDescription != 0 ?
|
mAirplane.setContentDescription(mAirplaneContentDescription != 0 ?
|
||||||
mContext.getString(mAirplaneContentDescription) : "");
|
mContext.getString(mAirplaneContentDescription) : null);
|
||||||
mAirplane.setVisibility(View.VISIBLE);
|
mAirplane.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mAirplane.setVisibility(View.GONE);
|
mAirplane.setVisibility(View.GONE);
|
||||||
@@ -251,23 +298,73 @@ public class SignalClusterView
|
|||||||
mWifiAirplaneSpacer.setVisibility(View.GONE);
|
mWifiAirplaneSpacer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMobileVisible && mMobileTypeId != 0 && mWifiVisible) {
|
if ((anyMobileVisible || mNoSimsVisible) && mWifiVisible) {
|
||||||
mWifiSignalSpacer.setVisibility(View.VISIBLE);
|
mWifiSignalSpacer.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mWifiSignalSpacer.setVisibility(View.GONE);
|
mWifiSignalSpacer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
mMobile.setPaddingRelative(mIsMobileTypeIconWide ? mWideTypeIconStartPadding : 0, 0, 0, 0);
|
mNoSims.setVisibility(mNoSimsVisible ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
if (DEBUG) Log.d(TAG,
|
boolean anythingVisible = mNoSimsVisible || mWifiVisible || mIsAirplaneMode
|
||||||
String.format("mobile: %s sig=%d typ=%d",
|
|| anyMobileVisible || mVpnVisible;
|
||||||
(mMobileVisible ? "VISIBLE" : "GONE"),
|
|
||||||
mMobileStrengthId, mMobileTypeId));
|
|
||||||
|
|
||||||
mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE);
|
|
||||||
|
|
||||||
boolean anythingVisible = mWifiVisible || mIsAirplaneMode || mMobileVisible || mVpnVisible;
|
|
||||||
setPaddingRelative(0, 0, anythingVisible ? mEndPadding : mEndPaddingNothingVisible, 0);
|
setPaddingRelative(0, 0, anythingVisible ? mEndPadding : mEndPaddingNothingVisible, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class PhoneState {
|
||||||
|
private final int mSubId;
|
||||||
|
private boolean mMobileVisible = false;
|
||||||
|
private int mMobileStrengthId = 0, mMobileTypeId = 0;
|
||||||
|
private boolean mIsMobileTypeIconWide;
|
||||||
|
private String mMobileDescription, mMobileTypeDescription;
|
||||||
|
|
||||||
|
private ViewGroup mMobileGroup;
|
||||||
|
private ImageView mMobile, mMobileType;
|
||||||
|
|
||||||
|
public PhoneState(int subId, Context context) {
|
||||||
|
ViewGroup root = (ViewGroup) LayoutInflater.from(context)
|
||||||
|
.inflate(R.layout.mobile_signal_group, null);
|
||||||
|
setViews(root);
|
||||||
|
mSubId = subId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViews(ViewGroup root) {
|
||||||
|
mMobileGroup = root;
|
||||||
|
mMobile = (ImageView) root.findViewById(R.id.mobile_signal);
|
||||||
|
mMobileType = (ImageView) root.findViewById(R.id.mobile_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean apply(boolean isSecondaryIcon) {
|
||||||
|
if (mMobileVisible && !mIsAirplaneMode) {
|
||||||
|
mMobile.setImageResource(mMobileStrengthId);
|
||||||
|
mMobileType.setImageResource(mMobileTypeId);
|
||||||
|
mMobileGroup.setContentDescription(mMobileTypeDescription
|
||||||
|
+ " " + mMobileDescription);
|
||||||
|
mMobileGroup.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mMobileGroup.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When this isn't next to wifi, give it some extra padding between the signals.
|
||||||
|
mMobileGroup.setPaddingRelative(isSecondaryIcon ? mSecondaryTelephonyPadding : 0,
|
||||||
|
0, 0, 0);
|
||||||
|
mMobile.setPaddingRelative(mIsMobileTypeIconWide ? mWideTypeIconStartPadding : 0,
|
||||||
|
0, 0, 0);
|
||||||
|
|
||||||
|
if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d typ=%d",
|
||||||
|
(mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId));
|
||||||
|
|
||||||
|
mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
return mMobileVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void populateAccessibilityEvent(AccessibilityEvent event) {
|
||||||
|
if (mMobileVisible && mMobileGroup != null
|
||||||
|
&& mMobileGroup.getContentDescription() != null) {
|
||||||
|
event.getText().add(mMobileGroup.getContentDescription());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -851,14 +851,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// set up the dynamic hide/show of the label
|
|
||||||
// TODO: uncomment, handle this for the Stack scroller aswell
|
|
||||||
// ((NotificationRowLayout) mStackScroller)
|
|
||||||
// .setOnSizeChangedListener(new OnSizeChangedListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSizeChanged(View view, int w, int h, int oldw, int oldh) {
|
|
||||||
// updateCarrierLabelVisibility(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mFlashlightController = new FlashlightController(mContext);
|
mFlashlightController = new FlashlightController(mContext);
|
||||||
|
|||||||
@@ -33,5 +33,6 @@ public class AccessibilityContentDescriptions {
|
|||||||
R.string.accessibility_wifi_three_bars,
|
R.string.accessibility_wifi_three_bars,
|
||||||
R.string.accessibility_wifi_signal_full
|
R.string.accessibility_wifi_signal_full
|
||||||
};
|
};
|
||||||
|
|
||||||
static final int WIFI_NO_CONNECTION = R.string.accessibility_no_wifi;
|
static final int WIFI_NO_CONNECTION = R.string.accessibility_no_wifi;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.net.NetworkStatsHistory;
|
|||||||
import android.net.NetworkTemplate;
|
import android.net.NetworkTemplate;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.format.DateUtils;
|
import android.text.format.DateUtils;
|
||||||
import android.text.format.Time;
|
import android.text.format.Time;
|
||||||
@@ -213,7 +214,8 @@ public class MobileDataControllerImpl implements NetworkController.MobileDataCon
|
|||||||
|
|
||||||
private static String getActiveSubscriberId(Context context) {
|
private static String getActiveSubscriberId(Context context) {
|
||||||
final TelephonyManager tele = TelephonyManager.from(context);
|
final TelephonyManager tele = TelephonyManager.from(context);
|
||||||
final String actualSubscriberId = tele.getSubscriberId();
|
final String actualSubscriberId = tele.getSubscriberId(
|
||||||
|
SubscriptionManager.getDefaultDataSubId());
|
||||||
return actualSubscriberId;
|
return actualSubscriberId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ public interface NetworkController {
|
|||||||
void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId,
|
void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId,
|
||||||
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
String mobileSignalContentDescriptionId, int dataTypeIconId,
|
||||||
boolean activityIn, boolean activityOut,
|
boolean activityIn, boolean activityOut,
|
||||||
String dataTypeContentDescriptionId, String description, boolean noSim,
|
String dataTypeContentDescriptionId, String description,
|
||||||
boolean isDataTypeIconWide);
|
boolean isDataTypeIconWide);
|
||||||
|
void onNoSimVisibleChanged(boolean visible);
|
||||||
void onAirplaneModeChanged(boolean enabled);
|
void onAirplaneModeChanged(boolean enabled);
|
||||||
void onMobileDataEnabled(boolean enabled);
|
void onMobileDataEnabled(boolean enabled);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,8 @@ import android.net.wifi.WifiManager;
|
|||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.SignalStrength;
|
import android.telephony.SignalStrength;
|
||||||
|
import android.telephony.SubscriptionInfo;
|
||||||
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -25,6 +27,8 @@ import org.mockito.Mockito;
|
|||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class NetworkControllerBaseTest extends AndroidTestCase {
|
public class NetworkControllerBaseTest extends AndroidTestCase {
|
||||||
private static final String TAG = "NetworkControllerBaseTest";
|
private static final String TAG = "NetworkControllerBaseTest";
|
||||||
@@ -44,6 +48,7 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
private ServiceState mServiceState;
|
private ServiceState mServiceState;
|
||||||
protected ConnectivityManager mMockCm;
|
protected ConnectivityManager mMockCm;
|
||||||
protected WifiManager mMockWm;
|
protected WifiManager mMockWm;
|
||||||
|
protected SubscriptionManager mMockSm;
|
||||||
protected TelephonyManager mMockTm;
|
protected TelephonyManager mMockTm;
|
||||||
protected Config mConfig;
|
protected Config mConfig;
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
|
|
||||||
mMockWm = mock(WifiManager.class);
|
mMockWm = mock(WifiManager.class);
|
||||||
mMockTm = mock(TelephonyManager.class);
|
mMockTm = mock(TelephonyManager.class);
|
||||||
|
mMockSm = mock(SubscriptionManager.class);
|
||||||
mMockCm = mock(ConnectivityManager.class);
|
mMockCm = mock(ConnectivityManager.class);
|
||||||
when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(true);
|
when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(true);
|
||||||
|
|
||||||
@@ -64,14 +70,22 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
|
|
||||||
mConfig = new Config();
|
mConfig = new Config();
|
||||||
mConfig.hspaDataDistinguishable = true;
|
mConfig.hspaDataDistinguishable = true;
|
||||||
mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm,
|
mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm,
|
||||||
mConfig, mock(AccessPointControllerImpl.class),
|
mConfig, mock(AccessPointControllerImpl.class),
|
||||||
mock(MobileDataControllerImpl.class));
|
mock(MobileDataControllerImpl.class));
|
||||||
setupNetworkController();
|
setupNetworkController();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setupNetworkController() {
|
protected void setupNetworkController() {
|
||||||
mPhoneStateListener = mNetworkController.mMobileSignalController.mPhoneStateListener;
|
// For now just pretend to be the data sim, so we can test that too.
|
||||||
|
final int subId = SubscriptionManager.getDefaultDataSubId();
|
||||||
|
SubscriptionInfo subscription = mock(SubscriptionInfo.class);
|
||||||
|
List<SubscriptionInfo> subs = new ArrayList<SubscriptionInfo>();
|
||||||
|
when(subscription.getSubscriptionId()).thenReturn(subId);
|
||||||
|
subs.add(subscription);
|
||||||
|
mNetworkController.setCurrentSubscriptions(subs);
|
||||||
|
mPhoneStateListener =
|
||||||
|
mNetworkController.mMobileSignalControllers.get(subId).mPhoneStateListener;
|
||||||
mSignalCluster = mock(SignalCluster.class);
|
mSignalCluster = mock(SignalCluster.class);
|
||||||
mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class);
|
mNetworkSignalChangedCallback = mock(NetworkSignalChangedCallback.class);
|
||||||
mNetworkController.addSignalCluster(mSignalCluster);
|
mNetworkController.addSignalCluster(mSignalCluster);
|
||||||
@@ -182,13 +196,12 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void verifyLastQsMobileDataIndicators(boolean visible, int icon, int typeIcon,
|
protected void verifyLastQsMobileDataIndicators(boolean visible, int icon, int typeIcon,
|
||||||
boolean dataIn, boolean dataOut, boolean noSim) {
|
boolean dataIn, boolean dataOut) {
|
||||||
ArgumentCaptor<Integer> iconArg = ArgumentCaptor.forClass(Integer.class);
|
ArgumentCaptor<Integer> iconArg = ArgumentCaptor.forClass(Integer.class);
|
||||||
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class);
|
||||||
ArgumentCaptor<Boolean> visibleArg = ArgumentCaptor.forClass(Boolean.class);
|
ArgumentCaptor<Boolean> visibleArg = ArgumentCaptor.forClass(Boolean.class);
|
||||||
ArgumentCaptor<Boolean> dataInArg = ArgumentCaptor.forClass(Boolean.class);
|
ArgumentCaptor<Boolean> dataInArg = ArgumentCaptor.forClass(Boolean.class);
|
||||||
ArgumentCaptor<Boolean> dataOutArg = ArgumentCaptor.forClass(Boolean.class);
|
ArgumentCaptor<Boolean> dataOutArg = ArgumentCaptor.forClass(Boolean.class);
|
||||||
ArgumentCaptor<Boolean> noSimArg = ArgumentCaptor.forClass(Boolean.class);
|
|
||||||
|
|
||||||
Mockito.verify(mNetworkSignalChangedCallback, Mockito.atLeastOnce())
|
Mockito.verify(mNetworkSignalChangedCallback, Mockito.atLeastOnce())
|
||||||
.onMobileDataSignalChanged(visibleArg.capture(), iconArg.capture(),
|
.onMobileDataSignalChanged(visibleArg.capture(), iconArg.capture(),
|
||||||
@@ -198,7 +211,6 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
dataOutArg.capture(),
|
dataOutArg.capture(),
|
||||||
ArgumentCaptor.forClass(String.class).capture(),
|
ArgumentCaptor.forClass(String.class).capture(),
|
||||||
ArgumentCaptor.forClass(String.class).capture(),
|
ArgumentCaptor.forClass(String.class).capture(),
|
||||||
noSimArg.capture(),
|
|
||||||
ArgumentCaptor.forClass(Boolean.class).capture());
|
ArgumentCaptor.forClass(Boolean.class).capture());
|
||||||
assertEquals("Visibility in, quick settings", visible, (boolean) visibleArg.getValue());
|
assertEquals("Visibility in, quick settings", visible, (boolean) visibleArg.getValue());
|
||||||
assertEquals("Signal icon in, quick settings", icon, (int) iconArg.getValue());
|
assertEquals("Signal icon in, quick settings", icon, (int) iconArg.getValue());
|
||||||
@@ -207,7 +219,6 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
(boolean) dataInArg.getValue());
|
(boolean) dataInArg.getValue());
|
||||||
assertEquals("Data direction out, in quick settings", dataOut,
|
assertEquals("Data direction out, in quick settings", dataOut,
|
||||||
(boolean) dataOutArg.getValue());
|
(boolean) dataOutArg.getValue());
|
||||||
assertEquals("Sim state in quick settings", noSim, (boolean) noSimArg.getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon) {
|
protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon) {
|
||||||
@@ -220,7 +231,8 @@ public class NetworkControllerBaseTest extends AndroidTestCase {
|
|||||||
visibleArg.capture(), iconArg.capture(), typeIconArg.capture(),
|
visibleArg.capture(), iconArg.capture(), typeIconArg.capture(),
|
||||||
ArgumentCaptor.forClass(String.class).capture(),
|
ArgumentCaptor.forClass(String.class).capture(),
|
||||||
ArgumentCaptor.forClass(String.class).capture(),
|
ArgumentCaptor.forClass(String.class).capture(),
|
||||||
ArgumentCaptor.forClass(Boolean.class).capture());
|
ArgumentCaptor.forClass(Boolean.class).capture(),
|
||||||
|
ArgumentCaptor.forClass(Integer.class).capture());
|
||||||
|
|
||||||
assertEquals("Signal icon in status bar", icon, (int) iconArg.getValue());
|
assertEquals("Signal icon in status bar", icon, (int) iconArg.getValue());
|
||||||
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue());
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
|||||||
TelephonyIcons.ROAMING_ICON);
|
TelephonyIcons.ROAMING_ICON);
|
||||||
verifyLastQsMobileDataIndicators(true,
|
verifyLastQsMobileDataIndicators(true,
|
||||||
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][DEFAULT_LEVEL],
|
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][DEFAULT_LEVEL],
|
||||||
TelephonyIcons.QS_DATA_R[1], false, false, false);
|
TelephonyIcons.QS_DATA_R[1], false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void test2gDataIcon() {
|
public void test2gDataIcon() {
|
||||||
@@ -86,14 +86,14 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
|
|||||||
|
|
||||||
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, DEFAULT_ICON);
|
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, DEFAULT_ICON);
|
||||||
verifyLastQsMobileDataIndicators(true, DEFAULT_QS_SIGNAL_STRENGTH,
|
verifyLastQsMobileDataIndicators(true, DEFAULT_QS_SIGNAL_STRENGTH,
|
||||||
DEFAULT_QS_ICON, in, out, false);
|
DEFAULT_QS_ICON, in, out);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyDataIndicators(int dataIcon, int qsDataIcon) {
|
private void verifyDataIndicators(int dataIcon, int qsDataIcon) {
|
||||||
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, dataIcon);
|
verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, dataIcon);
|
||||||
verifyLastQsMobileDataIndicators(true, DEFAULT_QS_SIGNAL_STRENGTH, qsDataIcon, false,
|
verifyLastQsMobileDataIndicators(true, DEFAULT_QS_SIGNAL_STRENGTH, qsDataIcon, false,
|
||||||
false, false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
|
|||||||
// Turn off mobile network support.
|
// Turn off mobile network support.
|
||||||
Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
|
Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
|
||||||
// Create a new NetworkController as this is currently handled in constructor.
|
// Create a new NetworkController as this is currently handled in constructor.
|
||||||
mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm,
|
mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm,
|
||||||
mConfig, mock(AccessPointControllerImpl.class),
|
mConfig, mock(AccessPointControllerImpl.class),
|
||||||
mock(MobileDataControllerImpl.class));
|
mock(MobileDataControllerImpl.class));
|
||||||
setupNetworkController();
|
setupNetworkController();
|
||||||
@@ -90,7 +90,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
|
|||||||
|
|
||||||
verifyLastQsMobileDataIndicators(true,
|
verifyLastQsMobileDataIndicators(true,
|
||||||
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][testStrength],
|
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][testStrength],
|
||||||
DEFAULT_QS_ICON, false, false, false);
|
DEFAULT_QS_ICON, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
|
|||||||
|
|
||||||
verifyLastQsMobileDataIndicators(true,
|
verifyLastQsMobileDataIndicators(true,
|
||||||
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][testStrength],
|
TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH[1][testStrength],
|
||||||
TelephonyIcons.QS_ICON_1X, false, false, false);
|
TelephonyIcons.QS_ICON_1X, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user