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

Commit 58e7fdf7 authored by Bryce Lee's avatar Bryce Lee Committed by Automerger Merge Worker
Browse files

Merge "Remove Dream Overlay window name and update content descriptions." into...

Merge "Remove Dream Overlay window name and update content descriptions." into tm-qpr-dev am: 69dcdb2d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21385166



Change-Id: I824fa2a779ebb895a6629f4d1aadcd1e6bf3ae9e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b934b50f 69dcdb2d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2842,4 +2842,19 @@
    [CHAR LIMIT=32]
    -->
    <string name="lock_screen_settings">Lock screen settings</string>

    <!-- Content description for Wi-Fi not available icon on dream [CHAR LIMIT=NONE]-->
    <string name="wifi_unavailable_dream_overlay_content_description">Wi-Fi not available</string>

    <!-- Content description for camera blocked icon on dream [CHAR LIMIT=NONE] -->
    <string name="camera_blocked_dream_overlay_content_description">Camera blocked</string>

    <!-- Content description for camera and microphone blocked icon on dream [CHAR LIMIT=NONE] -->
    <string name="camera_and_microphone_blocked_dream_overlay_content_description">Camera and microphone blocked</string>

    <!-- Content description for camera and microphone disabled icon on dream [CHAR LIMIT=NONE] -->
    <string name="microphone_blocked_dream_overlay_content_description">Microphone blocked</string>

    <!-- Content description for priority mode icon on dream [CHAR LIMIT=NONE] -->
    <string name="priority_mode_dream_overlay_content_description">Priority mode on</string>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
     */
    private void addOverlayWindowLocked(WindowManager.LayoutParams layoutParams) {
        mWindow = new PhoneWindow(mContext);
        // Default to SystemUI name for TalkBack.
        mWindow.setTitle("");
        mWindow.setAttributes(layoutParams);
        mWindow.setWindowManager(null, layoutParams.token, "DreamOverlay", true);

+13 −7
Original line number Diff line number Diff line
@@ -257,7 +257,8 @@ public class DreamOverlayStatusBarViewController extends ViewController<DreamOve
                        mConnectivityManager.getActiveNetwork());
        final boolean available = capabilities != null
                && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI);
        showIcon(DreamOverlayStatusBarView.STATUS_ICON_WIFI_UNAVAILABLE, !available);
        showIcon(DreamOverlayStatusBarView.STATUS_ICON_WIFI_UNAVAILABLE, !available,
                R.string.wifi_unavailable_dream_overlay_content_description);
    }

    private void updateAlarmStatusIcon() {
@@ -294,13 +295,16 @@ public class DreamOverlayStatusBarViewController extends ViewController<DreamOve
        @DreamOverlayStatusBarView.StatusIconType int iconType = Resources.ID_NULL;
        showIcon(
                DreamOverlayStatusBarView.STATUS_ICON_CAMERA_DISABLED,
                !micBlocked && cameraBlocked);
                !micBlocked && cameraBlocked,
                R.string.camera_blocked_dream_overlay_content_description);
        showIcon(
                DreamOverlayStatusBarView.STATUS_ICON_MIC_DISABLED,
                micBlocked && !cameraBlocked);
                micBlocked && !cameraBlocked,
                R.string.microphone_blocked_dream_overlay_content_description);
        showIcon(
                DreamOverlayStatusBarView.STATUS_ICON_MIC_CAMERA_DISABLED,
                micBlocked && cameraBlocked);
                micBlocked && cameraBlocked,
                R.string.camera_and_microphone_blocked_dream_overlay_content_description);
    }

    private String buildNotificationsContentDescription(int notificationCount) {
@@ -313,11 +317,13 @@ public class DreamOverlayStatusBarViewController extends ViewController<DreamOve
    private void updatePriorityModeStatusIcon() {
        showIcon(
                DreamOverlayStatusBarView.STATUS_ICON_PRIORITY_MODE_ON,
                mZenModeController.getZen() != Settings.Global.ZEN_MODE_OFF);
                mZenModeController.getZen() != Settings.Global.ZEN_MODE_OFF,
                R.string.priority_mode_dream_overlay_content_description);
    }

    private void showIcon(@DreamOverlayStatusBarView.StatusIconType int iconType, boolean show) {
        showIcon(iconType, show, null);
    private void showIcon(@DreamOverlayStatusBarView.StatusIconType int iconType, boolean show,
            int contentDescriptionResId) {
        showIcon(iconType, show, mResources.getString(contentDescriptionResId));
    }

    private void showIcon(