am 75057b15: am 4de68bae: Merge "Check for the STATUS_BAR permission for the system UI properties." into honeycomb

* commit '75057b1507881625368f76b2f401097b606bd530':
  Check for the STATUS_BAR permission for the system UI properties.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2f349a0..68dd695 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1869,6 +1869,7 @@
      * This view's request for the visibility of the status bar.
      * @hide
      */
+    @ViewDebug.ExportedProperty()
     int mSystemUiVisibility;
 
     /**
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 5843ce3..2806774 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -47,6 +47,7 @@
 import android.Manifest;
 import android.app.ActivityManagerNative;
 import android.app.IActivityManager;
+import android.app.StatusBarManager;
 import android.app.admin.DevicePolicyManager;
 import android.content.BroadcastReceiver;
 import android.content.ClipData;
@@ -2758,6 +2759,15 @@
         boolean displayed = false;
         boolean inTouchMode;
         boolean configChanged;
+
+        // if they don't have this permission, mask out the status bar bits
+        if (attrs != null) {
+            if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR)
+                    != PackageManager.PERMISSION_GRANTED) {
+                attrs.systemUiVisibility &= ~StatusBarManager.DISABLE_MASK;
+                attrs.subtreeSystemUiVisibility &= ~StatusBarManager.DISABLE_MASK;
+            }
+        }
         long origId = Binder.clearCallingIdentity();
 
         synchronized(mWindowMap) {