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/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 8df8177..568a5e3 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -16,21 +16,16 @@
 
 package com.android.server;
 
-import android.app.PendingIntent;
 import android.app.StatusBarManager;
 import android.content.BroadcastReceiver;
-import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
-import android.net.Uri;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.Binder;
 import android.os.Handler;
-import android.os.SystemClock;
 import android.util.Slog;
 import android.view.View;
 
@@ -248,25 +243,23 @@
      * Hide or show the on-screen Menu key. Only call this from the window manager, typically in
      * response to a window with FLAG_NEEDS_MENU_KEY set.
      */
-    public void setMenuKeyVisible(final boolean visible) {
+    public void topAppWindowChanged(final boolean menuVisible) {
         enforceStatusBar();
 
-        if (SPEW) Slog.d(TAG, (visible?"showing":"hiding") + " MENU key");
+        if (SPEW) Slog.d(TAG, (menuVisible?"showing":"hiding") + " MENU key");
 
         synchronized(mLock) {
-            if (mMenuVisible != visible) {
-                mMenuVisible = visible;
-                mHandler.post(new Runnable() {
-                        public void run() {
-                            if (mBar != null) {
-                                try {
-                                    mBar.setMenuKeyVisible(visible);
-                                } catch (RemoteException ex) {
-                                }
+            mMenuVisible = menuVisible;
+            mHandler.post(new Runnable() {
+                    public void run() {
+                        if (mBar != null) {
+                            try {
+                                mBar.topAppWindowChanged(menuVisible);
+                            } catch (RemoteException ex) {
                             }
                         }
-                    });
-            }
+                    }
+                });
         }
     }