Add API to query managed profiles
Replace mIsPrimaryUser and UserManager calls with API Change-Id: I4c9661c6daf3dcb714db01d5229bf4cee37648c2
This commit is contained in:
committed by
Michael Bestas
parent
0002daed48
commit
fb6285a35e
@@ -46,6 +46,7 @@ import android.net.ConnectivityManager;
|
||||
import android.os.Binder;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.ServiceState;
|
||||
import android.telephony.SubscriptionManager;
|
||||
@@ -143,6 +144,10 @@ public class SetupWizardUtils {
|
||||
return UserHandle.myUserId() == 0;
|
||||
}
|
||||
|
||||
public static boolean isManagedProfile(Context context) {
|
||||
return context.getSystemService(UserManager.class).isManagedProfile();
|
||||
}
|
||||
|
||||
public static void disableCaptivePortalDetection(Context context) {
|
||||
Settings.Global.putInt(context.getContentResolver(), KEY_DETECT_CAPTIVE_PORTAL, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user