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

Commit eccbbe4c authored by Albert Chaulk's avatar Albert Chaulk Committed by android-build-merger
Browse files

Merge "Propagate UIDs for all SurfaceControl instances" into oc-dev

am: 6c34dd58

Change-Id: Ia3aa4d9537f141a3132afefbcdac5b0bda61722b
parents 172bd073 6c34dd58
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -16,10 +16,13 @@


package android.view;
package android.view;


import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;

import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.GraphicBuffer;
import android.graphics.GraphicBuffer;
import android.graphics.Rect;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region;
import android.os.Binder;
import android.os.IBinder;
import android.os.IBinder;
import android.util.Log;
import android.util.Log;
import android.view.Surface.OutOfResourcesException;
import android.view.Surface.OutOfResourcesException;
@@ -302,7 +305,7 @@ public class SurfaceControl {
    public SurfaceControl(SurfaceSession session,
    public SurfaceControl(SurfaceSession session,
            String name, int w, int h, int format, int flags)
            String name, int w, int h, int format, int flags)
                    throws OutOfResourcesException {
                    throws OutOfResourcesException {
        this(session, name, w, h, format, flags, null, -1, -1);
        this(session, name, w, h, format, flags, null, INVALID_WINDOW_TYPE, Binder.getCallingUid());
    }
    }


    public SurfaceControl(SurfaceSession session, String name, int w, int h, int format, int flags,
    public SurfaceControl(SurfaceSession session, String name, int w, int h, int format, int flags,
+6 −0
Original line number Original line Diff line number Diff line
@@ -742,6 +742,12 @@ public interface WindowManager extends ViewManager {
         */
         */
        public static final int LAST_SYSTEM_WINDOW      = 2999;
        public static final int LAST_SYSTEM_WINDOW      = 2999;


        /**
         * @hide
         * Used internally when there is no suitable type available.
         */
        public static final int INVALID_WINDOW_TYPE = -1;

        /**
        /**
         * Return true if the window type is an alert window.
         * Return true if the window type is an alert window.
         *
         *
+4 −1
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.Rect;
import android.os.Binder;
import android.os.Debug;
import android.os.Debug;
import android.os.Trace;
import android.os.Trace;
import android.util.ArraySet;
import android.util.ArraySet;
@@ -683,9 +684,11 @@ class WindowSurfacePlacer {
            final DisplayInfo displayInfo = displayContent.getDisplayInfo();
            final DisplayInfo displayInfo = displayContent.getDisplayInfo();


            // Create a new surface for the thumbnail
            // Create a new surface for the thumbnail
            WindowState window = appToken.findMainWindow();
            SurfaceControl surfaceControl = new SurfaceControl(mService.mFxSession,
            SurfaceControl surfaceControl = new SurfaceControl(mService.mFxSession,
                    "thumbnail anim", dirty.width(), dirty.height(),
                    "thumbnail anim", dirty.width(), dirty.height(),
                    PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN);
                    PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN,
                    appToken.windowType, window.mOwnerUid);
            surfaceControl.setLayerStack(display.getLayerStack());
            surfaceControl.setLayerStack(display.getLayerStack());
            if (SHOW_TRANSACTIONS) {
            if (SHOW_TRANSACTIONS) {
                Slog.i(TAG, "  THUMBNAIL " + surfaceControl + ": CREATE");
                Slog.i(TAG, "  THUMBNAIL " + surfaceControl + ": CREATE");