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

Commit c54a97ba authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-11.0.0_r17' into staging/lineage-18.0_merge-android-11.0.0_r17

Android 11.0.0 release 17

* tag 'android-11.0.0_r17':
  Revert "Require permission to create trusted displays"
  [RESTRICT AUTOMERGE]Don't finish noHistory activity while it is on the topmost.
  Add telecom to priorityOnlyDndExemptPackages
  Add screenshot back to power menu for some devices
  Update requested state after applying pending frames
  [RESTRICT AUTOMERGE] Update the visibility of activities on sleeping display
  Sanitize more of the notification text fields
  Accept repeated locale as an input of LocaleList construction.
  Require permission to create trusted displays
  DO NOT MERGE Fix NPE in executeDeletePackageLIF.
  DO NOT MERGE Don't allow non-instant permissions for instant apps.

Change-Id: Iac404b9a5aaac6813d7beae08c69b23e66401d1b
parents f944d159 8551ec36
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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.
@@ -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;
@@ -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) {
+6 −5
Original line number Diff line number Diff line
@@ -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;
@@ -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++) {
@@ -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(',');
@@ -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();
        }
    }
+6 −3
Original line number Diff line number Diff line
@@ -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());
@@ -1150,6 +1149,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
                break;
            }
        }
        if (stateChanged) {
            mHost.notifyInsetsChanged();
            updateRequestedState();
        }
    }

    private void applyLocalVisibilityOverride() {
+2 −0
Original line number Diff line number Diff line
@@ -2775,6 +2775,7 @@
        <item>power</item>
        <item>restart</item>
        <item>logout</item>
        <item>screenshot</item>
        <item>bugreport</item>
    </string-array>

@@ -3478,6 +3479,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>
+15 −0
Original line number Diff line number Diff line
@@ -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;

@@ -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