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

Commit 37983da6 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9760407 from 5ac43d6f to tm-qpr3-release

Change-Id: Iecf0f862089b7aea0c91e154fd98cad52daa772c
parents adeb1840 5ac43d6f
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.Trace;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
@@ -1006,7 +1007,8 @@ public final class DisplayManagerGlobal {
        @Override
        public void onDisplayEvent(int displayId, @DisplayEvent int event) {
            if (DEBUG) {
                Log.d(TAG, "onDisplayEvent: displayId=" + displayId + ", event=" + event);
                Log.d(TAG, "onDisplayEvent: displayId=" + displayId + ", event=" + eventToString(
                        event));
            }
            handleDisplayEvent(displayId, event);
        }
@@ -1040,6 +1042,12 @@ public final class DisplayManagerGlobal {

        @Override
        public void handleMessage(Message msg) {
            if (DEBUG) {
                Trace.beginSection(
                        "DisplayListenerDelegate(" + eventToString(msg.what)
                                + ", display=" + msg.arg1
                                + ", listener=" + mListener.getClass() + ")");
            }
            switch (msg.what) {
                case EVENT_DISPLAY_ADDED:
                    if ((mEventsMask & DisplayManager.EVENT_FLAG_DISPLAY_ADDED) != 0) {
@@ -1066,6 +1074,9 @@ public final class DisplayManagerGlobal {
                    }
                    break;
            }
            if (DEBUG) {
                Trace.endSection();
            }
        }
    }

@@ -1172,4 +1183,18 @@ public final class DisplayManagerGlobal {
            updateCallbackIfNeededLocked();
        }
    }

    private static String eventToString(@DisplayEvent int event) {
        switch (event) {
            case EVENT_DISPLAY_ADDED:
                return "ADDED";
            case EVENT_DISPLAY_CHANGED:
                return "CHANGED";
            case EVENT_DISPLAY_REMOVED:
                return "REMOVED";
            case EVENT_DISPLAY_BRIGHTNESS_CHANGED:
                return "BRIGHTNESS_CHANGED";
        }
        return "UNKNOWN";
    }
}
+30 −5
Original line number Diff line number Diff line
@@ -10997,21 +10997,46 @@ public final class Settings {
        public @interface DeviceStateRotationLockSetting {
        }
        /** @hide */
        public static final int DEVICE_STATE_ROTATION_KEY_UNKNOWN = -1;
        /** @hide */
        public static final int DEVICE_STATE_ROTATION_KEY_FOLDED = 0;
        /** @hide */
        public static final int DEVICE_STATE_ROTATION_KEY_HALF_FOLDED = 1;
        /** @hide */
        public static final int DEVICE_STATE_ROTATION_KEY_UNFOLDED = 2;
        /**
         * The different postures that can be used as keys with
         * {@link #DEVICE_STATE_ROTATION_LOCK}.
         * @hide
         */
        @IntDef(prefix = {"DEVICE_STATE_ROTATION_KEY_"}, value = {
                DEVICE_STATE_ROTATION_KEY_UNKNOWN,
                DEVICE_STATE_ROTATION_KEY_FOLDED,
                DEVICE_STATE_ROTATION_KEY_HALF_FOLDED,
                DEVICE_STATE_ROTATION_KEY_UNFOLDED,
        })
        @Retention(RetentionPolicy.SOURCE)
        public @interface DeviceStateRotationLockKey {
        }
        /**
         * Rotation lock setting keyed on device state.
         *
         * This holds a serialized map using int keys that represent Device States and value of
         * This holds a serialized map using int keys that represent postures in
         * {@link DeviceStateRotationLockKey} and value of
         * {@link DeviceStateRotationLockSetting} representing the rotation lock setting for that
         * device state.
         * posture.
         *
         * Serialized as key0:value0:key1:value1:...:keyN:valueN.
         *
         * Example: "0:1:1:2:2:1"
         * This example represents a map of:
         * <ul>
         *     <li>0 -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li>
         *     <li>1 -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li>
         *     <li>2 -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li>
         *     <li>DEVICE_STATE_ROTATION_KEY_FOLDED -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li>
         *     <li>DEVICE_STATE_ROTATION_KEY_HALF_FOLDED -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li>
         *     <li>DEVICE_STATE_ROTATION_KEY_UNFOLDED -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li>
         * </ul>
         *
         * @hide
+15 −0
Original line number Diff line number Diff line
@@ -1599,6 +1599,21 @@ public final class Display {
        }
    }

    /**
     * Returns the committed state of the display.
     *
     * @return The latest committed display state, such as {@link #STATE_ON}. The display state
     * {@link Display#getState()} is set as committed only after power state changes finish.
     *
     * @hide
     */
    public int getCommittedState() {
        synchronized (mLock) {
            updateDisplayInfoLocked();
            return mIsValid ? mDisplayInfo.committedState : STATE_UNKNOWN;
        }
    }

    /**
     * Returns true if the specified UID has access to this display.
     * @hide
+12 −0
Original line number Diff line number Diff line
@@ -252,6 +252,12 @@ public final class DisplayInfo implements Parcelable {
     */
    public int state;

    /**
     * The current committed state of the display. For example, this becomes
     * {@link android.view.Display#STATE_ON} only after the power state ON is fully committed.
     */
    public int committedState;

    /**
     * The UID of the application that owns this display, or zero if it is owned by the system.
     * <p>
@@ -380,6 +386,7 @@ public final class DisplayInfo implements Parcelable {
                && appVsyncOffsetNanos == other.appVsyncOffsetNanos
                && presentationDeadlineNanos == other.presentationDeadlineNanos
                && state == other.state
                && committedState == other.committedState
                && ownerUid == other.ownerUid
                && Objects.equals(ownerPackageName, other.ownerPackageName)
                && removeMode == other.removeMode
@@ -431,6 +438,7 @@ public final class DisplayInfo implements Parcelable {
        appVsyncOffsetNanos = other.appVsyncOffsetNanos;
        presentationDeadlineNanos = other.presentationDeadlineNanos;
        state = other.state;
        committedState = other.committedState;
        ownerUid = other.ownerUid;
        ownerPackageName = other.ownerPackageName;
        removeMode = other.removeMode;
@@ -482,6 +490,7 @@ public final class DisplayInfo implements Parcelable {
        appVsyncOffsetNanos = source.readLong();
        presentationDeadlineNanos = source.readLong();
        state = source.readInt();
        committedState = source.readInt();
        ownerUid = source.readInt();
        ownerPackageName = source.readString8();
        uniqueId = source.readString8();
@@ -538,6 +547,7 @@ public final class DisplayInfo implements Parcelable {
        dest.writeLong(appVsyncOffsetNanos);
        dest.writeLong(presentationDeadlineNanos);
        dest.writeInt(state);
        dest.writeInt(committedState);
        dest.writeInt(ownerUid);
        dest.writeString8(ownerPackageName);
        dest.writeString8(uniqueId);
@@ -761,6 +771,8 @@ public final class DisplayInfo implements Parcelable {
        sb.append(rotation);
        sb.append(", state ");
        sb.append(Display.stateToString(state));
        sb.append(", committedState ");
        sb.append(Display.stateToString(committedState));

        if (Process.myUid() != Process.SYSTEM_UID) {
            sb.append("}");
+1 −1
Original line number Diff line number Diff line
@@ -1910,7 +1910,7 @@
    <string name="usb_midi_peripheral_manufacturer_name" msgid="7557148557088787741">"Android"</string>
    <string name="usb_midi_peripheral_product_name" msgid="2836276258480904434">"Port perifèric USB"</string>
    <string name="floating_toolbar_open_overflow_description" msgid="2260297653578167367">"Més opcions"</string>
    <string name="floating_toolbar_close_overflow_description" msgid="3949818077708138098">"Tanca el menú addicional"</string>
    <string name="floating_toolbar_close_overflow_description" msgid="3949818077708138098">"Tanca el menú de desbordament"</string>
    <string name="maximize_button_text" msgid="4258922519914732645">"Maximitza"</string>
    <string name="close_button_text" msgid="10603510034455258">"Tanca"</string>
    <string name="notification_messaging_title_template" msgid="772857526770251989">"<xliff:g id="CONVERSATION_TITLE">%1$s</xliff:g>: <xliff:g id="SENDER_NAME">%2$s</xliff:g>"</string>
Loading