Wifi details - handle no profile owner

* If there is no profile owner, then do
  no call DPM method getProfileOwnerAsUser

Bug: 158284193
Test: manual testing
      make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiDetailPreferenceController2Test
Change-Id: Ief1f0b3aa6805d69fc14da8f87a90c9b12bef8c6
This commit is contained in:
Alex Johnston
2020-06-16 11:05:33 +01:00
parent 82b99f14a2
commit 10c970c571

View File

@@ -142,9 +142,11 @@ public class WifiNetworkDetailsFragment2 extends DashboardFragment implements
getContext().getSystemService(Context.USER_SERVICE);
final int profileOwnerUserId = Utils.getManagedProfileId(
um, UserHandle.myUserId());
if (profileOwnerUserId != UserHandle.USER_NULL) {
admin = new EnforcedAdmin(dpm.getProfileOwnerAsUser(profileOwnerUserId),
null, UserHandle.of(profileOwnerUserId));
}
}
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(), admin);
} else {
showDialog(WIFI_DIALOG_ID);