diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 18681484b..cecb3e2bc 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -600,14 +600,14 @@ public class WifiServiceImpl extends IWifiManager.Stub { if (enable) { if (wiFiEnabledState == WifiManager.WIFI_STATE_DISABLING || wiFiEnabledState == WifiManager.WIFI_STATE_DISABLED) { - if (startConsentUiIfNeeded(packageName, Binder.getCallingUid(), + if (startConsentUi(packageName, Binder.getCallingUid(), WifiManager.ACTION_REQUEST_ENABLE)) { return true; } } } else if (wiFiEnabledState == WifiManager.WIFI_STATE_ENABLING || wiFiEnabledState == WifiManager.WIFI_STATE_ENABLED) { - if (startConsentUiIfNeeded(packageName, Binder.getCallingUid(), + if (startConsentUi(packageName, Binder.getCallingUid(), WifiManager.ACTION_REQUEST_DISABLE)) { return true; } @@ -1344,7 +1344,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { } }; - private boolean startConsentUiIfNeeded(String packageName, + private boolean startConsentUi(String packageName, int callingUid, String intentAction) throws RemoteException { if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID) { return false; @@ -1360,19 +1360,16 @@ public class WifiServiceImpl extends IWifiManager.Stub { + " not in uid " + callingUid); } - // Legacy apps in permission review mode trigger a user prompt - if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.M) { - Intent intent = new Intent(intentAction); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK - | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); - intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName); - mContext.startActivity(intent); - return true; - } + // Permission review mode, trigger a user prompt + Intent intent = new Intent(intentAction); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); + intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName); + mContext.startActivity(intent); + return true; } catch (PackageManager.NameNotFoundException e) { throw new RemoteException(e.getMessage()); } - return false; } /** |