Loading core/java/android/content/pm/ShortcutInfo.java +9 −8 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -194,6 +196,7 @@ public class ShortcutInfo implements Parcelable { if ((cloneFlags & CLONE_REMOVE_ICON) == 0) { mIcon = source.mIcon; mBitmapPath = source.mBitmapPath; } mTitle = source.mTitle; Loading @@ -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; Loading @@ -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; Loading services/core/java/com/android/server/pm/LauncherAppsService.java +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"; Loading Loading @@ -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(); Loading @@ -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, Loading services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java +291 −93 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/content/pm/ShortcutInfo.java +9 −8 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -194,6 +196,7 @@ public class ShortcutInfo implements Parcelable { if ((cloneFlags & CLONE_REMOVE_ICON) == 0) { mIcon = source.mIcon; mBitmapPath = source.mBitmapPath; } mTitle = source.mTitle; Loading @@ -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; Loading @@ -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; Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"; Loading Loading @@ -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(); Loading @@ -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, Loading
services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest.java +291 −93 File changed.Preview size limit exceeded, changes collapsed. Show changes