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

Commit 6881a105 authored by Craig Mautner's avatar Craig Mautner
Browse files

Small step towards supporting multiple displays

Change-Id: I353449c2b464394988c7e0203656b5851a0c9127
parent 2b8c4b07
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.util.Log;
import android.util.LogPrinter;
import android.view.Display;
import android.view.Gravity;
import android.view.IWindowSession;
import android.view.InputChannel;
@@ -612,8 +613,8 @@ public abstract class WallpaperService extends Service {
                        mLayout.windowAnimations =
                                com.android.internal.R.style.Animation_Wallpaper;
                        mInputChannel = new InputChannel();
                        if (mSession.add(mWindow, mWindow.mSeq, mLayout, View.VISIBLE, mContentInsets,
                                mInputChannel) < 0) {
                        if (mSession.addToDisplay(mWindow, mWindow.mSeq, mLayout, View.VISIBLE,
                            Display.DEFAULT_DISPLAY, mContentInsets, mInputChannel) < 0) {
                            Log.w(TAG, "Failed to add window while updating wallpaper surface.");
                            return;
                        }
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.IRemoteCallback;
import android.view.DisplayInfo;
import android.view.IApplicationToken;
import android.view.IOnKeyguardExitResult;
import android.view.IRotationWatcher;
+5 −0
Original line number Diff line number Diff line
@@ -37,8 +37,13 @@ interface IWindowSession {
    int add(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            in int viewVisibility, out Rect outContentInsets,
            out InputChannel outInputChannel);
    int addToDisplay(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            in int viewVisibility, in int layerStackId, out Rect outContentInsets,
            out InputChannel outInputChannel);
    int addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            in int viewVisibility, out Rect outContentInsets);
    int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            in int viewVisibility, in int layerStackId, out Rect outContentInsets);
    void remove(IWindow window);
    
    /**
+5 −5
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public class Surface implements Parcelable {

    /** create a surface @hide */
    public Surface(SurfaceSession s,
            int pid, int display, int w, int h, int format, int flags)
            int pid, int displayId, int w, int h, int format, int flags)
        throws OutOfResourcesException {
        checkHeadless();

@@ -256,12 +256,12 @@ public class Surface implements Parcelable {
            mCreationStack = new Exception();
        }
        mCanvas = new CompatibleCanvas();
        init(s,pid,null,display,w,h,format,flags);
        init(s,pid,null,displayId,w,h,format,flags);
    }

    /** create a surface with a name @hide */
    public Surface(SurfaceSession s,
            int pid, String name, int display, int w, int h, int format, int flags)
            int pid, String name, int displayId, int w, int h, int format, int flags)
        throws OutOfResourcesException {
        checkHeadless();

@@ -269,7 +269,7 @@ public class Surface implements Parcelable {
            mCreationStack = new Exception();
        }
        mCanvas = new CompatibleCanvas();
        init(s,pid,name,display,w,h,format,flags);
        init(s,pid,name,displayId,w,h,format,flags);
        mName = name;
    }

@@ -508,7 +508,7 @@ public class Surface implements Parcelable {
    }
    
    private native void init(SurfaceSession s,
            int pid, String name, int display, int w, int h, int format, int flags)
            int pid, String name, int displayId, int w, int h, int format, int flags)
            throws OutOfResourcesException;

    private native void init(Parcel source);
+2 −2
Original line number Diff line number Diff line
@@ -459,8 +459,8 @@ public class SurfaceView extends View {
                    mWindow = new MyWindow(this);
                    mLayout.type = mWindowType;
                    mLayout.gravity = Gravity.START|Gravity.TOP;
                    mSession.addWithoutInputChannel(mWindow, mWindow.mSeq, mLayout,
                            mVisible ? VISIBLE : GONE, mContentInsets);
                    mSession.addToDisplayWithoutInputChannel(mWindow, mWindow.mSeq, mLayout,
                            mVisible ? VISIBLE : GONE, Display.DEFAULT_DISPLAY, mContentInsets);
                }
                
                boolean realSizeChanged;
Loading