am 39c68da5: am cd79b35c: Merge "Surface: add the PhysicalDisplayInfo#secure field" into jb-mr1-dev

* commit '39c68da57b443c869378263b8063da6e821a1b6d':
  Surface: add the PhysicalDisplayInfo#secure field
This commit is contained in:
Jamie Gennis
2012-10-23 15:27:10 -07:00
committed by Android Git Automerger
2 changed files with 9 additions and 2 deletions

View File

@@ -758,6 +758,7 @@ public class Surface implements Parcelable {
public float density; public float density;
public float xDpi; public float xDpi;
public float yDpi; public float yDpi;
public boolean secure;
public PhysicalDisplayInfo() { public PhysicalDisplayInfo() {
} }
@@ -778,7 +779,8 @@ public class Surface implements Parcelable {
&& refreshRate == other.refreshRate && refreshRate == other.refreshRate
&& density == other.density && density == other.density
&& xDpi == other.xDpi && xDpi == other.xDpi
&& yDpi == other.yDpi; && yDpi == other.yDpi
&& secure == other.secure;
} }
@Override @Override
@@ -793,13 +795,15 @@ public class Surface implements Parcelable {
density = other.density; density = other.density;
xDpi = other.xDpi; xDpi = other.xDpi;
yDpi = other.yDpi; yDpi = other.yDpi;
secure = other.secure;
} }
// For debugging purposes // For debugging purposes
@Override @Override
public String toString() { public String toString() {
return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, " return "PhysicalDisplayInfo{" + width + " x " + height + ", " + refreshRate + " fps, "
+ "density " + density + ", " + xDpi + " x " + yDpi + " dpi}"; + "density " + density + ", " + xDpi + " x " + yDpi + " dpi, secure " + secure
+ "}";
} }
} }

View File

@@ -89,6 +89,7 @@ static struct {
jfieldID density; jfieldID density;
jfieldID xDpi; jfieldID xDpi;
jfieldID yDpi; jfieldID yDpi;
jfieldID secure;
} gPhysicalDisplayInfoClassInfo; } gPhysicalDisplayInfoClassInfo;
@@ -714,6 +715,7 @@ static jboolean nativeGetDisplayInfo(JNIEnv* env, jclass clazz,
env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.density, info.density); env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.density, info.density);
env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.xDpi, info.xdpi); env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.xDpi, info.xdpi);
env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.yDpi, info.ydpi); env->SetFloatField(infoObj, gPhysicalDisplayInfoClassInfo.yDpi, info.ydpi);
env->SetBooleanField(infoObj, gPhysicalDisplayInfoClassInfo.secure, info.secure);
return JNI_TRUE; return JNI_TRUE;
} }
@@ -907,6 +909,7 @@ int register_android_view_Surface(JNIEnv* env)
gPhysicalDisplayInfoClassInfo.density = env->GetFieldID(clazz, "density", "F"); gPhysicalDisplayInfoClassInfo.density = env->GetFieldID(clazz, "density", "F");
gPhysicalDisplayInfoClassInfo.xDpi = env->GetFieldID(clazz, "xDpi", "F"); gPhysicalDisplayInfoClassInfo.xDpi = env->GetFieldID(clazz, "xDpi", "F");
gPhysicalDisplayInfoClassInfo.yDpi = env->GetFieldID(clazz, "yDpi", "F"); gPhysicalDisplayInfoClassInfo.yDpi = env->GetFieldID(clazz, "yDpi", "F");
gPhysicalDisplayInfoClassInfo.secure = env->GetFieldID(clazz, "secure", "Z");
return err; return err;
} }