Loading core/java/android/app/Notification.java +3 −3 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public class Notification implements Parcelable * <p> * Avoids spamming the system with overly large strings such as full e-mails. */ private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024; private static final int MAX_CHARSEQUENCE_LENGTH = 1024; /** * Maximum entries of reply text that are accepted by Builder and friends. Loading Loading @@ -7830,7 +7830,7 @@ public class Notification implements Parcelable */ public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender, boolean remoteInputHistory) { mText = text; mText = safeCharSequence(text); mTimestamp = timestamp; mSender = sender; mRemoteInputHistory = remoteInputHistory; Loading Loading @@ -7944,7 +7944,7 @@ public class Notification implements Parcelable bundle.putLong(KEY_TIMESTAMP, mTimestamp); if (mSender != null) { // Legacy listeners need this bundle.putCharSequence(KEY_SENDER, mSender.getName()); bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName())); bundle.putParcelable(KEY_SENDER_PERSON, mSender); } if (mDataMimeType != null) { Loading core/java/android/os/LocaleList.java +6 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.icu.util.ULocale; import com.android.internal.annotations.GuardedBy; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; Loading Loading @@ -151,18 +152,18 @@ public final class LocaleList implements Parcelable { /** * Creates a new {@link LocaleList}. * * If two or more same locales are passed, the repeated locales will be dropped. * <p>For empty lists of {@link Locale} items it is better to use {@link #getEmptyLocaleList()}, * which returns a pre-constructed empty list.</p> * * @throws NullPointerException if any of the input locales is <code>null</code>. * @throws IllegalArgumentException if any of the input locales repeat. */ public LocaleList(@NonNull Locale... list) { if (list.length == 0) { mList = sEmptyList; mStringRepresentation = ""; } else { final Locale[] localeList = new Locale[list.length]; final ArrayList<Locale> localeList = new ArrayList<>(); final HashSet<Locale> seenLocales = new HashSet<Locale>(); final StringBuilder sb = new StringBuilder(); for (int i = 0; i < list.length; i++) { Loading @@ -170,10 +171,10 @@ public final class LocaleList implements Parcelable { if (l == null) { throw new NullPointerException("list[" + i + "] is null"); } else if (seenLocales.contains(l)) { throw new IllegalArgumentException("list[" + i + "] is a repetition"); // Dropping duplicated locale entries. } else { final Locale localeClone = (Locale) l.clone(); localeList[i] = localeClone; localeList.add(localeClone); sb.append(localeClone.toLanguageTag()); if (i < list.length - 1) { sb.append(','); Loading @@ -181,7 +182,7 @@ public final class LocaleList implements Parcelable { seenLocales.add(localeClone); } } mList = localeList; mList = localeList.toArray(new Locale[localeList.size()]); mStringRepresentation = sb.toString(); } } Loading core/java/android/view/InsetsController.java +6 −3 Original line number Diff line number Diff line Loading @@ -1134,15 +1134,14 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (invokeCallback) { control.cancel(); } boolean stateChanged = false; for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { RunningAnimation runningAnimation = mRunningAnimations.get(i); if (runningAnimation.runner == control) { mRunningAnimations.remove(i); ArraySet<Integer> types = toInternalType(control.getTypes()); for (int j = types.size() - 1; j >= 0; j--) { if (getSourceConsumer(types.valueAt(j)).notifyAnimationFinished()) { mHost.notifyInsetsChanged(); } stateChanged |= getSourceConsumer(types.valueAt(j)).notifyAnimationFinished(); } if (invokeCallback && runningAnimation.startDispatched) { dispatchAnimationEnd(runningAnimation.runner.getAnimation()); Loading @@ -1150,6 +1149,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation break; } } if (stateChanged) { mHost.notifyInsetsChanged(); updateRequestedState(); } } private void applyLocalVisibilityOverride() { Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2792,6 +2792,7 @@ <item>power</item> <item>restart</item> <item>logout</item> <item>screenshot</item> <item>bugreport</item> </string-array> Loading Loading @@ -3506,6 +3507,7 @@ mode --> <string-array translatable="false" name="config_priorityOnlyDndExemptPackages"> <item>com.android.dialer</item> <item>com.android.server.telecom</item> <item>com.android.systemui</item> <item>android</item> </string-array> Loading core/tests/coretests/src/android/view/InsetsControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.navigationBars; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; Loading Loading @@ -742,6 +743,20 @@ public class InsetsControllerTest { mController.onControlsChanged(createSingletonControl(ITYPE_IME)); assertEquals(newState.getSource(ITYPE_IME), mTestHost.getModifiedState().peekSource(ITYPE_IME)); // The modified frames cannot be updated if there is an animation. mController.onControlsChanged(createSingletonControl(ITYPE_NAVIGATION_BAR)); mController.hide(navigationBars()); newState = new InsetsState(mController.getState(), true /* copySource */); newState.getSource(ITYPE_NAVIGATION_BAR).getFrame().top--; mController.onStateChanged(newState); assertNotEquals(newState.getSource(ITYPE_NAVIGATION_BAR), mTestHost.getModifiedState().peekSource(ITYPE_NAVIGATION_BAR)); // The modified frames can be updated while the animation is done. mController.cancelExistingAnimations(); assertEquals(newState.getSource(ITYPE_NAVIGATION_BAR), mTestHost.getModifiedState().peekSource(ITYPE_NAVIGATION_BAR)); }); } Loading Loading
core/java/android/app/Notification.java +3 −3 Original line number Diff line number Diff line Loading @@ -207,7 +207,7 @@ public class Notification implements Parcelable * <p> * Avoids spamming the system with overly large strings such as full e-mails. */ private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024; private static final int MAX_CHARSEQUENCE_LENGTH = 1024; /** * Maximum entries of reply text that are accepted by Builder and friends. Loading Loading @@ -7830,7 +7830,7 @@ public class Notification implements Parcelable */ public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender, boolean remoteInputHistory) { mText = text; mText = safeCharSequence(text); mTimestamp = timestamp; mSender = sender; mRemoteInputHistory = remoteInputHistory; Loading Loading @@ -7944,7 +7944,7 @@ public class Notification implements Parcelable bundle.putLong(KEY_TIMESTAMP, mTimestamp); if (mSender != null) { // Legacy listeners need this bundle.putCharSequence(KEY_SENDER, mSender.getName()); bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName())); bundle.putParcelable(KEY_SENDER_PERSON, mSender); } if (mDataMimeType != null) { Loading
core/java/android/os/LocaleList.java +6 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.icu.util.ULocale; import com.android.internal.annotations.GuardedBy; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; Loading Loading @@ -151,18 +152,18 @@ public final class LocaleList implements Parcelable { /** * Creates a new {@link LocaleList}. * * If two or more same locales are passed, the repeated locales will be dropped. * <p>For empty lists of {@link Locale} items it is better to use {@link #getEmptyLocaleList()}, * which returns a pre-constructed empty list.</p> * * @throws NullPointerException if any of the input locales is <code>null</code>. * @throws IllegalArgumentException if any of the input locales repeat. */ public LocaleList(@NonNull Locale... list) { if (list.length == 0) { mList = sEmptyList; mStringRepresentation = ""; } else { final Locale[] localeList = new Locale[list.length]; final ArrayList<Locale> localeList = new ArrayList<>(); final HashSet<Locale> seenLocales = new HashSet<Locale>(); final StringBuilder sb = new StringBuilder(); for (int i = 0; i < list.length; i++) { Loading @@ -170,10 +171,10 @@ public final class LocaleList implements Parcelable { if (l == null) { throw new NullPointerException("list[" + i + "] is null"); } else if (seenLocales.contains(l)) { throw new IllegalArgumentException("list[" + i + "] is a repetition"); // Dropping duplicated locale entries. } else { final Locale localeClone = (Locale) l.clone(); localeList[i] = localeClone; localeList.add(localeClone); sb.append(localeClone.toLanguageTag()); if (i < list.length - 1) { sb.append(','); Loading @@ -181,7 +182,7 @@ public final class LocaleList implements Parcelable { seenLocales.add(localeClone); } } mList = localeList; mList = localeList.toArray(new Locale[localeList.size()]); mStringRepresentation = sb.toString(); } } Loading
core/java/android/view/InsetsController.java +6 −3 Original line number Diff line number Diff line Loading @@ -1134,15 +1134,14 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (invokeCallback) { control.cancel(); } boolean stateChanged = false; for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { RunningAnimation runningAnimation = mRunningAnimations.get(i); if (runningAnimation.runner == control) { mRunningAnimations.remove(i); ArraySet<Integer> types = toInternalType(control.getTypes()); for (int j = types.size() - 1; j >= 0; j--) { if (getSourceConsumer(types.valueAt(j)).notifyAnimationFinished()) { mHost.notifyInsetsChanged(); } stateChanged |= getSourceConsumer(types.valueAt(j)).notifyAnimationFinished(); } if (invokeCallback && runningAnimation.startDispatched) { dispatchAnimationEnd(runningAnimation.runner.getAnimation()); Loading @@ -1150,6 +1149,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation break; } } if (stateChanged) { mHost.notifyInsetsChanged(); updateRequestedState(); } } private void applyLocalVisibilityOverride() { Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2792,6 +2792,7 @@ <item>power</item> <item>restart</item> <item>logout</item> <item>screenshot</item> <item>bugreport</item> </string-array> Loading Loading @@ -3506,6 +3507,7 @@ mode --> <string-array translatable="false" name="config_priorityOnlyDndExemptPackages"> <item>com.android.dialer</item> <item>com.android.server.telecom</item> <item>com.android.systemui</item> <item>android</item> </string-array> Loading
core/tests/coretests/src/android/view/InsetsControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.navigationBars; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; Loading Loading @@ -742,6 +743,20 @@ public class InsetsControllerTest { mController.onControlsChanged(createSingletonControl(ITYPE_IME)); assertEquals(newState.getSource(ITYPE_IME), mTestHost.getModifiedState().peekSource(ITYPE_IME)); // The modified frames cannot be updated if there is an animation. mController.onControlsChanged(createSingletonControl(ITYPE_NAVIGATION_BAR)); mController.hide(navigationBars()); newState = new InsetsState(mController.getState(), true /* copySource */); newState.getSource(ITYPE_NAVIGATION_BAR).getFrame().top--; mController.onStateChanged(newState); assertNotEquals(newState.getSource(ITYPE_NAVIGATION_BAR), mTestHost.getModifiedState().peekSource(ITYPE_NAVIGATION_BAR)); // The modified frames can be updated while the animation is done. mController.cancelExistingAnimations(); assertEquals(newState.getSource(ITYPE_NAVIGATION_BAR), mTestHost.getModifiedState().peekSource(ITYPE_NAVIGATION_BAR)); }); } Loading