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

Commit bd22a6a2 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12847866 from 1d803b32 to 25Q2-release

Change-Id: I1778c03b3b6a618c31d2b49ba3a11ebe85c39956
parents 3e879d65 1d803b32
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -83,8 +83,6 @@ interface ILauncherApps {

    ParceledListSlice getShortcuts(String callingPackage, in ShortcutQueryWrapper query,
            in UserHandle user);
    void getShortcutsAsync(String callingPackage, in ShortcutQueryWrapper query,
            in UserHandle user, in AndroidFuture<List<ShortcutInfo>> cb);
    void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
            in UserHandle user);
    boolean startShortcut(String callingPackage, String packageName, String featureId, String id,
+4 −6
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import android.content.IntentSender;
import android.content.pm.ParceledListSlice;
import android.content.pm.ShortcutInfo;

import com.android.internal.infra.AndroidFuture;

/** {@hide} */
interface IShortcutService {

@@ -38,11 +36,11 @@ interface IShortcutService {

    boolean updateShortcuts(String packageName, in ParceledListSlice shortcuts, int userId);

    void requestPinShortcut(String packageName, in ShortcutInfo shortcut,
            in IntentSender resultIntent, int userId, in AndroidFuture<String> ret);
    boolean requestPinShortcut(String packageName, in ShortcutInfo shortcut,
            in IntentSender resultIntent, int userId);

    void createShortcutResultIntent(String packageName, in ShortcutInfo shortcut, int userId,
            in AndroidFuture<Intent> ret);
    Intent createShortcutResultIntent(String packageName, in ShortcutInfo shortcut,
            int userId);

    void disableShortcuts(String packageName, in List<String> shortcutIds,
            CharSequence disabledMessage, int disabledMessageResId, int userId);
+8 −27
Original line number Diff line number Diff line
@@ -464,26 +464,26 @@ public class LauncherApps {
        public static final int FLAG_GET_KEY_FIELDS_ONLY = 1 << 2;

        /**
         * Includes shortcuts from persistence layer in the search result.
         * Populate the persons field in the result. See {@link ShortcutInfo#getPersons()}.
         *
         * <p>The caller should make the query on a worker thread since accessing persistence layer
         * is considered asynchronous.
         * <p>The caller must have the system {@code ACCESS_SHORTCUTS} permission.
         *
         * @hide
         */
        @SystemApi
        public static final int FLAG_GET_PERSISTED_DATA = 1 << 12;
        @RequiresPermission(android.Manifest.permission.ACCESS_SHORTCUTS)
        public static final int FLAG_GET_PERSONS_DATA = 1 << 11;

        /**
         * Populate the persons field in the result. See {@link ShortcutInfo#getPersons()}.
         * Includes shortcuts from persistence layer in the search result.
         *
         * <p>The caller must have the system {@code ACCESS_SHORTCUTS} permission.
         * <p>The caller should make the query on a worker thread since accessing persistence layer
         * is considered asynchronous.
         *
         * @hide
         */
        @SystemApi
        @RequiresPermission(android.Manifest.permission.ACCESS_SHORTCUTS)
        public static final int FLAG_GET_PERSONS_DATA = 1 << 11;
        public static final int FLAG_GET_PERSISTED_DATA = 1 << 12;

        /** @hide */
        @IntDef(flag = true, prefix = { "FLAG_" }, value = {
@@ -1500,9 +1500,6 @@ public class LauncherApps {
            @NonNull UserHandle user) {
        logErrorForInvalidProfileAccess(user);
        try {
            if ((query.mQueryFlags & ShortcutQuery.FLAG_GET_PERSISTED_DATA) != 0) {
                return getShortcutsBlocked(query, user);
            }
            // Note this is the only case we need to update the disabled message for shortcuts
            // that weren't restored.
            // The restore problem messages are only shown by the user, and publishers will never
@@ -1517,22 +1514,6 @@ public class LauncherApps {
        }
    }

    private List<ShortcutInfo> getShortcutsBlocked(@NonNull ShortcutQuery query,
            @NonNull UserHandle user) {
        logErrorForInvalidProfileAccess(user);
        final AndroidFuture<List<ShortcutInfo>> future = new AndroidFuture<>();
        future.thenApply(this::maybeUpdateDisabledMessage);
        try {
            mService.getShortcutsAsync(mContext.getPackageName(),
                            new ShortcutQueryWrapper(query), user, future);
            return future.get();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        } catch (InterruptedException | ExecutionException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * @hide // No longer used.  Use getShortcuts() instead.  Kept for unit tests.
     */
+6 −1
Original line number Diff line number Diff line
@@ -3617,7 +3617,9 @@ public class PackageInstaller {
         * automatically fetched and installed when installing an app that wants to use these
         * dependencies.
         *
         * <p> This feature is enabled by default.
         * <p> This feature is enabled by default. Note that in the case of a multi-package
         * installation session, no dependencies will be automatically installed even if this field
         * is set to true.
         *
         * @param enableAutoInstallDependencies {@code true} to enable auto-installation of missing
         *                                      SDK or static shared library dependencies,
@@ -4574,6 +4576,9 @@ public class PackageInstaller {
         * Check whether missing SDK or static shared library dependencies should be automatically
         * fetched and installed when installing an app that wants to use these dependencies.
         *
         * <p> Note that in the case of a multi-package installation session, no dependencies will
         * be automatically installed even if this method returns true.
         *
         * @return true if the dependencies will be auto-installed, false otherwise.
         */
        @FlaggedApi(Flags.FLAG_SDK_DEPENDENCY_INSTALLER)
+4 −26
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.os.RemoteException;
import android.os.ServiceManager;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.infra.AndroidFuture;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -598,10 +597,8 @@ public class ShortcutManager {
    public boolean requestPinShortcut(@NonNull ShortcutInfo shortcut,
            @Nullable IntentSender resultIntent) {
        try {
            AndroidFuture<String> ret = new AndroidFuture<>();
            mService.requestPinShortcut(mContext.getPackageName(), shortcut, resultIntent,
                    injectMyUserId(), ret);
            return Boolean.parseBoolean(getFutureOrThrow(ret));
            return mService.requestPinShortcut(mContext.getPackageName(), shortcut, resultIntent,
                    injectMyUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -626,11 +623,9 @@ public class ShortcutManager {
     */
    @WorkerThread
    public Intent createShortcutResultIntent(@NonNull ShortcutInfo shortcut) {
        final AndroidFuture<Intent> ret = new AndroidFuture<>();
        try {
            mService.createShortcutResultIntent(mContext.getPackageName(),
                    shortcut, injectMyUserId(), ret);
            Intent result = getFutureOrThrow(ret);
            Intent result = mService.createShortcutResultIntent(mContext.getPackageName(),
                    shortcut, injectMyUserId());
            if (result != null) {
                result.prepareToEnterProcess(LOCAL_FLAG_FROM_SYSTEM,
                        mContext.getAttributionSource());
@@ -793,21 +788,4 @@ public class ShortcutManager {
            throw e.rethrowFromSystemServer();
        }
    }

    private static <T> T getFutureOrThrow(@NonNull AndroidFuture<T> future) {
        try {
            return future.get();
        } catch (Throwable e) {
            if (e instanceof ExecutionException) {
                e = e.getCause();
            }
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            if (e instanceof Error) {
                throw (Error) e;
            }
            throw new RuntimeException(e);
        }
    }
}
Loading