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

Commit 04efe9e5 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Test for ShortcutManager.updateShortcuts(), also" into nyc-dev

parents 69e24384 7a6a05f0
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -160,11 +160,13 @@ public class ShortcutInfo implements Parcelable {
        mIcon = b.mIcon;
        mTitle = b.mTitle;
        mIntent = b.mIntent;
        if (mIntent != null) {
            final Bundle intentExtras = mIntent.getExtras();
            if (intentExtras != null) {
                mIntent.replaceExtras((Bundle) null);
                mIntentPersistableExtras = new PersistableBundle(intentExtras);
            }
        }
        mWeight = b.mWeight;
        mExtras = b.mExtras;
        updateTimestamp();
@@ -194,6 +196,7 @@ public class ShortcutInfo implements Parcelable {

            if ((cloneFlags & CLONE_REMOVE_ICON) == 0) {
                mIcon = source.mIcon;
                mBitmapPath = source.mBitmapPath;
            }

            mTitle = source.mTitle;
@@ -204,8 +207,6 @@ public class ShortcutInfo implements Parcelable {
            mWeight = source.mWeight;
            mExtras = source.mExtras;
            mIconResourceId = source.mIconResourceId;
            mBitmapPath = source.mBitmapPath;

        } else {
            // Set this bit.
            mFlags |= FLAG_KEY_FIELDS_ONLY;
@@ -231,9 +232,9 @@ public class ShortcutInfo implements Parcelable {
     * @hide
     */
    public void copyNonNullFieldsFrom(ShortcutInfo source) {
        Preconditions.checkState(mId == source.mId, "ID must match");
        Preconditions.checkState(mId.equals(source.mId), "ID must match");
        Preconditions.checkState(mPackageName.equals(source.mPackageName),
                "Package namae must match");
                "Package name must match");

        if (source.mActivityComponent != null) {
            mActivityComponent = source.mActivityComponent;
+6 −2
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import android.provider.Settings;
import android.util.Log;
import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.content.PackageMonitor;
import com.android.internal.util.Preconditions;
import com.android.server.LocalServices;
@@ -76,6 +77,7 @@ public class LauncherAppsService extends SystemService {
        publishBinderService(Context.LAUNCHER_APPS_SERVICE, mLauncherAppsImpl);
    }

    @VisibleForTesting
    static class LauncherAppsImpl extends ILauncherApps.Stub {
        private static final boolean DEBUG = false;
        private static final String TAG = "LauncherAppsService";
@@ -167,7 +169,8 @@ public class LauncherAppsService extends SystemService {
        /**
         * Checks if the caller is in the same group as the userToCheck.
         */
        private void ensureInUserProfiles(UserHandle userToCheck, String message) {
        @VisibleForTesting // We override it in unit tests
        void ensureInUserProfiles(UserHandle userToCheck, String message) {
            final int callingUserId = UserHandle.getCallingUserId();
            final int targetUserId = userToCheck.getIdentifier();

@@ -187,7 +190,8 @@ public class LauncherAppsService extends SystemService {
            }
        }

        private void verifyCallingPackage(String callingPackage) {
        @VisibleForTesting // We override it in unit tests
        void verifyCallingPackage(String callingPackage) {
            int packageUid = -1;
            try {
                packageUid = mPm.getPackageUid(callingPackage,
+291 −93

File changed.

Preview size limit exceeded, changes collapsed.