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

Commit 64a55af0 authored by Jeff Brown's avatar Jeff Brown
Browse files

Add plumbing for new surface flinger display API.

Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
parent 0b722fe9
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -6475,6 +6475,7 @@ package android.content.pm {
    method public abstract int checkSignatures(int, int);
    method public abstract void clearPackagePreferredActivities(java.lang.String);
    method public abstract java.lang.String[] currentToCanonicalPackageNames(java.lang.String[]);
    method public abstract void extendVerificationTimeout(int, int, long);
    method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
@@ -6533,7 +6534,6 @@ package android.content.pm {
    method public abstract void setComponentEnabledSetting(android.content.ComponentName, int, int);
    method public abstract void setInstallerPackageName(java.lang.String, java.lang.String);
    method public abstract void verifyPendingInstall(int, int);
    method public abstract void extendVerificationTimeout(int, int, long);
    field public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; // 0x0
    field public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; // 0x2
    field public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; // 0x3
@@ -6594,6 +6594,7 @@ package android.content.pm {
    field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
    field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
    field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
    field public static final int PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int PERMISSION_GRANTED = 0; // 0x0
    field public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; // 0xffffffff
@@ -6604,7 +6605,6 @@ package android.content.pm {
    field public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; // 0xfffffffc
    field public static final int VERIFICATION_ALLOW = 1; // 0x1
    field public static final int VERIFICATION_REJECT = -1; // 0xffffffff
    field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80
  }
  public static class PackageManager.NameNotFoundException extends android.util.AndroidException {
@@ -20069,8 +20069,8 @@ package android.service.dreams {
    method public void setContentView(android.view.View);
    method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method public void setInteractive(boolean);
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.dreams.Dream";
    field public static final java.lang.String METADATA_NAME_CONFIG_ACTIVITY = "android.service.dreams.config_activity";
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.dreams.Dream";
  }
}
@@ -21328,6 +21328,7 @@ package android.test.mock {
    method public int checkSignatures(int, int);
    method public void clearPackagePreferredActivities(java.lang.String);
    method public java.lang.String[] currentToCanonicalPackageNames(java.lang.String[]);
    method public void extendVerificationTimeout(int, int, long);
    method public android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.graphics.drawable.Drawable getActivityIcon(android.content.Intent) throws android.content.pm.PackageManager.NameNotFoundException;
    method public android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName, int) throws android.content.pm.PackageManager.NameNotFoundException;
@@ -21385,7 +21386,6 @@ package android.test.mock {
    method public void setComponentEnabledSetting(android.content.ComponentName, int, int);
    method public void setInstallerPackageName(java.lang.String, java.lang.String);
    method public void verifyPendingInstall(int, int);
    method public void extendVerificationTimeout(int, int, long);
  }
  public class MockResources extends android.content.res.Resources {
@@ -24422,7 +24422,7 @@ package android.view {
    method public android.graphics.Canvas lockCanvas(android.graphics.Rect) throws java.lang.IllegalArgumentException, android.view.Surface.OutOfResourcesException;
    method public void readFromParcel(android.os.Parcel);
    method public void release();
    method public void unlockCanvas(android.graphics.Canvas);
    method public deprecated void unlockCanvas(android.graphics.Canvas);
    method public void unlockCanvasAndPost(android.graphics.Canvas);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
+614 −317

File changed.

Preview size limit exceeded, changes collapsed.

+13 −11
Original line number Diff line number Diff line
@@ -16,30 +16,32 @@

package android.view;


/**
 * An instance of this class represents a connection to the surface
 * flinger, in which you can create one or more Surface instances that will
 * flinger, from which you can create one or more Surface instances that will
 * be composited to the screen.
 * {@hide}
 */
public class SurfaceSession {
    private int mClient;
public final class SurfaceSession {
    // Note: This field is accessed by native code.
    private int mNativeClient; // SurfaceComposerClient*

    private native void nativeInit();
    private native void nativeDestroy();
    private native void nativeKill();
    private static native int nativeCreate();
    private static native void nativeDestroy(int ptr);
    private static native void nativeKill(int ptr);

    /** Create a new connection with the surface flinger. */
    public SurfaceSession() {
        nativeInit();
        mNativeClient = nativeCreate();
    }

    /* no user serviceable parts here ... */
    @Override
    protected void finalize() throws Throwable {
        try {
            nativeDestroy();
            if (mNativeClient != 0) {
                nativeDestroy(mNativeClient);
            }
        } finally {
            super.finalize();
        }
@@ -48,10 +50,10 @@ public class SurfaceSession {
    /**
     * Forcibly detach native resources associated with this object.
     * Unlike destroy(), after this call any surfaces that were created
     * from the session will no longer work. The session itself is destroyed.
     * from the session will no longer work.
     */
    public void kill() {
        nativeKill();
        nativeKill(mNativeClient);
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ LOCAL_SRC_FILES:= \
	android_emoji_EmojiFactory.cpp \
	android_view_DisplayEventReceiver.cpp \
	android_view_Surface.cpp \
	android_view_SurfaceSession.cpp \
	android_view_TextureView.cpp \
	android_view_InputChannel.cpp \
	android_view_InputDevice.cpp \
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ extern int register_android_view_GLES20DisplayList(JNIEnv* env);
extern int register_android_view_GLES20Canvas(JNIEnv* env);
extern int register_android_view_HardwareRenderer(JNIEnv* env);
extern int register_android_view_Surface(JNIEnv* env);
extern int register_android_view_SurfaceSession(JNIEnv* env);
extern int register_android_view_TextureView(JNIEnv* env);
extern int register_android_database_CursorWindow(JNIEnv* env);
extern int register_android_database_SQLiteConnection(JNIEnv* env);
@@ -1094,6 +1095,7 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_view_GLES20Canvas),
    REG_JNI(register_android_view_HardwareRenderer),
    REG_JNI(register_android_view_Surface),
    REG_JNI(register_android_view_SurfaceSession),
    REG_JNI(register_android_view_TextureView),
    REG_JNI(register_com_google_android_gles_jni_EGLImpl),
    REG_JNI(register_com_google_android_gles_jni_GLImpl),
Loading