import android.graphics.*;
import android.os.Parcelable;
import android.os.Parcel;
+import android.os.SystemProperties;
import android.util.Log;
/**
public static final int ROTATION_180 = 2;
public static final int ROTATION_270 = 3;
+ private static final boolean headless = "1".equals(
+ SystemProperties.get("ro.config.headless", "0"));
+
+ private static void checkHeadless() {
+ if(headless) {
+ throw new UnsupportedOperationException("Device is headless");
+ }
+ }
+
/**
* Create Surface from a {@link SurfaceTexture}.
*
* Surface.
*/
public Surface(SurfaceTexture surfaceTexture) {
+ checkHeadless();
+
if (DEBUG_RELEASE) {
mCreationStack = new Exception();
}
public Surface(SurfaceSession s,
int pid, int display, int w, int h, int format, int flags)
throws OutOfResourcesException {
+ checkHeadless();
+
if (DEBUG_RELEASE) {
mCreationStack = new Exception();
}
public Surface(SurfaceSession s,
int pid, String name, int display, int w, int h, int format, int flags)
throws OutOfResourcesException {
+ checkHeadless();
+
if (DEBUG_RELEASE) {
mCreationStack = new Exception();
}
* @hide
*/
public Surface() {
+ checkHeadless();
+
if (DEBUG_RELEASE) {
mCreationStack = new Exception();
}