Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59c30a01 authored by Sunny Goyal's avatar Sunny Goyal Committed by android-build-merger
Browse files

Merge "Changing LauncherApps to resolve activity by component name" into nyc-dev

am: 1fe7dfa6

* commit '1fe7dfa6':
  Changing LauncherApps to resolve activity by component name

Change-Id: I517285d5ca79af026080cc80e938e2134d98f14e
parents 45e185a3 1fe7dfa6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -9497,7 +9497,6 @@ package android.content.pm {
  public class LauncherApps {
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
    method public android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int, android.os.UserHandle);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(android.content.pm.ShortcutInfo);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(java.lang.String, java.lang.String, android.os.UserHandle);
    method public int getShortcutIconResId(android.content.pm.ShortcutInfo);
+0 −1
Original line number Diff line number Diff line
@@ -9835,7 +9835,6 @@ package android.content.pm {
  public class LauncherApps {
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
    method public android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int, android.os.UserHandle);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(android.content.pm.ShortcutInfo);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(java.lang.String, java.lang.String, android.os.UserHandle);
    method public int getShortcutIconResId(android.content.pm.ShortcutInfo);
+0 −1
Original line number Diff line number Diff line
@@ -9507,7 +9507,6 @@ package android.content.pm {
  public class LauncherApps {
    ctor public LauncherApps(android.content.Context);
    method public java.util.List<android.content.pm.LauncherActivityInfo> getActivityList(java.lang.String, android.os.UserHandle);
    method public android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String, int, android.os.UserHandle);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(android.content.pm.ShortcutInfo);
    method public android.os.ParcelFileDescriptor getShortcutIconFd(java.lang.String, java.lang.String, android.os.UserHandle);
    method public int getShortcutIconResId(android.content.pm.ShortcutInfo);
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.content.pm;

import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.IOnAppsChangedListener;
import android.content.pm.ParceledListSlice;
@@ -37,7 +38,7 @@ interface ILauncherApps {
    void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener);
    void removeOnAppsChangedListener(in IOnAppsChangedListener listener);
    ParceledListSlice getLauncherActivities(String packageName, in UserHandle user);
    ResolveInfo resolveActivity(in Intent intent, in UserHandle user);
    ActivityInfo resolveActivity(in ComponentName component, in UserHandle user);
    void startActivityAsUser(in ComponentName component, in Rect sourceBounds,
            in Bundle opts, in UserHandle user);
    void showAppDetailsAsUser(in ComponentName component, in Rect sourceBounds,
+6 −8
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ public class LauncherActivityInfo {

    private ActivityInfo mActivityInfo;
    private ComponentName mComponentName;
    private ResolveInfo mResolveInfo;
    private UserHandle mUser;

    /**
@@ -49,11 +48,10 @@ public class LauncherActivityInfo {
     * @param info ResolveInfo from which to create the LauncherActivityInfo.
     * @param user The UserHandle of the profile to which this activity belongs.
     */
    LauncherActivityInfo(Context context, ResolveInfo info, UserHandle user) {
    LauncherActivityInfo(Context context, ActivityInfo info, UserHandle user) {
        this(context);
        mResolveInfo = info;
        mActivityInfo = info.activityInfo;
        mComponentName = LauncherApps.getComponentName(info);
        mActivityInfo = info;
        mComponentName =  new ComponentName(info.packageName, info.name);
        mUser = user;
    }

@@ -91,7 +89,7 @@ public class LauncherActivityInfo {
     * @return The label for the activity.
     */
    public CharSequence getLabel() {
        return mResolveInfo.loadLabel(mPm);
        return mActivityInfo.loadLabel(mPm);
    }

    /**
@@ -103,7 +101,7 @@ public class LauncherActivityInfo {
     * @return The drawable associated with the activity.
     */
    public Drawable getIcon(int density) {
        final int iconRes = mResolveInfo.getIconResourceInternal();
        final int iconRes = mActivityInfo.getIconResource();
        Drawable icon = null;
        // Get the preferred density icon from the app's resources
        if (density != 0 && iconRes != 0) {
@@ -116,7 +114,7 @@ public class LauncherActivityInfo {
        }
        // Get the default density icon
        if (icon == null) {
            icon = mResolveInfo.loadIcon(mPm);
            icon = mActivityInfo.loadIcon(mPm);
        }
        return icon;
    }
Loading