Fix issue #4603422: Compatibility mode button doesn't always update

We now tell the system bar every time the top activity has changed for
it to re-evaluate its UI state.

Also fix issue #: 4607102 Low rider notifications.  It turns out this
was due to the change in the dialog asset; the notification UI was relying
on this having a lot of padding to make it sit above the status bar.
Now we have an explicitly mechanism to set how much it overlaps (or doesn't)
the status bar.

Change-Id: Iab5ebd86e620ff4fc4cd77206e18af962ec2830e
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index d55a7c2..07f9ad8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -54,7 +54,7 @@
 
     private static final int MSG_SET_LIGHTS_ON = 0x00070000;
 
-    private static final int MSG_SHOW_MENU = 0x00080000;
+    private static final int MSG_TOP_APP_WINDOW_CHANGED = 0x00080000;
     private static final int MSG_SHOW_IME_BUTTON = 0x00090000;
     private static final int MSG_SET_HARD_KEYBOARD_STATUS = 0x000a0000;
 
@@ -82,7 +82,7 @@
         public void animateExpand();
         public void animateCollapse();
         public void setLightsOn(boolean on);
-        public void setMenuKeyVisible(boolean visible);
+        public void topAppWindowChanged(boolean visible);
         public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
         public void setHardKeyboardStatus(boolean available, boolean enabled);
     }
@@ -160,10 +160,11 @@
         }
     }
 
-    public void setMenuKeyVisible(boolean visible) {
+    public void topAppWindowChanged(boolean menuVisible) {
         synchronized (mList) {
-            mHandler.removeMessages(MSG_SHOW_MENU);
-            mHandler.obtainMessage(MSG_SHOW_MENU, visible ? 1 : 0, 0, null).sendToTarget();
+            mHandler.removeMessages(MSG_TOP_APP_WINDOW_CHANGED);
+            mHandler.obtainMessage(MSG_TOP_APP_WINDOW_CHANGED, menuVisible ? 1 : 0, 0,
+                    null).sendToTarget();
         }
     }
 
@@ -240,8 +241,8 @@
                 case MSG_SET_LIGHTS_ON:
                     mCallbacks.setLightsOn(msg.arg1 != 0);
                     break;
-                case MSG_SHOW_MENU:
-                    mCallbacks.setMenuKeyVisible(msg.arg1 != 0);
+                case MSG_TOP_APP_WINDOW_CHANGED:
+                    mCallbacks.topAppWindowChanged(msg.arg1 != 0);
                     break;
                 case MSG_SHOW_IME_BUTTON:
                     mCallbacks.setImeWindowStatus((IBinder)msg.obj, msg.arg1, msg.arg2);