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

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

Snap for 12091711 from 88d75700 to 24Q4-release

Change-Id: I48a76eb0d19a7c480cb72708502b85f90f4aa764
parents 7122996a 88d75700
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -60,8 +60,7 @@ public final class BrightnessInfo implements Parcelable {
    @IntDef(prefix = {"BRIGHTNESS_MAX_REASON_"}, value = {
            BRIGHTNESS_MAX_REASON_NONE,
            BRIGHTNESS_MAX_REASON_THERMAL,
            BRIGHTNESS_MAX_REASON_POWER_IC,
            BRIGHTNESS_MAX_REASON_WEAR_BEDTIME_MODE
            BRIGHTNESS_MAX_REASON_POWER_IC
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface BrightnessMaxReason {}
@@ -158,8 +157,6 @@ public final class BrightnessInfo implements Parcelable {
                return "thermal";
            case BRIGHTNESS_MAX_REASON_POWER_IC:
                return "power IC";
            case BRIGHTNESS_MAX_REASON_WEAR_BEDTIME_MODE:
                return "wear bedtime";
        }
        return "invalid";
    }
+40 −0
Original line number Diff line number Diff line
@@ -1668,6 +1668,46 @@ public final class DisplayManager {
        mGlobal.requestDisplayModes(displayId, modeIds);
    }

    /**
     * Gets the mapping between the doze brightness sensor values and brightness values. The doze
     * brightness sensor is a light sensor used to determine the brightness while the device is
     * dozing. Light sensor values are typically integers in the rage of 0-4. The returned values
     * are between {@link PowerManager#BRIGHTNESS_MIN} and {@link PowerManager#BRIGHTNESS_MAX}, or
     * -1 meaning that the current brightness should be kept.
     * <p>
     * Requires the {@link android.Manifest.permission#CONTROL_DISPLAY_BRIGHTNESS}
     * permission.
     * </p>
     *
     * @param displayId The ID of the display
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS)
    @Nullable
    public float[] getDozeBrightnessSensorValueToBrightness(int displayId) {
        return mGlobal.getDozeBrightnessSensorValueToBrightness(displayId);
    }

    /**
     * Gets the default doze brightness.
     * The returned values are between {@link PowerManager#BRIGHTNESS_MIN} and
     * {@link PowerManager#BRIGHTNESS_MAX}.
     * <p>
     * Requires the {@link android.Manifest.permission#CONTROL_DISPLAY_BRIGHTNESS}
     * permission.
     * </p>
     *
     * @param displayId The ID of the display
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS)
    @FloatRange(from = 0f, to = 1f)
    public float getDefaultDozeBrightness(int displayId) {
        return mGlobal.getDefaultDozeBrightness(displayId);
    }

    /**
     * Listens for changes in available display devices.
     */
+27 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.hardware.display.DisplayManager.EventsMask;
import static android.view.Display.HdrCapabilities.HdrType;

import android.Manifest;
import android.annotation.FloatRange;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1226,6 +1227,32 @@ public final class DisplayManagerGlobal {
        }
    }

    /**
     * @see DisplayManager#getDozeBrightnessSensorValueToBrightness
     */
    @RequiresPermission(Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS)
    @Nullable
    public float[] getDozeBrightnessSensorValueToBrightness(int displayId) {
        try {
            return mDm.getDozeBrightnessSensorValueToBrightness(displayId);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * @see DisplayManager#getDefaultDozeBrightness
     */
    @RequiresPermission(Manifest.permission.CONTROL_DISPLAY_BRIGHTNESS)
    @FloatRange(from = 0f, to = 1f)
    public float getDefaultDozeBrightness(int displayId) {
        try {
            return mDm.getDefaultDozeBrightness(displayId);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub {
        @Override
        public void onDisplayEvent(int displayId, @DisplayEvent int event) {
+8 −0
Original line number Diff line number Diff line
@@ -246,4 +246,12 @@ interface IDisplayManager {
    // Restricts display modes to specified modeIds.
    @EnforcePermission("RESTRICT_DISPLAY_MODES")
    void requestDisplayModes(in IBinder token, int displayId, in @nullable int[] modeIds);

    // Get the mapping between the doze brightness sensor values and brightness values
    @EnforcePermission("CONTROL_DISPLAY_BRIGHTNESS")
    float[] getDozeBrightnessSensorValueToBrightness(int displayId);

    // Get the default doze brightness
    @EnforcePermission("CONTROL_DISPLAY_BRIGHTNESS")
    float getDefaultDozeBrightness(int displayId);
}
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.view.inputmethod.Flags;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodSession;
import android.window.WindowProviderService;
@@ -186,6 +187,10 @@ public abstract class AbstractInputMethodService extends WindowProviderService
            if (callback != null) {
                callback.finishedEvent(seq, handled);
            }
            if (Flags.imeSwitcherRevamp() && !handled && event.getAction() == KeyEvent.ACTION_DOWN
                    && event.getUnicodeChar() > 0 && mInputMethodServiceInternal != null) {
                mInputMethodServiceInternal.notifyUserActionIfNecessary();
            }
        }

        /**
Loading