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

Commit 5ba0d3e3 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

ShortcutManager: First cut of CTS

Bug 27548047

Change-Id: Idd7a768ea4fee44c2cf6e3bd473cea9e67f5f7cd
parent 9d362ae5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9505,6 +9505,7 @@ 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);
@@ -10092,6 +10093,7 @@ package android.content.pm {
  }
  public class ShortcutManager {
    ctor public ShortcutManager(android.content.Context);
    method public boolean addDynamicShortcut(android.content.pm.ShortcutInfo);
    method public void deleteAllDynamicShortcuts();
    method public void deleteDynamicShortcut(java.lang.String);
+2 −5
Original line number Diff line number Diff line
@@ -589,9 +589,7 @@ final class SystemServiceRegistry {
                new CachedServiceFetcher<LauncherApps>() {
            @Override
            public LauncherApps createService(ContextImpl ctx) {
                IBinder b = ServiceManager.getService(Context.LAUNCHER_APPS_SERVICE);
                ILauncherApps service = ILauncherApps.Stub.asInterface(b);
                return new LauncherApps(ctx, service);
                return new LauncherApps(ctx);
            }});

        registerService(Context.RESTRICTIONS_SERVICE, RestrictionsManager.class,
@@ -758,8 +756,7 @@ final class SystemServiceRegistry {
                new CachedServiceFetcher<ShortcutManager>() {
            @Override
            public ShortcutManager createService(ContextImpl ctx) {
                IBinder b = ServiceManager.getService(Context.SHORTCUT_SERVICE);
                return new ShortcutManager(ctx, IShortcutService.Stub.asInterface(b));
                return new ShortcutManager(ctx);
            }});

        registerService(Context.SYSTEM_HEALTH_SERVICE, SystemHealthManager.class,
+9 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.content.pm;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -30,6 +31,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;
@@ -261,6 +263,13 @@ public class LauncherApps {
        mPm = context.getPackageManager();
    }

    /** @hide */
    @TestApi
    public LauncherApps(Context context) {
        this(context, ILauncherApps.Stub.asInterface(
                ServiceManager.getService(Context.LAUNCHER_APPS_SERVICE)));
    }

    /**
     * Retrieves a list of launchable activities that match {@link Intent#ACTION_MAIN} and
     * {@link Intent#CATEGORY_LAUNCHER}, for a specified user.
+12 −0
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@
package android.content.pm;

import android.annotation.NonNull;
import android.annotation.TestApi;
import android.content.Context;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;

import com.android.internal.annotations.VisibleForTesting;
@@ -96,6 +99,15 @@ public class ShortcutManager {
        mService = service;
    }

    /**
     * @hide
     */
    @TestApi
    public ShortcutManager(Context context) {
        this(context, IShortcutService.Stub.asInterface(
                ServiceManager.getService(Context.SHORTCUT_SERVICE)));
    }

    /**
     * Publish a list of shortcuts.  All existing dynamic shortcuts from the caller application
     * will be replaced.
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ public class LauncherAppsService extends SystemService {
        @Override
        public void addOnAppsChangedListener(String callingPackage, IOnAppsChangedListener listener)
                throws RemoteException {
            verifyCallingPackage(callingPackage);
            synchronized (mListeners) {
                if (DEBUG) {
                    Log.d(TAG, "Adding listener from " + Binder.getCallingUserHandle());
Loading