Loading packages/SettingsLib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ android_library { libs:[ // This flag library has been added in frameworks jar "aconfig_settingslib_flags_java_lib", "wifi_framework_aconfig_flags_lib", ], plugins: ["androidx.room_room-compiler-plugin"], use_resource_processor: true, Loading packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt +20 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.net.wifi.WifiManager import android.net.wifi.sharedconnectivity.app.NetworkProviderInfo import android.os.Bundle import android.os.SystemClock import android.security.advancedprotection.AdvancedProtectionManager import android.util.Log import android.view.WindowManager import androidx.annotation.VisibleForTesting Loading Loading @@ -498,7 +499,13 @@ open class WifiUtils { ): Job = coroutineScope.launch { val wifiManager = context.getSystemService(WifiManager::class.java) ?: return@launch if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) { val aapmManager = context.getSystemService(AdvancedProtectionManager::class.java) if (isAdvancedProtectionEnabled(aapmManager)) { val intent = aapmManager.createSupportIntent( AdvancedProtectionManager.FEATURE_ID_DISALLOW_WEP, AdvancedProtectionManager.SUPPORT_DIALOG_TYPE_BLOCKED_INTERACTION) onStartActivity(intent) } else if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) { onAllowed() } else { val intent = Intent(Intent.ACTION_MAIN).apply { Loading @@ -522,6 +529,18 @@ open class WifiUtils { } } private suspend fun isAdvancedProtectionEnabled( aapmManager: AdvancedProtectionManager? ): Boolean = if (android.security.Flags.aapmApi() && com.android.wifi.flags.Flags.wepDisabledInApm() && aapmManager != null ) { withContext(Dispatchers.Default) { aapmManager.isAdvancedProtectionEnabled() } } else { false } const val SSID = "ssid" const val DIALOG_WINDOW_TYPE = "dialog_window_type" } Loading packages/SystemUI/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,9 @@ <!-- Query all packages on device on R+ --> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <!-- Query advanced protection state --> <uses-permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE" /> <queries> <intent> <action android:name="android.intent.action.CREATE_NOTE" /> Loading Loading
packages/SettingsLib/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ android_library { libs:[ // This flag library has been added in frameworks jar "aconfig_settingslib_flags_java_lib", "wifi_framework_aconfig_flags_lib", ], plugins: ["androidx.room_room-compiler-plugin"], use_resource_processor: true, Loading
packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt +20 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.net.wifi.WifiManager import android.net.wifi.sharedconnectivity.app.NetworkProviderInfo import android.os.Bundle import android.os.SystemClock import android.security.advancedprotection.AdvancedProtectionManager import android.util.Log import android.view.WindowManager import androidx.annotation.VisibleForTesting Loading Loading @@ -498,7 +499,13 @@ open class WifiUtils { ): Job = coroutineScope.launch { val wifiManager = context.getSystemService(WifiManager::class.java) ?: return@launch if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) { val aapmManager = context.getSystemService(AdvancedProtectionManager::class.java) if (isAdvancedProtectionEnabled(aapmManager)) { val intent = aapmManager.createSupportIntent( AdvancedProtectionManager.FEATURE_ID_DISALLOW_WEP, AdvancedProtectionManager.SUPPORT_DIALOG_TYPE_BLOCKED_INTERACTION) onStartActivity(intent) } else if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) { onAllowed() } else { val intent = Intent(Intent.ACTION_MAIN).apply { Loading @@ -522,6 +529,18 @@ open class WifiUtils { } } private suspend fun isAdvancedProtectionEnabled( aapmManager: AdvancedProtectionManager? ): Boolean = if (android.security.Flags.aapmApi() && com.android.wifi.flags.Flags.wepDisabledInApm() && aapmManager != null ) { withContext(Dispatchers.Default) { aapmManager.isAdvancedProtectionEnabled() } } else { false } const val SSID = "ssid" const val DIALOG_WINDOW_TYPE = "dialog_window_type" } Loading
packages/SystemUI/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,9 @@ <!-- Query all packages on device on R+ --> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <!-- Query advanced protection state --> <uses-permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE" /> <queries> <intent> <action android:name="android.intent.action.CREATE_NOTE" /> Loading