Loading api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -11718,7 +11718,10 @@ package android.content.pm { method public android.graphics.drawable.Drawable getIcon(int); method public CharSequence getLabel(); method public String getName(); method public float getProgress(); method public android.os.UserHandle getUser(); method public boolean isLoading(); method public boolean isStartable(); } public class LauncherApps { Loading Loading @@ -11758,6 +11761,7 @@ package android.content.pm { ctor public LauncherApps.Callback(); method public abstract void onPackageAdded(String, android.os.UserHandle); method public abstract void onPackageChanged(String, android.os.UserHandle); method public void onPackageProgressChanged(@NonNull String, @NonNull android.os.UserHandle, float); method public abstract void onPackageRemoved(String, android.os.UserHandle); method public abstract void onPackagesAvailable(String[], android.os.UserHandle, boolean); method public void onPackagesSuspended(String[], android.os.UserHandle); core/java/android/content/pm/ILauncherApps.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.content.ComponentName; import android.content.Intent; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IOnAppsChangedListener; import android.content.pm.LauncherActivityInfoInternal; import android.content.pm.LauncherApps; import android.content.pm.ShortcutQueryWrapper; import android.content.pm.IPackageInstallerCallback; Loading @@ -47,7 +47,7 @@ interface ILauncherApps { void removeOnAppsChangedListener(in IOnAppsChangedListener listener); ParceledListSlice getLauncherActivities( String callingPackage, String packageName, in UserHandle user); ActivityInfo resolveActivity( LauncherActivityInfoInternal resolveLauncherActivityInternal( String callingPackage, in ComponentName component, in UserHandle user); void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo, Loading core/java/android/content/pm/IOnAppsChangedListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,5 @@ oneway interface IOnAppsChangedListener { in Bundle launcherExtras); void onPackagesUnsuspended(in UserHandle user, in String[] packageNames); void onShortcutChanged(in UserHandle user, String packageName, in ParceledListSlice shortcuts); void onPackageProgressChanged(in UserHandle user, String packageName, float progress); } core/java/android/content/pm/IPackageManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.content.pm.IPackageInstaller; import android.content.pm.IPackageDeleteObserver; import android.content.pm.IPackageDeleteObserver2; import android.content.pm.IPackageDataObserver; import android.content.pm.IPackageLoadingProgressCallback; import android.content.pm.IPackageMoveObserver; import android.content.pm.IPackageStatsObserver; import android.content.pm.IntentFilterVerificationInfo; Loading core/java/android/content/pm/LauncherActivityInfo.java +36 −25 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.content.pm; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; Loading @@ -35,28 +34,19 @@ public class LauncherActivityInfo { private static final String TAG = "LauncherActivityInfo"; private final PackageManager mPm; @UnsupportedAppUsage private ActivityInfo mActivityInfo; private ComponentName mComponentName; private UserHandle mUser; private final LauncherActivityInfoInternal mInternal; /** * Create a launchable activity object for a given ResolveInfo and user. * * @param context The context for fetching resources. * @param info ResolveInfo from which to create the LauncherActivityInfo. * @param user The UserHandle of the profile to which this activity belongs. */ LauncherActivityInfo(Context context, ActivityInfo info, UserHandle user) { this(context); mActivityInfo = info; mComponentName = new ComponentName(info.packageName, info.name); mUser = user; } LauncherActivityInfo(Context context) { */ LauncherActivityInfo(Context context, UserHandle user, LauncherActivityInfoInternal internal) { mPm = context.getPackageManager(); mUser = user; mInternal = internal; } /** Loading @@ -65,7 +55,7 @@ public class LauncherActivityInfo { * @return ComponentName of the activity */ public ComponentName getComponentName() { return mComponentName; return mInternal.getComponentName(); } /** Loading @@ -90,7 +80,28 @@ public class LauncherActivityInfo { */ public CharSequence getLabel() { // TODO: Go through LauncherAppsService return mActivityInfo.loadLabel(mPm); return mInternal.getActivityInfo().loadLabel(mPm); } /** * @return whether the package is startable. */ public boolean isStartable() { return mInternal.getIncrementalStatesInfo().isStartable(); } /** * @return whether the package is still loading. */ public boolean isLoading() { return mInternal.getIncrementalStatesInfo().isLoading(); } /** * @return Package loading progress */ public float getProgress() { return mInternal.getIncrementalStatesInfo().getProgress(); } /** Loading @@ -103,20 +114,20 @@ public class LauncherActivityInfo { */ public Drawable getIcon(int density) { // TODO: Go through LauncherAppsService final int iconRes = mActivityInfo.getIconResource(); final int iconRes = mInternal.getActivityInfo().getIconResource(); Drawable icon = null; // Get the preferred density icon from the app's resources if (density != 0 && iconRes != 0) { try { final Resources resources = mPm.getResourcesForApplication(mActivityInfo.applicationInfo); final Resources resources = mPm.getResourcesForApplication( mInternal.getActivityInfo().applicationInfo); icon = resources.getDrawableForDensity(iconRes, density); } catch (NameNotFoundException | Resources.NotFoundException exc) { } } // Get the default density icon if (icon == null) { icon = mActivityInfo.loadIcon(mPm); icon = mInternal.getActivityInfo().loadIcon(mPm); } return icon; } Loading @@ -128,7 +139,7 @@ public class LauncherActivityInfo { * @hide remove before shipping */ public int getApplicationFlags() { return mActivityInfo.applicationInfo.flags; return mInternal.getActivityInfo().flags; } /** Loading @@ -136,7 +147,7 @@ public class LauncherActivityInfo { * @return */ public ApplicationInfo getApplicationInfo() { return mActivityInfo.applicationInfo; return mInternal.getActivityInfo().applicationInfo; } /** Loading @@ -147,7 +158,7 @@ public class LauncherActivityInfo { public long getFirstInstallTime() { try { // TODO: Go through LauncherAppsService return mPm.getPackageInfo(mActivityInfo.packageName, return mPm.getPackageInfo(mInternal.getActivityInfo().packageName, PackageManager.MATCH_UNINSTALLED_PACKAGES).firstInstallTime; } catch (NameNotFoundException nnfe) { // Sorry, can't find package Loading @@ -160,7 +171,7 @@ public class LauncherActivityInfo { * @return the name from android:name for the acitivity. */ public String getName() { return mActivityInfo.name; return mInternal.getActivityInfo().name; } /** Loading Loading
api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -11718,7 +11718,10 @@ package android.content.pm { method public android.graphics.drawable.Drawable getIcon(int); method public CharSequence getLabel(); method public String getName(); method public float getProgress(); method public android.os.UserHandle getUser(); method public boolean isLoading(); method public boolean isStartable(); } public class LauncherApps { Loading Loading @@ -11758,6 +11761,7 @@ package android.content.pm { ctor public LauncherApps.Callback(); method public abstract void onPackageAdded(String, android.os.UserHandle); method public abstract void onPackageChanged(String, android.os.UserHandle); method public void onPackageProgressChanged(@NonNull String, @NonNull android.os.UserHandle, float); method public abstract void onPackageRemoved(String, android.os.UserHandle); method public abstract void onPackagesAvailable(String[], android.os.UserHandle, boolean); method public void onPackagesSuspended(String[], android.os.UserHandle);
core/java/android/content/pm/ILauncherApps.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.content.ComponentName; import android.content.Intent; import android.content.IntentSender; import android.content.LocusId; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IOnAppsChangedListener; import android.content.pm.LauncherActivityInfoInternal; import android.content.pm.LauncherApps; import android.content.pm.ShortcutQueryWrapper; import android.content.pm.IPackageInstallerCallback; Loading @@ -47,7 +47,7 @@ interface ILauncherApps { void removeOnAppsChangedListener(in IOnAppsChangedListener listener); ParceledListSlice getLauncherActivities( String callingPackage, String packageName, in UserHandle user); ActivityInfo resolveActivity( LauncherActivityInfoInternal resolveLauncherActivityInternal( String callingPackage, in ComponentName component, in UserHandle user); void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo, Loading
core/java/android/content/pm/IOnAppsChangedListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,5 @@ oneway interface IOnAppsChangedListener { in Bundle launcherExtras); void onPackagesUnsuspended(in UserHandle user, in String[] packageNames); void onShortcutChanged(in UserHandle user, String packageName, in ParceledListSlice shortcuts); void onPackageProgressChanged(in UserHandle user, String packageName, float progress); }
core/java/android/content/pm/IPackageManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.content.pm.IPackageInstaller; import android.content.pm.IPackageDeleteObserver; import android.content.pm.IPackageDeleteObserver2; import android.content.pm.IPackageDataObserver; import android.content.pm.IPackageLoadingProgressCallback; import android.content.pm.IPackageMoveObserver; import android.content.pm.IPackageStatsObserver; import android.content.pm.IntentFilterVerificationInfo; Loading
core/java/android/content/pm/LauncherActivityInfo.java +36 −25 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.content.pm; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; Loading @@ -35,28 +34,19 @@ public class LauncherActivityInfo { private static final String TAG = "LauncherActivityInfo"; private final PackageManager mPm; @UnsupportedAppUsage private ActivityInfo mActivityInfo; private ComponentName mComponentName; private UserHandle mUser; private final LauncherActivityInfoInternal mInternal; /** * Create a launchable activity object for a given ResolveInfo and user. * * @param context The context for fetching resources. * @param info ResolveInfo from which to create the LauncherActivityInfo. * @param user The UserHandle of the profile to which this activity belongs. */ LauncherActivityInfo(Context context, ActivityInfo info, UserHandle user) { this(context); mActivityInfo = info; mComponentName = new ComponentName(info.packageName, info.name); mUser = user; } LauncherActivityInfo(Context context) { */ LauncherActivityInfo(Context context, UserHandle user, LauncherActivityInfoInternal internal) { mPm = context.getPackageManager(); mUser = user; mInternal = internal; } /** Loading @@ -65,7 +55,7 @@ public class LauncherActivityInfo { * @return ComponentName of the activity */ public ComponentName getComponentName() { return mComponentName; return mInternal.getComponentName(); } /** Loading @@ -90,7 +80,28 @@ public class LauncherActivityInfo { */ public CharSequence getLabel() { // TODO: Go through LauncherAppsService return mActivityInfo.loadLabel(mPm); return mInternal.getActivityInfo().loadLabel(mPm); } /** * @return whether the package is startable. */ public boolean isStartable() { return mInternal.getIncrementalStatesInfo().isStartable(); } /** * @return whether the package is still loading. */ public boolean isLoading() { return mInternal.getIncrementalStatesInfo().isLoading(); } /** * @return Package loading progress */ public float getProgress() { return mInternal.getIncrementalStatesInfo().getProgress(); } /** Loading @@ -103,20 +114,20 @@ public class LauncherActivityInfo { */ public Drawable getIcon(int density) { // TODO: Go through LauncherAppsService final int iconRes = mActivityInfo.getIconResource(); final int iconRes = mInternal.getActivityInfo().getIconResource(); Drawable icon = null; // Get the preferred density icon from the app's resources if (density != 0 && iconRes != 0) { try { final Resources resources = mPm.getResourcesForApplication(mActivityInfo.applicationInfo); final Resources resources = mPm.getResourcesForApplication( mInternal.getActivityInfo().applicationInfo); icon = resources.getDrawableForDensity(iconRes, density); } catch (NameNotFoundException | Resources.NotFoundException exc) { } } // Get the default density icon if (icon == null) { icon = mActivityInfo.loadIcon(mPm); icon = mInternal.getActivityInfo().loadIcon(mPm); } return icon; } Loading @@ -128,7 +139,7 @@ public class LauncherActivityInfo { * @hide remove before shipping */ public int getApplicationFlags() { return mActivityInfo.applicationInfo.flags; return mInternal.getActivityInfo().flags; } /** Loading @@ -136,7 +147,7 @@ public class LauncherActivityInfo { * @return */ public ApplicationInfo getApplicationInfo() { return mActivityInfo.applicationInfo; return mInternal.getActivityInfo().applicationInfo; } /** Loading @@ -147,7 +158,7 @@ public class LauncherActivityInfo { public long getFirstInstallTime() { try { // TODO: Go through LauncherAppsService return mPm.getPackageInfo(mActivityInfo.packageName, return mPm.getPackageInfo(mInternal.getActivityInfo().packageName, PackageManager.MATCH_UNINSTALLED_PACKAGES).firstInstallTime; } catch (NameNotFoundException nnfe) { // Sorry, can't find package Loading @@ -160,7 +171,7 @@ public class LauncherActivityInfo { * @return the name from android:name for the acitivity. */ public String getName() { return mActivityInfo.name; return mInternal.getActivityInfo().name; } /** Loading