* commit '9fee7bd73d1231172267cde99d2374cf072c2dca': Set the secureness when creating displays
This commit is contained in:
@@ -258,7 +258,7 @@ public class Surface implements Parcelable {
|
|||||||
private native void nativeSetLayerStack(int layerStack);
|
private native void nativeSetLayerStack(int layerStack);
|
||||||
|
|
||||||
private static native IBinder nativeGetBuiltInDisplay(int physicalDisplayId);
|
private static native IBinder nativeGetBuiltInDisplay(int physicalDisplayId);
|
||||||
private static native IBinder nativeCreateDisplay(String name);
|
private static native IBinder nativeCreateDisplay(String name, boolean secure);
|
||||||
private static native void nativeSetDisplaySurface(
|
private static native void nativeSetDisplaySurface(
|
||||||
IBinder displayToken, Surface surface);
|
IBinder displayToken, Surface surface);
|
||||||
private static native void nativeSetDisplayLayerStack(
|
private static native void nativeSetDisplayLayerStack(
|
||||||
@@ -597,11 +597,11 @@ public class Surface implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public static IBinder createDisplay(String name) {
|
public static IBinder createDisplay(String name, boolean secure) {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
throw new IllegalArgumentException("name must not be null");
|
throw new IllegalArgumentException("name must not be null");
|
||||||
}
|
}
|
||||||
return nativeCreateDisplay(name);
|
return nativeCreateDisplay(name, secure);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
@@ -653,9 +653,11 @@ static jobject nativeGetBuiltInDisplay(JNIEnv* env, jclass clazz, jint id) {
|
|||||||
return javaObjectForIBinder(env, token);
|
return javaObjectForIBinder(env, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jobject nativeCreateDisplay(JNIEnv* env, jclass clazz, jstring nameObj) {
|
static jobject nativeCreateDisplay(JNIEnv* env, jclass clazz, jstring nameObj,
|
||||||
|
jboolean secure) {
|
||||||
ScopedUtfChars name(env, nameObj);
|
ScopedUtfChars name(env, nameObj);
|
||||||
sp<IBinder> token(SurfaceComposerClient::createDisplay(String8(name.c_str())));
|
sp<IBinder> token(SurfaceComposerClient::createDisplay(
|
||||||
|
String8(name.c_str()), bool(secure)));
|
||||||
return javaObjectForIBinder(env, token);
|
return javaObjectForIBinder(env, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,7 +847,7 @@ static JNINativeMethod gSurfaceMethods[] = {
|
|||||||
(void*)nativeSetLayerStack },
|
(void*)nativeSetLayerStack },
|
||||||
{"nativeGetBuiltInDisplay", "(I)Landroid/os/IBinder;",
|
{"nativeGetBuiltInDisplay", "(I)Landroid/os/IBinder;",
|
||||||
(void*)nativeGetBuiltInDisplay },
|
(void*)nativeGetBuiltInDisplay },
|
||||||
{"nativeCreateDisplay", "(Ljava/lang/String;)Landroid/os/IBinder;",
|
{"nativeCreateDisplay", "(Ljava/lang/String;Z)Landroid/os/IBinder;",
|
||||||
(void*)nativeCreateDisplay },
|
(void*)nativeCreateDisplay },
|
||||||
{"nativeSetDisplaySurface", "(Landroid/os/IBinder;Landroid/view/Surface;)V",
|
{"nativeSetDisplaySurface", "(Landroid/os/IBinder;Landroid/view/Surface;)V",
|
||||||
(void*)nativeSetDisplaySurface },
|
(void*)nativeSetDisplaySurface },
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ final class OverlayDisplayAdapter extends DisplayAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public void onWindowCreated(SurfaceTexture surfaceTexture, float refreshRate) {
|
public void onWindowCreated(SurfaceTexture surfaceTexture, float refreshRate) {
|
||||||
synchronized (getSyncRoot()) {
|
synchronized (getSyncRoot()) {
|
||||||
IBinder displayToken = Surface.createDisplay(mName);
|
IBinder displayToken = Surface.createDisplay(mName, false);
|
||||||
mDevice = new OverlayDisplayDevice(displayToken, mName,
|
mDevice = new OverlayDisplayDevice(displayToken, mName,
|
||||||
mWidth, mHeight, refreshRate, mDensityDpi, surfaceTexture);
|
mWidth, mHeight, refreshRate, mDensityDpi, surfaceTexture);
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ final class WifiDisplayAdapter extends DisplayAdapter {
|
|||||||
float refreshRate = 60.0f; // TODO: get this for real
|
float refreshRate = 60.0f; // TODO: get this for real
|
||||||
|
|
||||||
String name = display.getFriendlyDisplayName();
|
String name = display.getFriendlyDisplayName();
|
||||||
IBinder displayToken = Surface.createDisplay(name);
|
IBinder displayToken = Surface.createDisplay(name, false);
|
||||||
mDisplayDevice = new WifiDisplayDevice(displayToken, name, width, height,
|
mDisplayDevice = new WifiDisplayDevice(displayToken, name, width, height,
|
||||||
refreshRate, deviceFlags, surface);
|
refreshRate, deviceFlags, surface);
|
||||||
sendDisplayDeviceEventLocked(mDisplayDevice, DISPLAY_DEVICE_EVENT_ADDED);
|
sendDisplayDeviceEventLocked(mDisplayDevice, DISPLAY_DEVICE_EVENT_ADDED);
|
||||||
|
|||||||
Reference in New Issue
Block a user