Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +15 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.devicepolicy; import static android.Manifest.permission.MANAGE_CA_CERTIFICATES; import static android.content.pm.PackageManager.GET_UNINSTALLED_PACKAGES; import android.accessibilityservice.AccessibilityServiceInfo; import android.accounts.AccountManager; Loading Loading @@ -4801,17 +4802,17 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { long id = Binder.clearCallingIdentity(); try { UserManager um = UserManager.get(mContext); if (!um.getUserInfo(userId).isManagedProfile()) { throw new IllegalStateException( "Only call this method from a managed profile."); if (DBG) { Slog.v(LOG_TAG, "installing " + packageName + " for " + userId); } UserManager um = UserManager.get(mContext); UserInfo primaryUser = um.getProfileParent(userId); if (DBG) { Slog.v(LOG_TAG, "installing " + packageName + " for " + userId); // Call did not come from a managed profile if (primaryUser == null) { primaryUser = um.getUserInfo(userId); } IPackageManager pm = AppGlobals.getPackageManager(); Loading Loading @@ -4847,13 +4848,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { try { UserManager um = UserManager.get(mContext); if (!um.getUserInfo(userId).isManagedProfile()) { throw new IllegalStateException( "Only call this method from a managed profile."); } UserInfo primaryUser = um.getProfileParent(userId); // Call did not come from a managed profile. if (primaryUser == null) { primaryUser = um.getUserInfo(userId); } IPackageManager pm = AppGlobals.getPackageManager(); List<ResolveInfo> activitiesToEnable = pm.queryIntentActivities(intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), Loading Loading @@ -4890,7 +4891,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { private boolean isSystemApp(IPackageManager pm, String packageName, int userId) throws RemoteException { ApplicationInfo appInfo = pm.getApplicationInfo(packageName, 0, userId); ApplicationInfo appInfo = pm.getApplicationInfo(packageName, GET_UNINSTALLED_PACKAGES, userId); return (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0; } Loading Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +15 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.devicepolicy; import static android.Manifest.permission.MANAGE_CA_CERTIFICATES; import static android.content.pm.PackageManager.GET_UNINSTALLED_PACKAGES; import android.accessibilityservice.AccessibilityServiceInfo; import android.accounts.AccountManager; Loading Loading @@ -4801,17 +4802,17 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { long id = Binder.clearCallingIdentity(); try { UserManager um = UserManager.get(mContext); if (!um.getUserInfo(userId).isManagedProfile()) { throw new IllegalStateException( "Only call this method from a managed profile."); if (DBG) { Slog.v(LOG_TAG, "installing " + packageName + " for " + userId); } UserManager um = UserManager.get(mContext); UserInfo primaryUser = um.getProfileParent(userId); if (DBG) { Slog.v(LOG_TAG, "installing " + packageName + " for " + userId); // Call did not come from a managed profile if (primaryUser == null) { primaryUser = um.getUserInfo(userId); } IPackageManager pm = AppGlobals.getPackageManager(); Loading Loading @@ -4847,13 +4848,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { try { UserManager um = UserManager.get(mContext); if (!um.getUserInfo(userId).isManagedProfile()) { throw new IllegalStateException( "Only call this method from a managed profile."); } UserInfo primaryUser = um.getProfileParent(userId); // Call did not come from a managed profile. if (primaryUser == null) { primaryUser = um.getUserInfo(userId); } IPackageManager pm = AppGlobals.getPackageManager(); List<ResolveInfo> activitiesToEnable = pm.queryIntentActivities(intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), Loading Loading @@ -4890,7 +4891,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { private boolean isSystemApp(IPackageManager pm, String packageName, int userId) throws RemoteException { ApplicationInfo appInfo = pm.getApplicationInfo(packageName, 0, userId); ApplicationInfo appInfo = pm.getApplicationInfo(packageName, GET_UNINSTALLED_PACKAGES, userId); return (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0; } Loading