Fix exception when filtering the APPs which can CHANGE_WIFI_STATE

When filtering AppEntry, only allow the extraInfo type of WifiSettingsState.

Bug: 148486719
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppStateChangeWifiStateBridgeTest
Change-Id: I486e88629aec8cfecf6174de8987d37394043743
This commit is contained in:
Arc Wang
2020-03-04 16:09:41 +08:00
parent 4a76598ba5
commit d5bdbdb345
2 changed files with 10 additions and 1 deletions

View File

@@ -83,7 +83,8 @@ public class AppStateChangeWifiStateBridge extends AppStateAppOpsBridge {
@Override
public boolean filterApp(AppEntry info) {
if (info == null || info.extraInfo == null) {
if (info == null || info.extraInfo == null
|| !(info.extraInfo instanceof WifiSettingsState)) {
return false;
}
WifiSettingsState wifiSettingsState = (WifiSettingsState) info.extraInfo;