diff --git a/core/api/current.txt b/core/api/current.txt index 82d7f4a02f89e..184d3cf15dd1c 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -13079,7 +13079,6 @@ package android.content.pm { method public void reportShortcutUsed(String); method @WorkerThread public boolean requestPinShortcut(@NonNull android.content.pm.ShortcutInfo, @Nullable android.content.IntentSender); method @WorkerThread public boolean setDynamicShortcuts(@NonNull java.util.List); - method public void updateShortcutVisibility(@NonNull String, @Nullable byte[], boolean); method @WorkerThread public boolean updateShortcuts(@NonNull java.util.List); field public static final int FLAG_MATCH_CACHED = 8; // 0x8 field public static final int FLAG_MATCH_DYNAMIC = 2; // 0x2 diff --git a/core/java/android/content/pm/IShortcutService.aidl b/core/java/android/content/pm/IShortcutService.aidl index 9d381ef586d48..804a06bdaae9b 100644 --- a/core/java/android/content/pm/IShortcutService.aidl +++ b/core/java/android/content/pm/IShortcutService.aidl @@ -81,7 +81,4 @@ interface IShortcutService { AndroidFuture getShortcuts(String packageName, int matchFlags, int userId); AndroidFuture pushDynamicShortcut(String packageName, in ShortcutInfo shortcut, int userId); - - AndroidFuture updateShortcutVisibility(String callingPkg, String packageName, - in byte[] certificate, in boolean visible, int userId); } diff --git a/core/java/android/content/pm/ShortcutManager.java b/core/java/android/content/pm/ShortcutManager.java index 2a36c11445c9f..d77fa91701df5 100644 --- a/core/java/android/content/pm/ShortcutManager.java +++ b/core/java/android/content/pm/ShortcutManager.java @@ -40,7 +40,6 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; import android.os.ServiceManager; -import android.os.UserHandle; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.infra.AndroidFuture; @@ -790,23 +789,6 @@ public class ShortcutManager { } } - /** - * Granting another app the access to the shortcuts you own. You must provide the package name - * and their SHA256 certificate digest in order to granting the access. - * - * Once granted, the other app can retain a copy of all the shortcuts you own when calling - * {@link LauncherApps#getShortcuts(LauncherApps.ShortcutQuery, UserHandle)}. - */ - public void updateShortcutVisibility(@NonNull final String packageName, - @Nullable final byte[] certificate, final boolean visible) { - try { - getFutureOrThrow(mService.updateShortcutVisibility(mContext.getPackageName(), - packageName, certificate, visible, injectMyUserId())); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - private static T getFutureOrThrow(@NonNull AndroidFuture future) { try { return future.get(); diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java index 7f18c4b4486af..20f35f2218d12 100644 --- a/services/core/java/com/android/server/pm/ShortcutService.java +++ b/services/core/java/com/android/server/pm/ShortcutService.java @@ -2253,24 +2253,6 @@ public class ShortcutService extends IShortcutService.Stub { return ret; } - @Override - public AndroidFuture updateShortcutVisibility(String callingPkg, String packageName, - byte[] certificate, boolean visible, int userId) { - final AndroidFuture ret = new AndroidFuture<>(); - injectPostToHandlerIfAppSearch(() -> { - try { - synchronized (mLock) { - getPackageShortcutsForPublisherLocked(callingPkg, userId) - .updateVisibility(packageName, certificate, visible); - } - ret.complete(null); - } catch (Exception e) { - ret.completeExceptionally(e); - } - }); - return ret; - } - @Override public AndroidFuture requestPinShortcut(String packageName, ShortcutInfo shortcut, IntentSender resultIntent, int userId) { diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest12.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest12.java index 478aa415f9549..9598a00df33d2 100644 --- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest12.java +++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest12.java @@ -15,20 +15,11 @@ */ package com.android.server.pm; -import static android.provider.DeviceConfig.NAMESPACE_SYSTEMUI; - import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list; import android.app.PendingIntent; -import android.app.appsearch.PackageIdentifier; -import android.content.pm.AppSearchShortcutInfo; import android.os.RemoteException; import android.os.UserHandle; -import android.provider.DeviceConfig; - -import com.android.internal.config.sysui.SystemUiDeviceConfigFlags; - -import java.util.Random; /** * Tests for {@link android.app.appsearch.AppSearchManager} and relevant APIs in ShortcutManager. @@ -37,26 +28,6 @@ import java.util.Random; */ public class ShortcutManagerTest12 extends BaseShortcutManagerTest { - public void testUpdateShortcutVisibility_updatesShortcutSchema() { - if (!DeviceConfig.getBoolean(NAMESPACE_SYSTEMUI, - SystemUiDeviceConfigFlags.DARK_LAUNCH_REMOTE_PREDICTION_SERVICE_ENABLED, - false)) { - // no-op if app-search integration is disabled. - return; - } - final byte[] cert = new byte[20]; - new Random().nextBytes(cert); - - runWithCaller(CALLING_PACKAGE_1, USER_0, () -> { - mManager.updateShortcutVisibility(CALLING_PACKAGE_2, cert, true); - assertTrue(mMockAppSearchManager.mSchemasPackageAccessible.containsKey( - AppSearchShortcutInfo.SCHEMA_TYPE)); - assertTrue(mMockAppSearchManager.mSchemasPackageAccessible.get( - AppSearchShortcutInfo.SCHEMA_TYPE).get(0).equals( - new PackageIdentifier(CALLING_PACKAGE_2, cert))); - }); - } - public void testGetShortcutIntents_ReturnsMutablePendingIntents() throws RemoteException { setDefaultLauncher(USER_0, LAUNCHER_1);