Loading core/java/android/app/Activity.java +3 −0 Original line number Diff line number Diff line Loading @@ -5580,6 +5580,9 @@ public class Activity extends ContextThemeWrapper if (mParent != null) { throw new IllegalStateException("Can only be called on top-level activity"); } if (Looper.myLooper() != mMainThread.getLooper()) { throw new IllegalStateException("Must be called from main thread"); } mMainThread.scheduleRelaunchActivity(mToken); } Loading core/java/android/app/AppOpsManager.java +10 −4 Original line number Diff line number Diff line Loading @@ -155,6 +155,12 @@ public class AppOpsManager { */ public static final int UID_STATE_FOREGROUND_SERVICE = 2; /** * Last UID state in which we don't restrict what an op can do. * @hide */ public static final int UID_STATE_LAST_NON_RESTRICTED = UID_STATE_FOREGROUND_SERVICE; /** * Metrics about an op when its uid is in the foreground for any other reasons. * @hide Loading Loading @@ -1594,11 +1600,11 @@ public class AppOpsManager { } public long getLastAccessForegroundTime() { return maxTime(mTimes, UID_STATE_PERSISTENT, UID_STATE_FOREGROUND_SERVICE + 1); return maxTime(mTimes, UID_STATE_PERSISTENT, UID_STATE_LAST_NON_RESTRICTED + 1); } public long getLastAccessBackgroundTime() { return maxTime(mTimes, UID_STATE_FOREGROUND_SERVICE + 1, _NUM_UID_STATE); return maxTime(mTimes, UID_STATE_LAST_NON_RESTRICTED + 1, _NUM_UID_STATE); } public long getLastTimeFor(int uidState) { Loading @@ -1614,11 +1620,11 @@ public class AppOpsManager { } public long getLastRejectForegroundTime() { return maxTime(mRejectTimes, UID_STATE_PERSISTENT, UID_STATE_FOREGROUND_SERVICE + 1); return maxTime(mRejectTimes, UID_STATE_PERSISTENT, UID_STATE_LAST_NON_RESTRICTED + 1); } public long getLastRejectBackgroundTime() { return maxTime(mRejectTimes, UID_STATE_FOREGROUND_SERVICE + 1, _NUM_UID_STATE); return maxTime(mRejectTimes, UID_STATE_LAST_NON_RESTRICTED + 1, _NUM_UID_STATE); } public long getLastRejectTimeFor(int uidState) { Loading core/java/android/app/Notification.java +45 −12 Original line number Diff line number Diff line Loading @@ -6374,6 +6374,8 @@ public class Notification implements Parcelable /** * @hide * Note that we aren't actually comparing the contents of the bitmaps here, so this * is only doing a cursory inspection. Bitmaps of equal size will appear the same. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6381,7 +6383,20 @@ public class Notification implements Parcelable return true; } BigPictureStyle otherS = (BigPictureStyle) other; return !Objects.equals(getBigPicture(), otherS.getBigPicture()); return areBitmapsObviouslyDifferent(getBigPicture(), otherS.getBigPicture()); } private static boolean areBitmapsObviouslyDifferent(Bitmap a, Bitmap b) { if (a == b) { return false; } if (a == null || b == null) { return true; } return a.getWidth() != b.getWidth() || a.getHeight() != b.getHeight() || a.getConfig() != b.getConfig() || a.getGenerationId() != b.getGenerationId(); } } Loading Loading @@ -6526,6 +6541,7 @@ public class Notification implements Parcelable /** * @hide * Spans are ignored when comparing text for visual difference. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6533,7 +6549,7 @@ public class Notification implements Parcelable return true; } BigTextStyle newS = (BigTextStyle) other; return !Objects.equals(getBigText(), newS.getBigText()); return !Objects.equals(String.valueOf(getBigText()), String.valueOf(newS.getBigText())); } static void applyBigTextContentView(Builder builder, Loading Loading @@ -6900,6 +6916,7 @@ public class Notification implements Parcelable /** * @hide * Spans are ignored when comparing text for visual difference. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6910,10 +6927,7 @@ public class Notification implements Parcelable List<MessagingStyle.Message> oldMs = getMessages(); List<MessagingStyle.Message> newMs = newS.getMessages(); if (oldMs == null) { oldMs = new ArrayList<>(); } if (newMs == null) { if (oldMs == null || newMs == null) { newMs = new ArrayList<>(); } Loading @@ -6924,16 +6938,20 @@ public class Notification implements Parcelable for (int i = 0; i < n; i++) { MessagingStyle.Message oldM = oldMs.get(i); MessagingStyle.Message newM = newMs.get(i); if (!Objects.equals(oldM.getText(), newM.getText())) { if (!Objects.equals( String.valueOf(oldM.getText()), String.valueOf(newM.getText()))) { return true; } if (!Objects.equals(oldM.getDataUri(), newM.getDataUri())) { return true; } CharSequence oldSender = oldM.getSenderPerson() == null ? oldM.getSender() : oldM.getSenderPerson().getName(); CharSequence newSender = newM.getSenderPerson() == null ? newM.getSender() : newM.getSenderPerson().getName(); String oldSender = String.valueOf(oldM.getSenderPerson() == null ? oldM.getSender() : oldM.getSenderPerson().getName()); String newSender = String.valueOf(newM.getSenderPerson() == null ? newM.getSender() : newM.getSenderPerson().getName()); if (!Objects.equals(oldSender, newSender)) { return true; } Loading Loading @@ -7533,7 +7551,22 @@ public class Notification implements Parcelable return true; } InboxStyle newS = (InboxStyle) other; return !Objects.equals(getLines(), newS.getLines()); final ArrayList<CharSequence> myLines = getLines(); final ArrayList<CharSequence> newLines = newS.getLines(); final int n = myLines.size(); if (n != newLines.size()) { return true; } for (int i = 0; i < n; i++) { if (!Objects.equals( String.valueOf(myLines.get(i)), String.valueOf(newLines.get(i)))) { return true; } } return false; } private void handleInboxImageMargin(RemoteViews contentView, int id, boolean first, Loading core/java/android/app/slice/Slice.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.ArrayUtils; import com.android.internal.util.Preconditions; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -427,6 +428,7 @@ public final class Slice implements Parcelable { * @see {@link SliceItem#getSubType()} */ public Builder addSubSlice(@NonNull Slice slice, @Nullable @SliceSubtype String subType) { Preconditions.checkNotNull(slice); mItems.add(new SliceItem(slice, SliceItem.FORMAT_SLICE, subType, slice.getHints().toArray(new String[slice.getHints().size()]))); return this; Loading @@ -439,6 +441,8 @@ public final class Slice implements Parcelable { */ public Slice.Builder addAction(@NonNull PendingIntent action, @NonNull Slice s, @Nullable @SliceSubtype String subType) { Preconditions.checkNotNull(action); Preconditions.checkNotNull(s); List<String> hints = s.getHints(); s.mSpec = null; mItems.add(new SliceItem(action, s, SliceItem.FORMAT_ACTION, subType, hints.toArray( Loading @@ -464,6 +468,7 @@ public final class Slice implements Parcelable { */ public Builder addIcon(Icon icon, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(icon); mItems.add(new SliceItem(icon, SliceItem.FORMAT_IMAGE, subType, hints)); return this; } Loading @@ -476,6 +481,7 @@ public final class Slice implements Parcelable { public Slice.Builder addRemoteInput(RemoteInput remoteInput, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(remoteInput); mItems.add(new SliceItem(remoteInput, SliceItem.FORMAT_REMOTE_INPUT, subType, hints)); return this; Loading Loading @@ -523,6 +529,7 @@ public final class Slice implements Parcelable { */ public Slice.Builder addBundle(Bundle bundle, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(bundle); mItems.add(new SliceItem(bundle, SliceItem.FORMAT_BUNDLE, subType, hints)); return this; Loading core/java/android/content/Intent.java +20 −0 Original line number Diff line number Diff line Loading @@ -3986,6 +3986,26 @@ public class Intent implements Parcelable, Cloneable { */ public static final int EXTRA_THERMAL_STATE_EXCEEDED = 2; /** * Broadcast Action: Indicates the dock in idle state while device is docked. * * <p class="note">This is a protected intent that can only be sent * by the system. * * @hide */ public static final String ACTION_DOCK_IDLE = "android.intent.action.DOCK_IDLE"; /** * Broadcast Action: Indicates the dock in active state while device is docked. * * <p class="note">This is a protected intent that can only be sent * by the system. * * @hide */ public static final String ACTION_DOCK_ACTIVE = "android.intent.action.DOCK_ACTIVE"; // --------------------------------------------------------------------- // --------------------------------------------------------------------- Loading Loading
core/java/android/app/Activity.java +3 −0 Original line number Diff line number Diff line Loading @@ -5580,6 +5580,9 @@ public class Activity extends ContextThemeWrapper if (mParent != null) { throw new IllegalStateException("Can only be called on top-level activity"); } if (Looper.myLooper() != mMainThread.getLooper()) { throw new IllegalStateException("Must be called from main thread"); } mMainThread.scheduleRelaunchActivity(mToken); } Loading
core/java/android/app/AppOpsManager.java +10 −4 Original line number Diff line number Diff line Loading @@ -155,6 +155,12 @@ public class AppOpsManager { */ public static final int UID_STATE_FOREGROUND_SERVICE = 2; /** * Last UID state in which we don't restrict what an op can do. * @hide */ public static final int UID_STATE_LAST_NON_RESTRICTED = UID_STATE_FOREGROUND_SERVICE; /** * Metrics about an op when its uid is in the foreground for any other reasons. * @hide Loading Loading @@ -1594,11 +1600,11 @@ public class AppOpsManager { } public long getLastAccessForegroundTime() { return maxTime(mTimes, UID_STATE_PERSISTENT, UID_STATE_FOREGROUND_SERVICE + 1); return maxTime(mTimes, UID_STATE_PERSISTENT, UID_STATE_LAST_NON_RESTRICTED + 1); } public long getLastAccessBackgroundTime() { return maxTime(mTimes, UID_STATE_FOREGROUND_SERVICE + 1, _NUM_UID_STATE); return maxTime(mTimes, UID_STATE_LAST_NON_RESTRICTED + 1, _NUM_UID_STATE); } public long getLastTimeFor(int uidState) { Loading @@ -1614,11 +1620,11 @@ public class AppOpsManager { } public long getLastRejectForegroundTime() { return maxTime(mRejectTimes, UID_STATE_PERSISTENT, UID_STATE_FOREGROUND_SERVICE + 1); return maxTime(mRejectTimes, UID_STATE_PERSISTENT, UID_STATE_LAST_NON_RESTRICTED + 1); } public long getLastRejectBackgroundTime() { return maxTime(mRejectTimes, UID_STATE_FOREGROUND_SERVICE + 1, _NUM_UID_STATE); return maxTime(mRejectTimes, UID_STATE_LAST_NON_RESTRICTED + 1, _NUM_UID_STATE); } public long getLastRejectTimeFor(int uidState) { Loading
core/java/android/app/Notification.java +45 −12 Original line number Diff line number Diff line Loading @@ -6374,6 +6374,8 @@ public class Notification implements Parcelable /** * @hide * Note that we aren't actually comparing the contents of the bitmaps here, so this * is only doing a cursory inspection. Bitmaps of equal size will appear the same. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6381,7 +6383,20 @@ public class Notification implements Parcelable return true; } BigPictureStyle otherS = (BigPictureStyle) other; return !Objects.equals(getBigPicture(), otherS.getBigPicture()); return areBitmapsObviouslyDifferent(getBigPicture(), otherS.getBigPicture()); } private static boolean areBitmapsObviouslyDifferent(Bitmap a, Bitmap b) { if (a == b) { return false; } if (a == null || b == null) { return true; } return a.getWidth() != b.getWidth() || a.getHeight() != b.getHeight() || a.getConfig() != b.getConfig() || a.getGenerationId() != b.getGenerationId(); } } Loading Loading @@ -6526,6 +6541,7 @@ public class Notification implements Parcelable /** * @hide * Spans are ignored when comparing text for visual difference. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6533,7 +6549,7 @@ public class Notification implements Parcelable return true; } BigTextStyle newS = (BigTextStyle) other; return !Objects.equals(getBigText(), newS.getBigText()); return !Objects.equals(String.valueOf(getBigText()), String.valueOf(newS.getBigText())); } static void applyBigTextContentView(Builder builder, Loading Loading @@ -6900,6 +6916,7 @@ public class Notification implements Parcelable /** * @hide * Spans are ignored when comparing text for visual difference. */ @Override public boolean areNotificationsVisiblyDifferent(Style other) { Loading @@ -6910,10 +6927,7 @@ public class Notification implements Parcelable List<MessagingStyle.Message> oldMs = getMessages(); List<MessagingStyle.Message> newMs = newS.getMessages(); if (oldMs == null) { oldMs = new ArrayList<>(); } if (newMs == null) { if (oldMs == null || newMs == null) { newMs = new ArrayList<>(); } Loading @@ -6924,16 +6938,20 @@ public class Notification implements Parcelable for (int i = 0; i < n; i++) { MessagingStyle.Message oldM = oldMs.get(i); MessagingStyle.Message newM = newMs.get(i); if (!Objects.equals(oldM.getText(), newM.getText())) { if (!Objects.equals( String.valueOf(oldM.getText()), String.valueOf(newM.getText()))) { return true; } if (!Objects.equals(oldM.getDataUri(), newM.getDataUri())) { return true; } CharSequence oldSender = oldM.getSenderPerson() == null ? oldM.getSender() : oldM.getSenderPerson().getName(); CharSequence newSender = newM.getSenderPerson() == null ? newM.getSender() : newM.getSenderPerson().getName(); String oldSender = String.valueOf(oldM.getSenderPerson() == null ? oldM.getSender() : oldM.getSenderPerson().getName()); String newSender = String.valueOf(newM.getSenderPerson() == null ? newM.getSender() : newM.getSenderPerson().getName()); if (!Objects.equals(oldSender, newSender)) { return true; } Loading Loading @@ -7533,7 +7551,22 @@ public class Notification implements Parcelable return true; } InboxStyle newS = (InboxStyle) other; return !Objects.equals(getLines(), newS.getLines()); final ArrayList<CharSequence> myLines = getLines(); final ArrayList<CharSequence> newLines = newS.getLines(); final int n = myLines.size(); if (n != newLines.size()) { return true; } for (int i = 0; i < n; i++) { if (!Objects.equals( String.valueOf(myLines.get(i)), String.valueOf(newLines.get(i)))) { return true; } } return false; } private void handleInboxImageMargin(RemoteViews contentView, int id, boolean first, Loading
core/java/android/app/slice/Slice.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.Parcel; import android.os.Parcelable; import com.android.internal.util.ArrayUtils; import com.android.internal.util.Preconditions; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -427,6 +428,7 @@ public final class Slice implements Parcelable { * @see {@link SliceItem#getSubType()} */ public Builder addSubSlice(@NonNull Slice slice, @Nullable @SliceSubtype String subType) { Preconditions.checkNotNull(slice); mItems.add(new SliceItem(slice, SliceItem.FORMAT_SLICE, subType, slice.getHints().toArray(new String[slice.getHints().size()]))); return this; Loading @@ -439,6 +441,8 @@ public final class Slice implements Parcelable { */ public Slice.Builder addAction(@NonNull PendingIntent action, @NonNull Slice s, @Nullable @SliceSubtype String subType) { Preconditions.checkNotNull(action); Preconditions.checkNotNull(s); List<String> hints = s.getHints(); s.mSpec = null; mItems.add(new SliceItem(action, s, SliceItem.FORMAT_ACTION, subType, hints.toArray( Loading @@ -464,6 +468,7 @@ public final class Slice implements Parcelable { */ public Builder addIcon(Icon icon, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(icon); mItems.add(new SliceItem(icon, SliceItem.FORMAT_IMAGE, subType, hints)); return this; } Loading @@ -476,6 +481,7 @@ public final class Slice implements Parcelable { public Slice.Builder addRemoteInput(RemoteInput remoteInput, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(remoteInput); mItems.add(new SliceItem(remoteInput, SliceItem.FORMAT_REMOTE_INPUT, subType, hints)); return this; Loading Loading @@ -523,6 +529,7 @@ public final class Slice implements Parcelable { */ public Slice.Builder addBundle(Bundle bundle, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { Preconditions.checkNotNull(bundle); mItems.add(new SliceItem(bundle, SliceItem.FORMAT_BUNDLE, subType, hints)); return this; Loading
core/java/android/content/Intent.java +20 −0 Original line number Diff line number Diff line Loading @@ -3986,6 +3986,26 @@ public class Intent implements Parcelable, Cloneable { */ public static final int EXTRA_THERMAL_STATE_EXCEEDED = 2; /** * Broadcast Action: Indicates the dock in idle state while device is docked. * * <p class="note">This is a protected intent that can only be sent * by the system. * * @hide */ public static final String ACTION_DOCK_IDLE = "android.intent.action.DOCK_IDLE"; /** * Broadcast Action: Indicates the dock in active state while device is docked. * * <p class="note">This is a protected intent that can only be sent * by the system. * * @hide */ public static final String ACTION_DOCK_ACTIVE = "android.intent.action.DOCK_ACTIVE"; // --------------------------------------------------------------------- // --------------------------------------------------------------------- Loading