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

Commit e83edde4 authored by Galia Peycheva's avatar Galia Peycheva Committed by Android (Google) Code Review
Browse files

Merge "Add SystemApi USE_UNRESTRICTED_KEEP_CLEAR_AREAS"

parents d0ee4efd 2277bc53
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ package android {
    field public static final String SET_POINTER_SPEED = "android.permission.SET_POINTER_SPEED";
    field public static final String SET_SCREEN_COMPATIBILITY = "android.permission.SET_SCREEN_COMPATIBILITY";
    field public static final String SET_SYSTEM_AUDIO_CAPTION = "android.permission.SET_SYSTEM_AUDIO_CAPTION";
    field public static final String SET_UNRESTRICTED_KEEP_CLEAR_AREAS = "android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS";
    field public static final String SET_VOLUME_KEY_LONG_PRESS_LISTENER = "android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER";
    field public static final String SET_WALLPAPER_COMPONENT = "android.permission.SET_WALLPAPER_COMPONENT";
    field public static final String SET_WALLPAPER_DIM_AMOUNT = "android.permission.SET_WALLPAPER_DIM_AMOUNT";
+1 −1
Original line number Diff line number Diff line
@@ -63,5 +63,5 @@ oneway interface IDisplayWindowListener {
    /**
     * Called when the keep clear ares on a display have changed.
     */
    void onKeepClearAreasChanged(int displayId, in List<Rect> keepClearAreas);
    void onKeepClearAreasChanged(int displayId, in List<Rect> restricted, in List<Rect> unrestricted);
}
+9 −0
Original line number Diff line number Diff line
@@ -6300,6 +6300,15 @@
    <permission android:name="android.permission.BIND_AMBIENT_CONTEXT_DETECTION_SERVICE"
                android:protectionLevel="signature" />

    <!-- @SystemApi Allows an app to set keep-clear areas without restrictions on the size or
        number of keep-clear areas (see {@link android.view.View#setPreferKeepClearRects}).
        When the system arranges floating windows onscreen, it might decide to ignore keep-clear
        areas from windows, whose owner does not have this permission.
        @hide
    -->
    <permission android:name="android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS"
                android:protectionLevel="signature|privileged" />

    <!-- Attribution for Geofencing service. -->
    <attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
    <!-- Attribution for Country Detector. -->
+9 −5
Original line number Diff line number Diff line
@@ -245,7 +245,8 @@ public class DisplayController {
        }
    }

    private void onKeepClearAreasChanged(int displayId, List<Rect> keepClearAreas) {
    private void onKeepClearAreasChanged(int displayId, List<Rect> restricted,
            List<Rect> unrestricted) {
        synchronized (mDisplays) {
            if (mDisplays.get(displayId) == null || getDisplay(displayId) == null) {
                Slog.w(TAG, "Skipping onKeepClearAreasChanged on unknown"
@@ -253,7 +254,8 @@ public class DisplayController {
                return;
            }
            for (int i = mDisplayChangedListeners.size() - 1; i >= 0; --i) {
                mDisplayChangedListeners.get(i).onKeepClearAreasChanged(displayId, keepClearAreas);
                mDisplayChangedListeners.get(i)
                    .onKeepClearAreasChanged(displayId, restricted, unrestricted);
            }
        }
    }
@@ -318,9 +320,10 @@ public class DisplayController {
        }

        @Override
        public void onKeepClearAreasChanged(int displayId, List<Rect> keepClearAreas) {
        public void onKeepClearAreasChanged(int displayId, List<Rect> restricted,
                List<Rect> unrestricted) {
            mMainExecutor.execute(() -> {
                DisplayController.this.onKeepClearAreasChanged(displayId, keepClearAreas);
                DisplayController.this.onKeepClearAreasChanged(displayId, restricted, unrestricted);
            });
        }
    }
@@ -361,6 +364,7 @@ public class DisplayController {
        /**
         * Called when keep-clear areas on a display have changed.
         */
        default void onKeepClearAreasChanged(int displayId, List<Rect> keepClearAreas) {}
        default void onKeepClearAreasChanged(int displayId, List<Rect> restricted,
                List<Rect> unrestricted) {}
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -308,7 +308,8 @@ public class CameraServiceProxy extends SystemService
        public void onFixedRotationFinished(int displayId) { }

        @Override
        public void onKeepClearAreasChanged(int displayId, List<Rect> keepClearArea) { }
        public void onKeepClearAreasChanged(int displayId, List<Rect> restricted,
                List<Rect> unrestricted) { }
    }


Loading