Statusbar: Show wifi status when wifi enabled
Now, Wifi status is only shown on StatusBar when connected to AP.
To satisfy the security requirement, we need show wifi status when
AppOps enabled.
Change-Id: Iae803025e17fd7fb90931f39e8f9841b659ed8ee
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
index 6f96e0b..535cdfd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
@@ -284,7 +284,7 @@
public void refreshSignalCluster(MSimSignalCluster cluster, int phoneId) {
cluster.setWifiIndicators(
// only show wifi in the cluster if connected or if wifi-only
- mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature),
+ mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature || mAppopsStrictEnabled),
mWifiIconId,
mContentDescriptionWifi);
cluster.setMobileDataIndicators(
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 391dbc2..3593ea7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -19,6 +19,7 @@
package com.android.systemui.statusbar.policy;
+import android.app.AppOpsManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -178,6 +179,8 @@
boolean mDataAndWifiStacked = false;
+ protected static boolean mAppopsStrictEnabled = false;
+
public interface SignalCluster {
void setWifiIndicators(boolean visible, int strengthIcon,
int activityIcon, String contentDescription);
@@ -202,6 +205,8 @@
Context.CONNECTIVITY_SERVICE);
mHasMobileDataFeature = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
+ mAppopsStrictEnabled = AppOpsManager.isStrictEnable();
+
mShowPhoneRSSIForData = res.getBoolean(R.bool.config_showPhoneRSSIForData);
mShowAtLeastThreeGees = res.getBoolean(R.bool.config_showMin3G);
mAlwaysShowCdmaRssi = res.getBoolean(
@@ -434,7 +439,7 @@
if (mDemoMode) return;
cluster.setWifiIndicators(
// only show wifi in the cluster if connected or if wifi-only
- mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature),
+ mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature || mAppopsStrictEnabled),
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);