return;
}
try {
- int uid = getActivity().getPackageManager().getPackageUid(mShowAppImmediatePkg,
+ int uid = getActivity().getPackageManager().getPackageUidAsUser(mShowAppImmediatePkg,
UserHandle.myUserId());
AppItem app = new AppItem(uid);
app.addUid(uid);
private void addDeviceAdminBroadcastReceiversForProfile(
Collection<ComponentName> alreadyAddedComponents, final int profileId) {
final PackageManager pm = getActivity().getPackageManager();
- List<ResolveInfo> enabledForProfile = pm.queryBroadcastReceivers(
+ List<ResolveInfo> enabledForProfile = pm.queryBroadcastReceiversAsUser(
new Intent(DeviceAdminReceiver.ACTION_DEVICE_ADMIN_ENABLED),
PackageManager.GET_META_DATA | PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS,
profileId);
ArrayList<DeviceAdminInfo> deviceAdmins = new ArrayList<DeviceAdminInfo>(n);
for (int i = 0; i < n; ++i) {
ComponentName activeAdmin = activeAdmins.get(i);
- List<ResolveInfo> resolved = packageManager.queryBroadcastReceivers(
+ List<ResolveInfo> resolved = packageManager.queryBroadcastReceiversAsUser(
new Intent().setComponent(activeAdmin), PackageManager.GET_META_DATA
| PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, profileId);
if (resolved != null) {
// Present 'undefined' as 'ask' because the OS treats them identically for
// purposes of the UI (and does the right thing around pending domain
// verifications that might arrive after the user chooses 'ask' in this UI).
- final int state = mPm.getIntentVerificationStatus(mPackageName, UserHandle.myUserId());
+ final int state = mPm.getIntentVerificationStatusAsUser(mPackageName, UserHandle.myUserId());
mAppLinkState.setValue(
Integer.toString((state == INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED)
? INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK
}
final int userId = UserHandle.myUserId();
- final int priorState = mPm.getIntentVerificationStatus(mPackageName, userId);
+ final int priorState = mPm.getIntentVerificationStatusAsUser(mPackageName, userId);
if (priorState == newState) {
return false;
}
- boolean success = mPm.updateIntentVerificationStatus(mPackageName, newState, userId);
+ boolean success = mPm.updateIntentVerificationStatusAsUser(mPackageName, newState, userId);
if (success) {
// Read back the state to see if the change worked
- final int updatedState = mPm.getIntentVerificationStatus(mPackageName, userId);
+ final int updatedState = mPm.getIntentVerificationStatusAsUser(mPackageName, userId);
success = (newState == updatedState);
} else {
Log.e(TAG, "Couldn't update intent verification status!");
final int userId = UserHandle.myUserId();
mPm.clearPackagePreferredActivities(mPackageName);
if (isDefaultBrowser(mPackageName)) {
- mPm.setDefaultBrowserPackageName(null, userId);
+ mPm.setDefaultBrowserPackageNameAsUser(null, userId);
}
try {
mUsbManager.clearDefaults(mPackageName, userId);
}
private boolean isDefaultBrowser(String packageName) {
- final String defaultBrowser = mPm.getDefaultBrowserPackageName(UserHandle.myUserId());
+ final String defaultBrowser = mPm.getDefaultBrowserPackageNameAsUser(UserHandle.myUserId());
return packageName.equals(defaultBrowser);
}
private CharSequence getDomainsSummary(String packageName) {
// If the user has explicitly said "no" for this package, that's the
// string we should show.
- int domainStatus = mPm.getIntentVerificationStatus(packageName, UserHandle.myUserId());
+ int domainStatus = mPm.getIntentVerificationStatusAsUser(packageName, UserHandle.myUserId());
if (domainStatus == PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER) {
return mContext.getString(R.string.domain_urls_summary_none);
}
final PackageManager pm = getPackageManager();
- String packageName = pm.getDefaultBrowserPackageName(UserHandle.myUserId());
+ String packageName = pm.getDefaultBrowserPackageNameAsUser(UserHandle.myUserId());
if (!TextUtils.isEmpty(packageName)) {
// Check if the default Browser package is still there
Intent intent = new Intent();
if (TextUtils.isEmpty(packageName)) {
return false;
}
- boolean result = mPm.setDefaultBrowserPackageName(
+ boolean result = mPm.setDefaultBrowserPackageNameAsUser(
packageName.toString(), myUserId);
if (result) {
mDefaultBrowserPreference.setValue(packageName.toString());
if (deviceOwner != null) {
final int deviceOwnerUserId = dpm.getDeviceOwnerUserId();
try {
- final int deviceOwnerUid = pm.getPackageUid(deviceOwner.getPackageName(),
+ final int deviceOwnerUid = pm.getPackageUidAsUser(deviceOwner.getPackageName(),
deviceOwnerUserId);
isConfigEligibleForLockdown = deviceOwnerUid == config.creatorUid;
} catch (NameNotFoundException e) {