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

Commit abc6958e authored by Xin Li's avatar Xin Li Committed by Android (Google) Code Review
Browse files

Merge "Merge ab/AP4A.241205.013 into aosp-main-future" into aosp-main-future

parents 729d0609 0f3a9515
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.display;

import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.HdrCapabilities.HdrType;
import static android.view.Display.INVALID_DISPLAY;

import android.Manifest;
import android.annotation.FlaggedApi;
@@ -47,6 +48,7 @@ import android.os.Looper;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserManager;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
@@ -96,6 +98,8 @@ public final class DisplayManager {
    @GuardedBy("mLock")
    private final WeakDisplayCache mDisplayCache = new WeakDisplayCache();

    private int mDisplayIdToMirror = INVALID_DISPLAY;

    /**
     * Broadcast receiver that indicates when the Wifi display status changes.
     * <p>
@@ -1086,6 +1090,7 @@ public final class DisplayManager {
        if (surface != null) {
            builder.setSurface(surface);
        }
        builder.setDisplayIdToMirror(getDisplayIdToMirror());
        return createVirtualDisplay(builder.build(), handler, callback);
    }

@@ -1163,6 +1168,7 @@ public final class DisplayManager {
        if (surface != null) {
            builder.setSurface(surface);
        }
        builder.setDisplayIdToMirror(getDisplayIdToMirror());
        return createVirtualDisplay(projection, builder.build(), callback, handler);
    }

@@ -1708,6 +1714,16 @@ public final class DisplayManager {
        return mGlobal.getDefaultDozeBrightness(displayId);
    }

    private int getDisplayIdToMirror() {
        if (mDisplayIdToMirror == INVALID_DISPLAY) {
            final UserManager userManager = mContext.getSystemService(UserManager.class);
            mDisplayIdToMirror = userManager.isVisibleBackgroundUsersSupported()
                    ? userManager.getMainDisplayIdAssignedToUser()
                    : DEFAULT_DISPLAY;
        }
        return mDisplayIdToMirror;
    }

    /**
     * Listens for changes in available display devices.
     */
+57 −57
Original line number Diff line number Diff line
@@ -19338,14 +19338,14 @@ public final class Settings {
             * If hotword detection should be enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String HOTWORD_DETECTION_ENABLED = "hotword_detection_enabled";
            /**
             * Whether Smart Replies are enabled within Wear.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SMART_REPLIES_ENABLED = "smart_replies_enabled";
            /**
@@ -19359,7 +19359,7 @@ public final class Settings {
             * If FLP should obtain location data from the paired device.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String OBTAIN_PAIRED_DEVICE_LOCATION =
                    "obtain_paired_device_location";
@@ -19367,7 +19367,7 @@ public final class Settings {
             * The play store availability on companion phone.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String PHONE_PLAY_STORE_AVAILABILITY =
                    "phone_play_store_availability";
@@ -19383,7 +19383,7 @@ public final class Settings {
             * Whether the bug report is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String BUG_REPORT = "bug_report";
            // Possible bug report states
@@ -19396,14 +19396,14 @@ public final class Settings {
             * The enabled/disabled state of the SmartIlluminate.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SMART_ILLUMINATE_ENABLED = "smart_illuminate_enabled";
            /**
             * Whether automatic time is enabled on the watch.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CLOCKWORK_AUTO_TIME = "clockwork_auto_time";
            // Possible clockwork auto time states
@@ -19421,7 +19421,7 @@ public final class Settings {
             * Whether automatic time zone is enabled on the watch.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CLOCKWORK_AUTO_TIME_ZONE = "clockwork_auto_time_zone";
            // Possible clockwork auto time zone states
@@ -19438,14 +19438,14 @@ public final class Settings {
             * Whether 24 hour time format is enabled on the watch.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CLOCKWORK_24HR_TIME = "clockwork_24hr_time";
            /**
             * Whether the auto wifi toggle setting is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AUTO_WIFI = "auto_wifi";
            // Possible force wifi on states
@@ -19465,7 +19465,7 @@ public final class Settings {
             * wifi requirement until this time). The time is in millis since epoch.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String ALT_BYPASS_WIFI_REQUIREMENT_TIME_MILLIS =
                    "alt_bypass_wifi_requirement_time_millis";
@@ -19473,7 +19473,7 @@ public final class Settings {
             * Whether the setup was skipped.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SETUP_SKIPPED = "setup_skipped";
            // Possible setup_skipped states
@@ -19488,7 +19488,7 @@ public final class Settings {
             * The last requested call forwarding action.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String LAST_CALL_FORWARD_ACTION = "last_call_forward_action";
            // Possible call forwarding actions
@@ -19501,31 +19501,31 @@ public final class Settings {
            // Stem button settings.
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_1_TYPE = "STEM_1_TYPE";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_1_DATA = "STEM_1_DATA";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_1_DEFAULT_DATA = "STEM_1_DEFAULT_DATA";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_2_TYPE = "STEM_2_TYPE";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_2_DATA = "STEM_2_DATA";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_2_DEFAULT_DATA = "STEM_2_DEFAULT_DATA";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_3_TYPE = "STEM_3_TYPE";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_3_DATA = "STEM_3_DATA";
            /** @hide */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String STEM_3_DEFAULT_DATA = "STEM_3_DEFAULT_DATA";
            // Stem types
@@ -19540,14 +19540,14 @@ public final class Settings {
             * If the device should be muted when off body.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String MUTE_WHEN_OFF_BODY_ENABLED = "obtain_mute_when_off_body";
            /**
             * Wear OS version string.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String WEAR_OS_VERSION_STRING = "wear_os_version_string";
            /**
@@ -19560,28 +19560,28 @@ public final class Settings {
             * The android wear system version.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String ANDROID_WEAR_VERSION = "android_wear_version";
            /**
             * The wear system capabiltiies.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SYSTEM_CAPABILITIES = "system_capabilities";
            /**
             * The android wear system edition.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SYSTEM_EDITION = "android_wear_system_edition";
            /**
             * The Wear platform MR number.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String WEAR_PLATFORM_MR_NUMBER = "wear_platform_mr_number";
            /**
@@ -19595,42 +19595,42 @@ public final class Settings {
             * Whether ambient is currently enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_ENABLED = "ambient_enabled";
            /**
             * Whether ambient tilt to wake is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_TILT_TO_WAKE = "ambient_tilt_to_wake";
            /**
             * Whether ambient low bit mode is enabled by developer options.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_LOW_BIT_ENABLED_DEV = "ambient_low_bit_enabled_dev";
            /**
             * Whether ambient touch to wake is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_TOUCH_TO_WAKE = "ambient_touch_to_wake";
            /**
             * Whether ambient tilt to bright is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_TILT_TO_BRIGHT = "ambient_tilt_to_bright";
            /**
             * Whether touch and hold to edit WF is enabled
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String GESTURE_TOUCH_AND_HOLD_WATCH_FACE_ENABLED =
                    "gesture_touch_and_hold_watchface_enabled";
@@ -19644,7 +19644,7 @@ public final class Settings {
             * Whether bedtime mode is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String BEDTIME_MODE = "bedtime_mode";
            /**
@@ -19656,35 +19656,35 @@ public final class Settings {
             * Whether the current watchface is decomposable.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String DECOMPOSABLE_WATCHFACE = "current_watchface_decomposable";
            /**
             * Whether to force ambient when docked.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_FORCE_WHEN_DOCKED = "ambient_force_when_docked";
            /**
             * Whether the ambient low bit mode is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_LOW_BIT_ENABLED = "ambient_low_bit_enabled";
            /**
             * The timeout duration in minutes of ambient mode when plugged in.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String AMBIENT_PLUGGED_TIMEOUT_MIN = "ambient_plugged_timeout_min";
            /**
             * What OS does paired device has.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String PAIRED_DEVICE_OS_TYPE = "paired_device_os_type";
            // Possible values of PAIRED_DEVICE_OS_TYPE
@@ -19719,7 +19719,7 @@ public final class Settings {
             * The user's last setting for hfp client.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String USER_HFP_CLIENT_SETTING = "user_hfp_client_setting";
            // Possible hfp client user setting values
@@ -19744,7 +19744,7 @@ public final class Settings {
             * The companion App name.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String COMPANION_APP_NAME = "wear_companion_app_name";
            /**
@@ -19752,21 +19752,21 @@ public final class Settings {
             * wear. 1 for supporting, 0 for not supporting.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String ENABLE_ALL_LANGUAGES = "enable_all_languages";
            /**
             * The Locale (as language tag) the user chose at startup.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String SETUP_LOCALE = "setup_locale";
            /**
             * The version of oem setup present.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String OEM_SETUP_VERSION = "oem_setup_version";
            /**
@@ -19812,7 +19812,7 @@ public final class Settings {
             * -{@link BATTERY_SAVER_MODE_CUSTOM}
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String BATTERY_SAVER_MODE = "battery_saver_mode";
            /**
@@ -19869,7 +19869,7 @@ public final class Settings {
             * If burn in protection is enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String BURN_IN_PROTECTION_ENABLED = "burn_in_protection";
            /**
@@ -19888,7 +19888,7 @@ public final class Settings {
             *          RIGHT_WRIST_ROTATION_0 = "2", RIGHT_WRIST_ROTATION_180 = "3"
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String WRIST_ORIENTATION_MODE = "wear_wrist_orientation_mode";
            /**
@@ -19927,7 +19927,7 @@ public final class Settings {
             *
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CLOCKWORK_SYSUI_PACKAGE = "clockwork_sysui_package";
            /**
@@ -19957,7 +19957,7 @@ public final class Settings {
             * Whether the device has Wet Mode/ Touch Lock Mode enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String WET_MODE_ON = "wet_mode_on";
            /**
@@ -19976,7 +19976,7 @@ public final class Settings {
             * Whether charging sounds are enabled.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CHARGING_SOUNDS_ENABLED = "wear_charging_sounds_enabled";
            /**
@@ -19985,7 +19985,7 @@ public final class Settings {
             *
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String DYNAMIC_COLOR_THEME_ENABLED = "dynamic_color_theme_enabled";
            /**
@@ -20077,7 +20077,7 @@ public final class Settings {
             * The key to indicate the data migration status on device upgrade in Wear Services.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String UPGRADE_DATA_MIGRATION_STATUS =
                    "upgrade_data_migration_status";
@@ -20134,20 +20134,20 @@ public final class Settings {
             * The custom foreground color.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CUSTOM_COLOR_FOREGROUND = "custom_foreground_color";
            /**
             * The custom background color.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String CUSTOM_COLOR_BACKGROUND = "custom_background_color";
            /** The status of the phone switching process.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String PHONE_SWITCHING_STATUS = "phone_switching_status";
            /**
@@ -20318,7 +20318,7 @@ public final class Settings {
             * Controls the launcher ui mode on wearable devices.
             * @hide
             */
            @Readable(maxTargetSdk = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
            @Readable
            public static final String WEAR_LAUNCHER_UI_MODE = "wear_launcher_ui_mode";
            /** Whether Wear Power Anomaly Service is enabled.
+0 −4
Original line number Diff line number Diff line
@@ -1501,10 +1501,6 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
                int rootIdx = -1;
                for (int i = info.getChanges().size() - 1; i >= 0; --i) {
                    final TransitionInfo.Change c = info.getChanges().get(i);
                    if (c.hasFlags(FLAG_IS_WALLPAPER)) {
                        st.setAlpha(c.getLeash(), 1.0f);
                        continue;
                    }
                    if (TransitionUtil.isOpeningMode(c.getMode())) {
                        final Point offset = c.getEndRelOffset();
                        st.setPosition(c.getLeash(), offset.x, offset.y);
+4 −1
Original line number Diff line number Diff line
@@ -141,10 +141,13 @@ public class MixedTransitionHelper {
            pipHandler.setEnterAnimationType(ANIM_TYPE_ALPHA);
            pipHandler.startEnterAnimation(pipChange, startTransaction, finishTransaction,
                    finishCB);
            // make a new finishTransaction because pip's startEnterAnimation "consumes" it so
            // we need a separate one to send over to launcher.
            SurfaceControl.Transaction otherFinishT = new SurfaceControl.Transaction();
            // Dispatch the rest of the transition normally. This will most-likely be taken by
            // recents or default handler.
            mixed.mLeftoversHandler = player.dispatchTransition(mixed.mTransition, everythingElse,
                    otherStartT, finishTransaction, finishCB, mixedHandler);
                    otherStartT, otherFinishT, finishCB, mixedHandler);
        } else {
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "  Not leaving split, so just "
                    + "forward animation to Pip-Handler.");
+0 −6
Original line number Diff line number Diff line
@@ -182,12 +182,6 @@ class FromSplitScreenEnterPipOnUserLeaveHintTest(flicker: LegacyFlickerTest) :
        }
    }

    /** {@inheritDoc} */
    @FlakyTest(bugId = 312446524)
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc} */
    @Test
    @FlakyTest(bugId = 336510055)
Loading