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

Commit 296c855c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10054401 from 3e892962 to udc-qpr1-release

Change-Id: I073bfd111dfb0cabbf896c2dfb0fdc07974496b2
parents b3460cf3 3e892962
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -58,8 +58,9 @@ oneway interface IUidObserver {
     * Report a proc oom adj change associated with a uid.
     *
     * @param uid The uid for which the state change is being reported.
     * @param adj The minimum OOM adj among all processes with this uid.
     */
    void onUidProcAdjChanged(int uid);
    void onUidProcAdjChanged(int uid, int adj);

    // =============== End of transactions used on native side as well ============================

+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public class UidObserver extends IUidObserver.Stub {
    }

    @Override
    public void onUidProcAdjChanged(int uid) {
    public void onUidProcAdjChanged(int uid, int adj) {
    }

    @Override
+0 −33
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ import android.util.Log;
import android.view.WindowManager.LayoutParams;

import com.android.internal.R;
import com.android.internal.util.FrameworkStatsLog;

import java.io.IOException;
import java.lang.annotation.Retention;
@@ -2532,38 +2531,6 @@ public class UserManager {
        return USER_TYPE_PROFILE_CLONE.equals(userType);
    }

    /**
     * Returns the enum defined in the statsd UserLifecycleJourneyReported atom corresponding to the
     * user type.
     * @hide
     */
    public static int getUserTypeForStatsd(@NonNull String userType) {
        switch (userType) {
            case USER_TYPE_FULL_SYSTEM:
                return FrameworkStatsLog.USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__FULL_SYSTEM;
            case USER_TYPE_FULL_SECONDARY:
                return FrameworkStatsLog.USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__FULL_SECONDARY;
            case USER_TYPE_FULL_GUEST:
                return FrameworkStatsLog.USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__FULL_GUEST;
            case USER_TYPE_FULL_DEMO:
                return FrameworkStatsLog.USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__FULL_DEMO;
            case USER_TYPE_FULL_RESTRICTED:
                return FrameworkStatsLog
                        .USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__FULL_RESTRICTED;
            case USER_TYPE_PROFILE_MANAGED:
                return FrameworkStatsLog
                        .USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__PROFILE_MANAGED;
            case USER_TYPE_SYSTEM_HEADLESS:
                return FrameworkStatsLog
                        .USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__SYSTEM_HEADLESS;
            case USER_TYPE_PROFILE_CLONE:
                return FrameworkStatsLog
                        .USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__PROFILE_CLONE;
            default:
                return FrameworkStatsLog.USER_LIFECYCLE_JOURNEY_REPORTED__USER_TYPE__TYPE_UNKNOWN;
        }
    }

    /**
     * @hide
     * @deprecated Use {@link #isRestrictedProfile()}
+26 −33
Original line number Diff line number Diff line
@@ -62,9 +62,7 @@ public class InsetsFrameProvider implements Parcelable {
     */
    public static final int SOURCE_ARBITRARY_RECTANGLE = 3;

    private final IBinder mOwner;
    private final int mIndex;
    private final @InsetsType int mType;
    private final int mId;

    /**
     * The selection of the starting rectangle to be converted into source frame.
@@ -122,30 +120,30 @@ public class InsetsFrameProvider implements Parcelable {
     * @param type the {@link InsetsType}.
     * @see InsetsSource#createId(Object, int, int)
     */
    public InsetsFrameProvider(IBinder owner, @IntRange(from = 0, to = 2047) int index,
    public InsetsFrameProvider(Object owner, @IntRange(from = 0, to = 2047) int index,
            @InsetsType int type) {
        if (index < 0 || index >= 2048) {
            throw new IllegalArgumentException();
        mId = InsetsSource.createId(owner, index, type);
    }

        // This throws IllegalArgumentException if the type is not valid.
        WindowInsets.Type.indexOf(type);

        mOwner = owner;
        mIndex = index;
        mType = type;
    }

    public IBinder getOwner() {
        return mOwner;
    /**
     * Returns an unique integer which identifies the insets source.
     */
    public int getId() {
        return mId;
    }

    /**
     * Returns the index specified in {@link #InsetsFrameProvider(IBinder, int, int)}.
     */
    public int getIndex() {
        return mIndex;
        return InsetsSource.getIndex(mId);
    }

    /**
     * Returns the {@link InsetsType} specified in {@link #InsetsFrameProvider(IBinder, int, int)}.
     */
    public int getType() {
        return mType;
        return InsetsSource.getType(mId);
    }

    public InsetsFrameProvider setSource(int source) {
@@ -211,9 +209,9 @@ public class InsetsFrameProvider implements Parcelable {
    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("InsetsFrameProvider: {");
        sb.append("owner=").append(mOwner);
        sb.append(", index=").append(mIndex);
        sb.append(", type=").append(WindowInsets.Type.toString(mType));
        sb.append("id=#").append(Integer.toHexString(mId));
        sb.append(", index=").append(getIndex());
        sb.append(", type=").append(WindowInsets.Type.toString(getType()));
        sb.append(", source=").append(sourceToString(mSource));
        sb.append(", flags=[").append(InsetsSource.flagsToString(mFlags)).append("]");
        if (mInsetsSize != null) {
@@ -244,9 +242,7 @@ public class InsetsFrameProvider implements Parcelable {
    }

    public InsetsFrameProvider(Parcel in) {
        mOwner = in.readStrongBinder();
        mIndex = in.readInt();
        mType = in.readInt();
        mId = in.readInt();
        mSource = in.readInt();
        mFlags = in.readInt();
        mInsetsSize = in.readTypedObject(Insets.CREATOR);
@@ -256,9 +252,7 @@ public class InsetsFrameProvider implements Parcelable {

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeStrongBinder(mOwner);
        out.writeInt(mIndex);
        out.writeInt(mType);
        out.writeInt(mId);
        out.writeInt(mSource);
        out.writeInt(mFlags);
        out.writeTypedObject(mInsetsSize, flags);
@@ -267,7 +261,7 @@ public class InsetsFrameProvider implements Parcelable {
    }

    public boolean idEquals(InsetsFrameProvider o) {
        return Objects.equals(mOwner, o.mOwner) && mIndex == o.mIndex && mType == o.mType;
        return mId == o.mId;
    }

    @Override
@@ -279,8 +273,7 @@ public class InsetsFrameProvider implements Parcelable {
            return false;
        }
        final InsetsFrameProvider other = (InsetsFrameProvider) o;
        return Objects.equals(mOwner, other.mOwner) && mIndex == other.mIndex
                && mType == other.mType && mSource == other.mSource && mFlags == other.mFlags
        return mId == other.mId && mSource == other.mSource && mFlags == other.mFlags
                && Objects.equals(mInsetsSize, other.mInsetsSize)
                && Arrays.equals(mInsetsSizeOverrides, other.mInsetsSizeOverrides)
                && Objects.equals(mArbitraryRectangle, other.mArbitraryRectangle);
@@ -288,7 +281,7 @@ public class InsetsFrameProvider implements Parcelable {

    @Override
    public int hashCode() {
        return Objects.hash(mOwner, mIndex, mType, mSource, mFlags, mInsetsSize,
        return Objects.hash(mId, mSource, mFlags, mInsetsSize,
                Arrays.hashCode(mInsetsSizeOverrides), mArbitraryRectangle);
    }

@@ -319,7 +312,7 @@ public class InsetsFrameProvider implements Parcelable {

        protected InsetsSizeOverride(Parcel in) {
            mWindowType = in.readInt();
            mInsetsSize = in.readParcelable(null, Insets.class);
            mInsetsSize = in.readTypedObject(Insets.CREATOR);
        }

        public InsetsSizeOverride(int windowType, Insets insetsSize) {
@@ -354,7 +347,7 @@ public class InsetsFrameProvider implements Parcelable {
        @Override
        public void writeToParcel(Parcel out, int flags) {
            out.writeInt(mWindowType);
            out.writeParcelable(mInsetsSize, flags);
            out.writeTypedObject(mInsetsSize, flags);
        }

        @Override
+20 −2
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ public class InsetsSource implements Parcelable {
     * @param index An owner may have multiple sources with the same type. For example, the system
     *              server might have multiple display cutout sources. This is used to identify
     *              which one is which. The value must be in a range of [0, 2047].
     * @param type The {@link WindowInsets.Type.InsetsType type} of the source.
     * @param type The {@link InsetsType type} of the source.
     * @return a unique integer as the identifier.
     */
    public static int createId(Object owner, @IntRange(from = 0, to = 2047) int index,
@@ -282,11 +282,29 @@ public class InsetsSource implements Parcelable {
        // owner takes top 16 bits;
        // index takes 11 bits since the 6th bit;
        // type takes bottom 5 bits.
        return (((owner != null ? owner.hashCode() : 1) % (1 << 16)) << 16)
        return ((System.identityHashCode(owner) % (1 << 16)) << 16)
                + (index << 5)
                + WindowInsets.Type.indexOf(type);
    }

    /**
     * Gets the index from the ID.
     *
     * @see #createId(Object, int, int)
     */
    public static int getIndex(int id) {
        return (id % (1 << 16)) >> 5;
    }

    /**
     * Gets the {@link InsetsType} from the ID.
     *
     * @see #createId(Object, int, int)
     */
    public static int getType(int id) {
        return 1 << (id % 32);
    }

    public static String flagsToString(@Flags int flags) {
        final StringJoiner joiner = new StringJoiner(" ");
        if ((flags & FLAG_SUPPRESS_SCRIM) != 0) {
Loading