Use explicit APIs to get device owner information

Bug 24676413

Change-Id: Id346c2f01658173c9671edcfd34bc33f1b25faa4
This commit is contained in:
Makoto Onuki
2015-11-19 13:47:55 -08:00
parent 03e1bee786
commit 4cfe39f539
5 changed files with 18 additions and 12 deletions

View File

@@ -1030,7 +1030,7 @@ public class UserSettings extends SettingsPreferenceFragment
DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
Context.DEVICE_POLICY_SERVICE);
// No restricted profiles for tablets with a device owner, or phones.
if (dpm.getDeviceOwner() != null || Utils.isVoiceCapable(context)) {
if (dpm.isDeviceManaged() || Utils.isVoiceCapable(context)) {
caps.mCanAddRestrictedProfile = false;
}