File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/src/main/java/com/afwsamples/testdpc/common Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,11 @@ public static boolean isManagedProfileOwner(Context context) {
129
129
return false ;
130
130
}
131
131
}
132
- UserManager userManager = (UserManager ) context .getSystemService (Context .USER_SERVICE );
133
- return isProfileOwner (context ) && userManager .getUserProfiles ().size () > 1 ;
132
+
133
+ // Pre-N, TestDPC only supports being the profile owner for a managed profile. Other apps
134
+ // may support being a profile owner in other contexts (e.g. a secondary user) which will
135
+ // require further checks.
136
+ return isProfileOwner (context );
134
137
}
135
138
136
139
@ TargetApi (VERSION_CODES .M )
@@ -207,4 +210,4 @@ public static boolean installCaCertificate(InputStream certificateInputStream,
207
210
private static DevicePolicyManager getDevicePolicyManager (Context context ) {
208
211
return (DevicePolicyManager )context .getSystemService (Service .DEVICE_POLICY_SERVICE );
209
212
}
210
- }
213
+ }
You can’t perform that action at this time.
0 commit comments