FileDocCategorySizeDatePackage
ApplicationPackageManager.javaAPI DocAndroid 5.1 API63011Thu Mar 12 22:22:10 GMT 2015android.app

ApplicationPackageManager

public final class ApplicationPackageManager extends android.content.pm.PackageManager

Fields Summary
private static final String
TAG
private static final boolean
DEBUG
private static final boolean
DEBUG_ICONS
private static final int
sDefaultFlags
private final Object
mLock
private android.os.UserManager
mUserManager
private android.content.pm.PackageInstaller
mInstaller
int
mCachedSafeMode
private final ContextImpl
mContext
private final android.content.pm.IPackageManager
mPM
private static final Object
sSync
private static android.util.ArrayMap
sIconCache
private static android.util.ArrayMap
sStringCache
Constructors Summary
ApplicationPackageManager(ContextImpl context, android.content.pm.IPackageManager pm)

        mContext = context;
        mPM = pm;
    
Methods Summary
public voidaddCrossProfileIntentFilter(android.content.IntentFilter filter, int sourceUserId, int targetUserId, int flags)

hide

        try {
            mPM.addCrossProfileIntentFilter(filter, mContext.getOpPackageName(),
                    mContext.getUserId(), sourceUserId, targetUserId, flags);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidaddPackageToPreferred(java.lang.String packageName)

        try {
            mPM.addPackageToPreferred(packageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public booleanaddPermission(android.content.pm.PermissionInfo info)

        try {
            return mPM.addPermission(info);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public booleanaddPermissionAsync(android.content.pm.PermissionInfo info)

        try {
            return mPM.addPermissionAsync(info);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voidaddPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)

        try {
            mPM.addPreferredActivity(filter, match, set, activity, mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidaddPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity, int userId)

        try {
            mPM.addPreferredActivity(filter, match, set, activity, userId);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public java.lang.String[]canonicalToCurrentPackageNames(java.lang.String[] names)

        try {
            return mPM.canonicalToCurrentPackageNames(names);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public intcheckPermission(java.lang.String permName, java.lang.String pkgName)

        try {
            return mPM.checkPermission(permName, pkgName);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public intcheckSignatures(java.lang.String pkg1, java.lang.String pkg2)

        try {
            return mPM.checkSignatures(pkg1, pkg2);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public intcheckSignatures(int uid1, int uid2)

        try {
            return mPM.checkUidSignatures(uid1, uid2);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voidclearApplicationUserData(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)

        try {
            mPM.clearApplicationUserData(packageName, observer, mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidclearCrossProfileIntentFilters(int sourceUserId)

hide

        try {
            mPM.clearCrossProfileIntentFilters(sourceUserId, mContext.getOpPackageName(),
                    mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidclearPackagePreferredActivities(java.lang.String packageName)

        try {
            mPM.clearPackagePreferredActivities(packageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
static voidconfigurationChanged()

        synchronized (sSync) {
            sIconCache.clear();
            sStringCache.clear();
        }
    
public java.lang.String[]currentToCanonicalPackageNames(java.lang.String[] names)

        try {
            return mPM.currentToCanonicalPackageNames(names);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voiddeleteApplicationCacheFiles(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)

        try {
            mPM.deleteApplicationCacheFiles(packageName, observer);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voiddeletePackage(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int flags)

        try {
            mPM.deletePackageAsUser(packageName, observer, UserHandle.myUserId(), flags);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidextendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)

        try {
            mPM.extendVerificationTimeout(id, verificationCodeAtTimeout, millisecondsToDelay);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidfreeStorage(long freeStorageSize, android.content.IntentSender pi)

        try {
            mPM.freeStorage(freeStorageSize, pi);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidfreeStorageAndNotify(long idealStorageSize, android.content.pm.IPackageDataObserver observer)

        try {
            mPM.freeStorageAndNotify(idealStorageSize, observer);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public android.graphics.drawable.DrawablegetActivityBanner(android.content.ComponentName activityName)

        return getActivityInfo(activityName, sDefaultFlags).loadBanner(this);
    
public android.graphics.drawable.DrawablegetActivityBanner(android.content.Intent intent)

        if (intent.getComponent() != null) {
            return getActivityBanner(intent.getComponent());
        }

        ResolveInfo info = resolveActivity(
                intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (info != null) {
            return info.activityInfo.loadBanner(this);
        }

        throw new NameNotFoundException(intent.toUri(0));
    
public android.graphics.drawable.DrawablegetActivityIcon(android.content.ComponentName activityName)

        return getActivityInfo(activityName, sDefaultFlags).loadIcon(this);
    
public android.graphics.drawable.DrawablegetActivityIcon(android.content.Intent intent)

        if (intent.getComponent() != null) {
            return getActivityIcon(intent.getComponent());
        }

        ResolveInfo info = resolveActivity(
            intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (info != null) {
            return info.activityInfo.loadIcon(this);
        }

        throw new NameNotFoundException(intent.toUri(0));
    
public android.content.pm.ActivityInfogetActivityInfo(android.content.ComponentName className, int flags)

        try {
            ActivityInfo ai = mPM.getActivityInfo(className, flags, mContext.getUserId());
            if (ai != null) {
                return ai;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(className.toString());
    
public android.graphics.drawable.DrawablegetActivityLogo(android.content.ComponentName activityName)

        return getActivityInfo(activityName, sDefaultFlags).loadLogo(this);
    
public android.graphics.drawable.DrawablegetActivityLogo(android.content.Intent intent)

        if (intent.getComponent() != null) {
            return getActivityLogo(intent.getComponent());
        }

        ResolveInfo info = resolveActivity(
            intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (info != null) {
            return info.activityInfo.loadLogo(this);
        }

        throw new NameNotFoundException(intent.toUri(0));
    
public java.util.ListgetAllPermissionGroups(int flags)

        try {
            return mPM.getAllPermissionGroups(flags);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public android.graphics.drawable.DrawablegetApplicationBanner(android.content.pm.ApplicationInfo info)

        return info.loadBanner(this);
    
public android.graphics.drawable.DrawablegetApplicationBanner(java.lang.String packageName)

        return getApplicationBanner(getApplicationInfo(packageName, sDefaultFlags));
    
public intgetApplicationEnabledSetting(java.lang.String packageName)

        try {
            return mPM.getApplicationEnabledSetting(packageName, mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
        return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
    
public booleangetApplicationHiddenSettingAsUser(java.lang.String packageName, android.os.UserHandle user)

        try {
            return mPM.getApplicationHiddenSettingAsUser(packageName, user.getIdentifier());
        } catch (RemoteException re) {
            // Should never happen!
        }
        return false;
    
public android.graphics.drawable.DrawablegetApplicationIcon(android.content.pm.ApplicationInfo info)

        return info.loadIcon(this);
    
public android.graphics.drawable.DrawablegetApplicationIcon(java.lang.String packageName)

        return getApplicationIcon(getApplicationInfo(packageName, sDefaultFlags));
    
public android.content.pm.ApplicationInfogetApplicationInfo(java.lang.String packageName, int flags)

        try {
            ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, mContext.getUserId());
            if (ai != null) {
                // This is a temporary hack. Callers must use
                // createPackageContext(packageName).getApplicationInfo() to
                // get the right paths.
                maybeAdjustApplicationInfo(ai);
                return ai;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(packageName);
    
public java.lang.CharSequencegetApplicationLabel(android.content.pm.ApplicationInfo info)

        return info.loadLabel(this);
    
public android.graphics.drawable.DrawablegetApplicationLogo(android.content.pm.ApplicationInfo info)

        return info.loadLogo(this);
    
public android.graphics.drawable.DrawablegetApplicationLogo(java.lang.String packageName)

        return getApplicationLogo(getApplicationInfo(packageName, sDefaultFlags));
    
private intgetBadgeResIdForUser(int userHandle)

        // Return the framework-provided badge.
        UserInfo userInfo = getUserIfProfile(userHandle);
        if (userInfo != null && userInfo.isManagedProfile()) {
            return com.android.internal.R.drawable.ic_corp_icon_badge;
        }
        return 0;
    
private android.graphics.drawable.DrawablegetBadgedDrawable(android.graphics.drawable.Drawable drawable, android.graphics.drawable.Drawable badgeDrawable, android.graphics.Rect badgeLocation, boolean tryBadgeInPlace)

        final int badgedWidth = drawable.getIntrinsicWidth();
        final int badgedHeight = drawable.getIntrinsicHeight();
        final boolean canBadgeInPlace = tryBadgeInPlace
                && (drawable instanceof BitmapDrawable)
                && ((BitmapDrawable) drawable).getBitmap().isMutable();

        final Bitmap bitmap;
        if (canBadgeInPlace) {
            bitmap = ((BitmapDrawable) drawable).getBitmap();
        } else {
            bitmap = Bitmap.createBitmap(badgedWidth, badgedHeight, Bitmap.Config.ARGB_8888);
        }
        Canvas canvas = new Canvas(bitmap);

        if (!canBadgeInPlace) {
            drawable.setBounds(0, 0, badgedWidth, badgedHeight);
            drawable.draw(canvas);
        }

        if (badgeLocation != null) {
            if (badgeLocation.left < 0 || badgeLocation.top < 0
                    || badgeLocation.width() > badgedWidth || badgeLocation.height() > badgedHeight) {
                throw new IllegalArgumentException("Badge location " + badgeLocation
                        + " not in badged drawable bounds "
                        + new Rect(0, 0, badgedWidth, badgedHeight));
            }
            badgeDrawable.setBounds(0, 0, badgeLocation.width(), badgeLocation.height());

            canvas.save();
            canvas.translate(badgeLocation.left, badgeLocation.top);
            badgeDrawable.draw(canvas);
            canvas.restore();
        } else {
            badgeDrawable.setBounds(0, 0, badgedWidth, badgedHeight);
            badgeDrawable.draw(canvas);
        }

        if (!canBadgeInPlace) {
            BitmapDrawable mergedDrawable = new BitmapDrawable(mContext.getResources(), bitmap);

            if (drawable instanceof BitmapDrawable) {
                BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
                mergedDrawable.setTargetDensity(bitmapDrawable.getBitmap().getDensity());
            }

            return mergedDrawable;
        }

        return drawable;
    
private android.graphics.drawable.DrawablegetCachedIcon(android.app.ApplicationPackageManager$ResourceName name)

        synchronized (sSync) {
            WeakReference<Drawable.ConstantState> wr = sIconCache.get(name);
            if (DEBUG_ICONS) Log.v(TAG, "Get cached weak drawable ref for "
                                   + name + ": " + wr);
            if (wr != null) {   // we have the activity
                Drawable.ConstantState state = wr.get();
                if (state != null) {
                    if (DEBUG_ICONS) {
                        Log.v(TAG, "Get cached drawable state for " + name + ": " + state);
                    }
                    // Note: It's okay here to not use the newDrawable(Resources) variant
                    //       of the API. The ConstantState comes from a drawable that was
                    //       originally created by passing the proper app Resources instance
                    //       which means the state should already contain the proper
                    //       resources specific information (like density.) See
                    //       BitmapDrawable.BitmapState for instance.
                    return state.newDrawable();
                }
                // our entry has been purged
                sIconCache.remove(name);
            }
        }
        return null;
    
private java.lang.CharSequencegetCachedString(android.app.ApplicationPackageManager$ResourceName name)

        synchronized (sSync) {
            WeakReference<CharSequence> wr = sStringCache.get(name);
            if (wr != null) {   // we have the activity
                CharSequence cs = wr.get();
                if (cs != null) {
                    return cs;
                }
                // our entry has been purged
                sStringCache.remove(name);
            }
        }
        return null;
    
public intgetComponentEnabledSetting(android.content.ComponentName componentName)

        try {
            return mPM.getComponentEnabledSetting(componentName, mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
        return PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
    
public android.graphics.drawable.DrawablegetDefaultActivityIcon()

        return Resources.getSystem().getDrawable(
            com.android.internal.R.drawable.sym_def_app_icon);
    
public android.graphics.drawable.DrawablegetDrawable(java.lang.String packageName, int resid, android.content.pm.ApplicationInfo appInfo)

        ResourceName name = new ResourceName(packageName, resid);
        Drawable dr = getCachedIcon(name);
        if (dr != null) {
            return dr;
        }
        if (appInfo == null) {
            try {
                appInfo = getApplicationInfo(packageName, sDefaultFlags);
            } catch (NameNotFoundException e) {
                return null;
            }
        }
        try {
            Resources r = getResourcesForApplication(appInfo);
            dr = r.getDrawable(resid);
            if (false) {
                RuntimeException e = new RuntimeException("here");
                e.fillInStackTrace();
                Log.w(TAG, "Getting drawable 0x" + Integer.toHexString(resid)
                      + " from package " + packageName
                      + ": app scale=" + r.getCompatibilityInfo().applicationScale
                      + ", caller scale=" + mContext.getResources().getCompatibilityInfo().applicationScale,
                      e);
            }
            if (DEBUG_ICONS) Log.v(TAG, "Getting drawable 0x"
                                   + Integer.toHexString(resid) + " from " + r
                                   + ": " + dr);
            putCachedIcon(name, dr);
            return dr;
        } catch (NameNotFoundException e) {
            Log.w("PackageManager", "Failure retrieving resources for "
                  + appInfo.packageName);
        } catch (Resources.NotFoundException e) {
            Log.w("PackageManager", "Failure retrieving resources for "
                  + appInfo.packageName + ": " + e.getMessage());
        } catch (RuntimeException e) {
            // If an exception was thrown, fall through to return
            // default icon.
            Log.w("PackageManager", "Failure retrieving icon 0x"
                  + Integer.toHexString(resid) + " in package "
                  + packageName, e);
        }
        return null;
    
public android.content.ComponentNamegetHomeActivities(java.util.List outActivities)

        try {
            return mPM.getHomeActivities(outActivities);
        } catch (RemoteException e) {
            // Should never happen!
        }
        return null;
    
public java.util.ListgetInstalledApplications(int flags)

        final int userId = mContext.getUserId();
        try {
            ParceledListSlice<ApplicationInfo> slice = mPM.getInstalledApplications(flags, userId);
            return slice.getList();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListgetInstalledPackages(int flags)

        return getInstalledPackages(flags, mContext.getUserId());
    
public java.util.ListgetInstalledPackages(int flags, int userId)

hide

        try {
            ParceledListSlice<PackageInfo> slice = mPM.getInstalledPackages(flags, userId);
            return slice.getList();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.lang.StringgetInstallerPackageName(java.lang.String packageName)

        try {
            return mPM.getInstallerPackageName(packageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
        return null;
    
public android.content.pm.InstrumentationInfogetInstrumentationInfo(android.content.ComponentName className, int flags)

        try {
            InstrumentationInfo ii = mPM.getInstrumentationInfo(
                className, flags);
            if (ii != null) {
                return ii;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(className.toString());
    
public android.content.pm.KeySetgetKeySetByAlias(java.lang.String packageName, java.lang.String alias)

hide

        Preconditions.checkNotNull(packageName);
        Preconditions.checkNotNull(alias);
        KeySet ks;
        try {
            ks = mPM.getKeySetByAlias(packageName, alias);
        } catch (RemoteException e) {
            return null;
        }
        return ks;
    
public android.content.IntentgetLaunchIntentForPackage(java.lang.String packageName)

        // First see if the package has an INFO activity; the existence of
        // such an activity is implied to be the desired front-door for the
        // overall package (such as if it has multiple launcher entries).
        Intent intentToResolve = new Intent(Intent.ACTION_MAIN);
        intentToResolve.addCategory(Intent.CATEGORY_INFO);
        intentToResolve.setPackage(packageName);
        List<ResolveInfo> ris = queryIntentActivities(intentToResolve, 0);

        // Otherwise, try to find a main launcher activity.
        if (ris == null || ris.size() <= 0) {
            // reuse the intent instance
            intentToResolve.removeCategory(Intent.CATEGORY_INFO);
            intentToResolve.addCategory(Intent.CATEGORY_LAUNCHER);
            intentToResolve.setPackage(packageName);
            ris = queryIntentActivities(intentToResolve, 0);
        }
        if (ris == null || ris.size() <= 0) {
            return null;
        }
        Intent intent = new Intent(intentToResolve);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setClassName(ris.get(0).activityInfo.packageName,
                ris.get(0).activityInfo.name);
        return intent;
    
public android.content.IntentgetLeanbackLaunchIntentForPackage(java.lang.String packageName)

        // Try to find a main leanback_launcher activity.
        Intent intentToResolve = new Intent(Intent.ACTION_MAIN);
        intentToResolve.addCategory(Intent.CATEGORY_LEANBACK_LAUNCHER);
        intentToResolve.setPackage(packageName);
        List<ResolveInfo> ris = queryIntentActivities(intentToResolve, 0);

        if (ris == null || ris.size() <= 0) {
            return null;
        }
        Intent intent = new Intent(intentToResolve);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setClassName(ris.get(0).activityInfo.packageName,
                ris.get(0).activityInfo.name);
        return intent;
    
public java.lang.StringgetNameForUid(int uid)

        try {
            return mPM.getNameForUid(uid);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public int[]getPackageGids(java.lang.String packageName)

        try {
            int[] gids = mPM.getPackageGids(packageName);
            if (gids == null || gids.length > 0) {
                return gids;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(packageName);
    
public android.content.pm.PackageInfogetPackageInfo(java.lang.String packageName, int flags)

        try {
            PackageInfo pi = mPM.getPackageInfo(packageName, flags, mContext.getUserId());
            if (pi != null) {
                return pi;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(packageName);
    
public android.content.pm.PackageInstallergetPackageInstaller()

        synchronized (mLock) {
            if (mInstaller == null) {
                try {
                    mInstaller = new PackageInstaller(mContext, this, mPM.getPackageInstaller(),
                            mContext.getPackageName(), mContext.getUserId());
                } catch (RemoteException e) {
                    throw e.rethrowAsRuntimeException();
                }
            }
            return mInstaller;
        }
    
public voidgetPackageSizeInfo(java.lang.String packageName, int userHandle, android.content.pm.IPackageStatsObserver observer)

        try {
            mPM.getPackageSizeInfo(packageName, userHandle, observer);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public intgetPackageUid(java.lang.String packageName, int userHandle)

        try {
            int uid = mPM.getPackageUid(packageName, userHandle);
            if (uid >= 0) {
                return uid;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(packageName);
    
public java.lang.String[]getPackagesForUid(int uid)

        try {
            return mPM.getPackagesForUid(uid);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListgetPackagesHoldingPermissions(java.lang.String[] permissions, int flags)

        final int userId = mContext.getUserId();
        try {
            ParceledListSlice<PackageInfo> slice = mPM.getPackagesHoldingPermissions(
                    permissions, flags, userId);
            return slice.getList();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public android.content.pm.PermissionGroupInfogetPermissionGroupInfo(java.lang.String name, int flags)

        try {
            PermissionGroupInfo pgi = mPM.getPermissionGroupInfo(name, flags);
            if (pgi != null) {
                return pgi;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(name);
    
public android.content.pm.PermissionInfogetPermissionInfo(java.lang.String name, int flags)

        try {
            PermissionInfo pi = mPM.getPermissionInfo(name, flags);
            if (pi != null) {
                return pi;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(name);
    
public intgetPreferredActivities(java.util.List outFilters, java.util.List outActivities, java.lang.String packageName)

        try {
            return mPM.getPreferredActivities(outFilters, outActivities, packageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
        return 0;
    
public java.util.ListgetPreferredPackages(int flags)

        try {
            return mPM.getPreferredPackages(flags);
        } catch (RemoteException e) {
            // Should never happen!
        }
        return new ArrayList<PackageInfo>();
    
public android.content.pm.ProviderInfogetProviderInfo(android.content.ComponentName className, int flags)

        try {
            ProviderInfo pi = mPM.getProviderInfo(className, flags, mContext.getUserId());
            if (pi != null) {
                return pi;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(className.toString());
    
public android.content.pm.ActivityInfogetReceiverInfo(android.content.ComponentName className, int flags)

        try {
            ActivityInfo ai = mPM.getReceiverInfo(className, flags, mContext.getUserId());
            if (ai != null) {
                return ai;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(className.toString());
    
public android.content.res.ResourcesgetResourcesForActivity(android.content.ComponentName activityName)

        return getResourcesForApplication(
            getActivityInfo(activityName, sDefaultFlags).applicationInfo);
    
public android.content.res.ResourcesgetResourcesForApplication(android.content.pm.ApplicationInfo app)

        if (app.packageName.equals("system")) {
            return mContext.mMainThread.getSystemContext().getResources();
        }
        final boolean sameUid = (app.uid == Process.myUid());
        Resources r = mContext.mMainThread.getTopLevelResources(
                sameUid ? app.sourceDir : app.publicSourceDir,
                sameUid ? app.splitSourceDirs : app.splitPublicSourceDirs,
                app.resourceDirs, app.sharedLibraryFiles, Display.DEFAULT_DISPLAY,
                null, mContext.mPackageInfo);
        if (r != null) {
            return r;
        }
        throw new NameNotFoundException("Unable to open " + app.publicSourceDir);
    
public android.content.res.ResourcesgetResourcesForApplication(java.lang.String appPackageName)

        return getResourcesForApplication(
            getApplicationInfo(appPackageName, sDefaultFlags));
    
public android.content.res.ResourcesgetResourcesForApplicationAsUser(java.lang.String appPackageName, int userId)

hide

        if (userId < 0) {
            throw new IllegalArgumentException(
                    "Call does not support special user #" + userId);
        }
        if ("system".equals(appPackageName)) {
            return mContext.mMainThread.getSystemContext().getResources();
        }
        try {
            ApplicationInfo ai = mPM.getApplicationInfo(appPackageName, sDefaultFlags, userId);
            if (ai != null) {
                return getResourcesForApplication(ai);
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
        throw new NameNotFoundException("Package " + appPackageName + " doesn't exist");
    
public android.content.pm.ServiceInfogetServiceInfo(android.content.ComponentName className, int flags)

        try {
            ServiceInfo si = mPM.getServiceInfo(className, flags, mContext.getUserId());
            if (si != null) {
                return si;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(className.toString());
    
public android.content.pm.KeySetgetSigningKeySet(java.lang.String packageName)

hide

        Preconditions.checkNotNull(packageName);
        KeySet ks;
        try {
            ks = mPM.getSigningKeySet(packageName);
        } catch (RemoteException e) {
            return null;
        }
        return ks;
    
public android.content.pm.FeatureInfo[]getSystemAvailableFeatures()

        try {
            return mPM.getSystemAvailableFeatures();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.lang.String[]getSystemSharedLibraryNames()

        try {
            return mPM.getSystemSharedLibraryNames();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.lang.CharSequencegetText(java.lang.String packageName, int resid, android.content.pm.ApplicationInfo appInfo)

        ResourceName name = new ResourceName(packageName, resid);
        CharSequence text = getCachedString(name);
        if (text != null) {
            return text;
        }
        if (appInfo == null) {
            try {
                appInfo = getApplicationInfo(packageName, sDefaultFlags);
            } catch (NameNotFoundException e) {
                return null;
            }
        }
        try {
            Resources r = getResourcesForApplication(appInfo);
            text = r.getText(resid);
            putCachedString(name, text);
            return text;
        } catch (NameNotFoundException e) {
            Log.w("PackageManager", "Failure retrieving resources for "
                  + appInfo.packageName);
        } catch (RuntimeException e) {
            // If an exception was thrown, fall through to return
            // default icon.
            Log.w("PackageManager", "Failure retrieving text 0x"
                  + Integer.toHexString(resid) + " in package "
                  + packageName, e);
        }
        return null;
    
public intgetUidForSharedUser(java.lang.String sharedUserName)

        try {
            int uid = mPM.getUidForSharedUser(sharedUserName);
            if(uid != -1) {
                return uid;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
        throw new NameNotFoundException("No shared userid for user:"+sharedUserName);
    
public android.graphics.drawable.DrawablegetUserBadgeForDensity(android.os.UserHandle user, int density)

        UserInfo userInfo = getUserIfProfile(user.getIdentifier());
        if (userInfo != null && userInfo.isManagedProfile()) {
            if (density <= 0) {
                density = mContext.getResources().getDisplayMetrics().densityDpi;
            }
            return Resources.getSystem().getDrawableForDensity(
                    com.android.internal.R.drawable.ic_corp_badge, density);
        }
        return null;
    
public android.graphics.drawable.DrawablegetUserBadgedDrawableForDensity(android.graphics.drawable.Drawable drawable, android.os.UserHandle user, android.graphics.Rect badgeLocation, int badgeDensity)

        Drawable badgeDrawable = getUserBadgeForDensity(user, badgeDensity);
        if (badgeDrawable == null) {
            return drawable;
        }
        return getBadgedDrawable(drawable, badgeDrawable, badgeLocation, true);
    
public android.graphics.drawable.DrawablegetUserBadgedIcon(android.graphics.drawable.Drawable icon, android.os.UserHandle user)

        final int badgeResId = getBadgeResIdForUser(user.getIdentifier());
        if (badgeResId == 0) {
            return icon;
        }
        Drawable badgeIcon = getDrawable("system", badgeResId, null);
        return getBadgedDrawable(icon, badgeIcon, null, true);
    
public java.lang.CharSequencegetUserBadgedLabel(java.lang.CharSequence label, android.os.UserHandle user)

        UserInfo userInfo = getUserIfProfile(user.getIdentifier());
        if (userInfo != null && userInfo.isManagedProfile()) {
            return Resources.getSystem().getString(
                    com.android.internal.R.string.managed_profile_label_badge, label);
        }
        return label;
    
private android.content.pm.UserInfogetUserIfProfile(int userHandle)

        List<UserInfo> userProfiles = getUserManager().getProfiles(UserHandle.myUserId());
        for (UserInfo user : userProfiles) {
            if (user.id == userHandle) {
                return user;
            }
        }
        return null;
    
android.os.UserManagergetUserManager()

        synchronized (mLock) {
            if (mUserManager == null) {
                mUserManager = UserManager.get(mContext);
            }
            return mUserManager;
        }
    
public android.content.pm.VerifierDeviceIdentitygetVerifierDeviceIdentity()

hide

        try {
            return mPM.getVerifierDeviceIdentity();
        } catch (RemoteException e) {
            // Should never happen!
        }
        return null;
    
public android.content.res.XmlResourceParsergetXml(java.lang.String packageName, int resid, android.content.pm.ApplicationInfo appInfo)

        if (appInfo == null) {
            try {
                appInfo = getApplicationInfo(packageName, sDefaultFlags);
            } catch (NameNotFoundException e) {
                return null;
            }
        }
        try {
            Resources r = getResourcesForApplication(appInfo);
            return r.getXml(resid);
        } catch (RuntimeException e) {
            // If an exception was thrown, fall through to return
            // default icon.
            Log.w("PackageManager", "Failure retrieving xml 0x"
                  + Integer.toHexString(resid) + " in package "
                  + packageName, e);
        } catch (NameNotFoundException e) {
            Log.w("PackageManager", "Failure retrieving resources for "
                  + appInfo.packageName);
        }
        return null;
    
public voidgrantPermission(java.lang.String packageName, java.lang.String permissionName)

        try {
            mPM.grantPermission(packageName, permissionName);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
static voidhandlePackageBroadcast(int cmd, java.lang.String[] pkgList, boolean hasPkgInfo)

        boolean immediateGc = false;
        if (cmd == IApplicationThread.EXTERNAL_STORAGE_UNAVAILABLE) {
            immediateGc = true;
        }
        if (pkgList != null && (pkgList.length > 0)) {
            boolean needCleanup = false;
            for (String ssp : pkgList) {
                synchronized (sSync) {
                    for (int i=sIconCache.size()-1; i>=0; i--) {
                        ResourceName nm = sIconCache.keyAt(i);
                        if (nm.packageName.equals(ssp)) {
                            //Log.i(TAG, "Removing cached drawable for " + nm);
                            sIconCache.removeAt(i);
                            needCleanup = true;
                        }
                    }
                    for (int i=sStringCache.size()-1; i>=0; i--) {
                        ResourceName nm = sStringCache.keyAt(i);
                        if (nm.packageName.equals(ssp)) {
                            //Log.i(TAG, "Removing cached string for " + nm);
                            sStringCache.removeAt(i);
                            needCleanup = true;
                        }
                    }
                }
            }
            if (needCleanup || hasPkgInfo) {
                if (immediateGc) {
                    // Schedule an immediate gc.
                    Runtime.getRuntime().gc();
                } else {
                    ActivityThread.currentActivityThread().scheduleGcIdler();
                }
            }
        }
    
public booleanhasSystemFeature(java.lang.String name)

        try {
            return mPM.hasSystemFeature(name);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
private voidinstallCommon(android.net.Uri packageURI, PackageInstallObserver observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, android.content.pm.ContainerEncryptionParams encryptionParams)

        if (!"file".equals(packageURI.getScheme())) {
            throw new UnsupportedOperationException("Only file:// URIs are supported");
        }
        if (encryptionParams != null) {
            throw new UnsupportedOperationException("ContainerEncryptionParams not supported");
        }

        final String originPath = packageURI.getPath();
        try {
            mPM.installPackage(originPath, observer.getBinder(), flags, installerPackageName,
                    verificationParams, null);
        } catch (RemoteException ignored) {
        }
    
public intinstallExistingPackage(java.lang.String packageName)

        try {
            int res = mPM.installExistingPackageAsUser(packageName, UserHandle.myUserId());
            if (res == INSTALL_FAILED_INVALID_URI) {
                throw new NameNotFoundException("Package " + packageName + " doesn't exist");
            }
            return res;
        } catch (RemoteException e) {
            // Should never happen!
            throw new NameNotFoundException("Package " + packageName + " doesn't exist");
        }
    
public voidinstallPackage(android.net.Uri packageURI, android.content.pm.IPackageInstallObserver observer, int flags, java.lang.String installerPackageName)

        final VerificationParams verificationParams = new VerificationParams(null, null,
                null, VerificationParams.NO_UID, null);
        installCommon(packageURI, new LegacyPackageInstallObserver(observer), flags,
                installerPackageName, verificationParams, null);
    
public voidinstallPackage(android.net.Uri packageURI, PackageInstallObserver observer, int flags, java.lang.String installerPackageName)

        final VerificationParams verificationParams = new VerificationParams(null, null,
                null, VerificationParams.NO_UID, null);
        installCommon(packageURI, observer, flags, installerPackageName, verificationParams, null);
    
public voidinstallPackageWithVerification(android.net.Uri packageURI, android.content.pm.IPackageInstallObserver observer, int flags, java.lang.String installerPackageName, android.net.Uri verificationURI, android.content.pm.ManifestDigest manifestDigest, android.content.pm.ContainerEncryptionParams encryptionParams)

        final VerificationParams verificationParams = new VerificationParams(verificationURI, null,
                null, VerificationParams.NO_UID, manifestDigest);
        installCommon(packageURI, new LegacyPackageInstallObserver(observer), flags,
                installerPackageName, verificationParams, encryptionParams);
    
public voidinstallPackageWithVerification(android.net.Uri packageURI, PackageInstallObserver observer, int flags, java.lang.String installerPackageName, android.net.Uri verificationURI, android.content.pm.ManifestDigest manifestDigest, android.content.pm.ContainerEncryptionParams encryptionParams)

        final VerificationParams verificationParams = new VerificationParams(verificationURI, null,
                null, VerificationParams.NO_UID, manifestDigest);
        installCommon(packageURI, observer, flags, installerPackageName, verificationParams,
                encryptionParams);
    
public voidinstallPackageWithVerificationAndEncryption(android.net.Uri packageURI, android.content.pm.IPackageInstallObserver observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, android.content.pm.ContainerEncryptionParams encryptionParams)

        installCommon(packageURI, new LegacyPackageInstallObserver(observer), flags,
                installerPackageName, verificationParams, encryptionParams);
    
public voidinstallPackageWithVerificationAndEncryption(android.net.Uri packageURI, PackageInstallObserver observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, android.content.pm.ContainerEncryptionParams encryptionParams)

        installCommon(packageURI, observer, flags, installerPackageName, verificationParams,
                encryptionParams);
    
public booleanisPackageAvailable(java.lang.String packageName)

        try {
            return mPM.isPackageAvailable(packageName, mContext.getUserId());
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        }
    
public booleanisSafeMode()

        
        try {
            if (mCachedSafeMode < 0) {
                mCachedSafeMode = mPM.isSafeMode() ? 1 : 0;
            }
            return mCachedSafeMode != 0;
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public booleanisSignedBy(java.lang.String packageName, android.content.pm.KeySet ks)

hide

        Preconditions.checkNotNull(packageName);
        Preconditions.checkNotNull(ks);
        try {
            return mPM.isPackageSignedByKeySet(packageName, ks);
        } catch (RemoteException e) {
            return false;
        }
    
public booleanisSignedByExactly(java.lang.String packageName, android.content.pm.KeySet ks)

hide

        Preconditions.checkNotNull(packageName);
        Preconditions.checkNotNull(ks);
        try {
            return mPM.isPackageSignedByKeySetExactly(packageName, ks);
        } catch (RemoteException e) {
            return false;
        }
    
public booleanisUpgrade()

hide

        try {
            return mPM.isUpgrade();
        } catch (RemoteException e) {
            return false;
        }
    
public android.graphics.drawable.DrawableloadItemIcon(android.content.pm.PackageItemInfo itemInfo, android.content.pm.ApplicationInfo appInfo)

hide

        Drawable dr = loadUnbadgedItemIcon(itemInfo, appInfo);
        if (itemInfo.showUserIcon != UserHandle.USER_NULL) {
            return dr;
        }
        return getUserBadgedIcon(dr, new UserHandle(mContext.getUserId()));
    
public android.graphics.drawable.DrawableloadUnbadgedItemIcon(android.content.pm.PackageItemInfo itemInfo, android.content.pm.ApplicationInfo appInfo)

hide

        if (itemInfo.showUserIcon != UserHandle.USER_NULL) {
            Bitmap bitmap = getUserManager().getUserIcon(itemInfo.showUserIcon);
            if (bitmap == null) {
                return UserIcons.getDefaultUserIcon(itemInfo.showUserIcon, /* light= */ false);
            }
            return new BitmapDrawable(bitmap);
        }
        Drawable dr = null;
        if (itemInfo.packageName != null) {
            dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo);
        }
        if (dr == null) {
            dr = itemInfo.loadDefaultIcon(this);
        }
        return dr;
    
private static voidmaybeAdjustApplicationInfo(android.content.pm.ApplicationInfo info)

        // If we're dealing with a multi-arch application that has both
        // 32 and 64 bit shared libraries, we might need to choose the secondary
        // depending on what the current runtime's instruction set is.
        if (info.primaryCpuAbi != null && info.secondaryCpuAbi != null) {
            final String runtimeIsa = VMRuntime.getRuntime().vmInstructionSet();
            final String secondaryIsa = VMRuntime.getInstructionSet(info.secondaryCpuAbi);

            // If the runtimeIsa is the same as the primary isa, then we do nothing.
            // Everything will be set up correctly because info.nativeLibraryDir will
            // correspond to the right ISA.
            if (runtimeIsa.equals(secondaryIsa)) {
                info.nativeLibraryDir = info.secondaryNativeLibraryDir;
            }
        }
    
public voidmovePackage(java.lang.String packageName, android.content.pm.IPackageMoveObserver observer, int flags)

        try {
            mPM.movePackage(packageName, observer, flags);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
private voidputCachedIcon(android.app.ApplicationPackageManager$ResourceName name, android.graphics.drawable.Drawable dr)

        synchronized (sSync) {
            sIconCache.put(name, new WeakReference<Drawable.ConstantState>(dr.getConstantState()));
            if (DEBUG_ICONS) Log.v(TAG, "Added cached drawable state for " + name + ": " + dr);
        }
    
private voidputCachedString(android.app.ApplicationPackageManager$ResourceName name, java.lang.CharSequence cs)

        synchronized (sSync) {
            sStringCache.put(name, new WeakReference<CharSequence>(cs));
        }
    
public java.util.ListqueryBroadcastReceivers(android.content.Intent intent, int flags, int userId)

hide

        try {
            return mPM.queryIntentReceivers(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryBroadcastReceivers(android.content.Intent intent, int flags)

        return queryBroadcastReceivers(intent, flags, mContext.getUserId());
    
public java.util.ListqueryContentProviders(java.lang.String processName, int uid, int flags)

        try {
            return mPM.queryContentProviders(processName, uid, flags);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryInstrumentation(java.lang.String targetPackage, int flags)

        try {
            return mPM.queryInstrumentation(targetPackage, flags);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryIntentActivities(android.content.Intent intent, int flags)

        return queryIntentActivitiesAsUser(intent, flags, mContext.getUserId());
    
public java.util.ListqueryIntentActivitiesAsUser(android.content.Intent intent, int flags, int userId)

hide
Same as above but for a specific user

        try {
            return mPM.queryIntentActivities(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryIntentActivityOptions(android.content.ComponentName caller, android.content.Intent[] specifics, android.content.Intent intent, int flags)

        final ContentResolver resolver = mContext.getContentResolver();

        String[] specificTypes = null;
        if (specifics != null) {
            final int N = specifics.length;
            for (int i=0; i<N; i++) {
                Intent sp = specifics[i];
                if (sp != null) {
                    String t = sp.resolveTypeIfNeeded(resolver);
                    if (t != null) {
                        if (specificTypes == null) {
                            specificTypes = new String[N];
                        }
                        specificTypes[i] = t;
                    }
                }
            }
        }

        try {
            return mPM.queryIntentActivityOptions(caller, specifics,
                                                  specificTypes, intent, intent.resolveTypeIfNeeded(resolver),
                                                  flags, mContext.getUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryIntentContentProviders(android.content.Intent intent, int flags)

        return queryIntentContentProvidersAsUser(intent, flags, mContext.getUserId());
    
public java.util.ListqueryIntentContentProvidersAsUser(android.content.Intent intent, int flags, int userId)

        try {
            return mPM.queryIntentContentProviders(intent,
                    intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryIntentServices(android.content.Intent intent, int flags)

        return queryIntentServicesAsUser(intent, flags, mContext.getUserId());
    
public java.util.ListqueryIntentServicesAsUser(android.content.Intent intent, int flags, int userId)

        try {
            return mPM.queryIntentServices(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public java.util.ListqueryPermissionsByGroup(java.lang.String group, int flags)

        try {
            List<PermissionInfo> pi = mPM.queryPermissionsByGroup(group, flags);
            if (pi != null) {
                return pi;
            }
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }

        throw new NameNotFoundException(group);
    
public voidremovePackageFromPreferred(java.lang.String packageName)

        try {
            mPM.removePackageFromPreferred(packageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidremovePermission(java.lang.String name)

        try {
            mPM.removePermission(name);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voidreplacePreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)

        try {
            mPM.replacePreferredActivity(filter, match, set, activity, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidreplacePreferredActivityAsUser(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity, int userId)

        try {
            mPM.replacePreferredActivity(filter, match, set, activity, userId);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public android.content.pm.ResolveInforesolveActivity(android.content.Intent intent, int flags)

        return resolveActivityAsUser(intent, flags, mContext.getUserId());
    
public android.content.pm.ResolveInforesolveActivityAsUser(android.content.Intent intent, int flags, int userId)

        try {
            return mPM.resolveIntent(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public android.content.pm.ProviderInforesolveContentProvider(java.lang.String name, int flags)

        return resolveContentProviderAsUser(name, flags, mContext.getUserId());
    
public android.content.pm.ProviderInforesolveContentProviderAsUser(java.lang.String name, int flags, int userId)

hide

        try {
            return mPM.resolveContentProvider(name, flags, userId);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public android.content.pm.ResolveInforesolveService(android.content.Intent intent, int flags)

        try {
            return mPM.resolveService(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                mContext.getUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voidrevokePermission(java.lang.String packageName, java.lang.String permissionName)

        try {
            mPM.revokePermission(packageName, permissionName);
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    
public voidsetApplicationEnabledSetting(java.lang.String packageName, int newState, int flags)

        try {
            mPM.setApplicationEnabledSetting(packageName, newState, flags,
                    mContext.getUserId(), mContext.getOpPackageName());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public booleansetApplicationHiddenSettingAsUser(java.lang.String packageName, boolean hidden, android.os.UserHandle user)

        try {
            return mPM.setApplicationHiddenSettingAsUser(packageName, hidden,
                    user.getIdentifier());
        } catch (RemoteException re) {
            // Should never happen!
        }
        return false;
    
public voidsetComponentEnabledSetting(android.content.ComponentName componentName, int newState, int flags)

        try {
            mPM.setComponentEnabledSetting(componentName, newState, flags, mContext.getUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidsetInstallerPackageName(java.lang.String targetPackage, java.lang.String installerPackageName)

        try {
            mPM.setInstallerPackageName(targetPackage, installerPackageName);
        } catch (RemoteException e) {
            // Should never happen!
        }
    
public voidverifyPendingInstall(int id, int response)

        try {
            mPM.verifyPendingInstall(id, response);
        } catch (RemoteException e) {
            // Should never happen!
        }