summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/SurfaceView.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-10-24 12:17:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-24 12:17:04 -0700
commitd9fb5848c8f049b1b2e08b415e40e08de814c5e5 (patch)
tree45fe542c3e88e891419c83be4a94753ded4a05cd /core/java/android/view/SurfaceView.java
parent11181c7ae6a9f8278fbf99676b3476173b18b098 (diff)
parent1202c43685c475158a773d03d70effa01b6bb4ff (diff)
downloadframeworks_base-d9fb5848c8f049b1b2e08b415e40e08de814c5e5.zip
frameworks_base-d9fb5848c8f049b1b2e08b415e40e08de814c5e5.tar.gz
frameworks_base-d9fb5848c8f049b1b2e08b415e40e08de814c5e5.tar.bz2
am 1202c436: Merge "Secure windows, secure surface views and secure displays." into jb-mr1-dev
* commit '1202c43685c475158a773d03d70effa01b6bb4ff': Secure windows, secure surface views and secure displays.
Diffstat (limited to 'core/java/android/view/SurfaceView.java')
-rw-r--r--core/java/android/view/SurfaceView.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 0d16dd3..9008521 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -385,7 +385,27 @@ public class SurfaceView extends View {
mLayout.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
}
}
-
+
+ /**
+ * Control whether the surface view's content should be treated as secure,
+ * preventing it from appearing in screenshots or from being viewed on
+ * non-secure displays.
+ *
+ * <p>Note that this must be set before the surface view's containing
+ * window is attached to the window manager.
+ *
+ * <p>See {@link android.view.Display#FLAG_SECURE} for details.
+ *
+ * @param isSecure True if the surface view is secure.
+ */
+ public void setSecure(boolean isSecure) {
+ if (isSecure) {
+ mLayout.flags |= WindowManager.LayoutParams.FLAG_SECURE;
+ } else {
+ mLayout.flags &= ~WindowManager.LayoutParams.FLAG_SECURE;
+ }
+ }
+
/**
* Hack to allow special layering of windows. The type is one of the
* types in WindowManager.LayoutParams. This is a hack so: