diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-10-06 22:35:11 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-10-07 14:32:01 -0700 |
commit | df89e65bf0fcc651d20b208c8d8d0b848fb43418 (patch) | |
tree | f8e48a203c551b8fd834aad34c1f5fe6d2755461 /core/java/android/view | |
parent | 25d888b5ff23acf1a9d41bef3e74ee897baf5ad7 (diff) | |
download | frameworks_base-df89e65bf0fcc651d20b208c8d8d0b848fb43418.zip frameworks_base-df89e65bf0fcc651d20b208c8d8d0b848fb43418.tar.gz frameworks_base-df89e65bf0fcc651d20b208c8d8d0b848fb43418.tar.bz2 |
Fix how we hide and show the nav bar.
The PhoneWindowManager is now responsible for hiding and showing
the nav bar.
For hiding, it just moves it off the screen (easy way to get a
nice slide animation on and off). At the same time, we use a
new WM facility to put up a fake input window to capture all
touch events.
When a touch event is received, we force the system UI to clear
the navigation hiding bit so it will be shown again.
This removes a bunch of code from the system UI for hiding and
showing the nav bar. Also removes the code calling from userActivity()
to the system UI, which was bad. (Also no longer using userActivity()
fixes bugs around re-showing the nav bar due to key presses and
other wrong things.)
Change-Id: I8c3174873b5bcaa36a92322a51e8f7993e88e551
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/WindowManager.java | 7 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 42 |
2 files changed, 48 insertions, 1 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 99acb3f..e8ab227 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -416,6 +416,13 @@ public interface WindowManager extends ViewManager { public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21; /** + * Window type: Fake window to consume touch events when the navigation + * bar is hidden. + * @hide + */ + public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22; + + /** * End of types of system windows. */ public static final int LAST_SYSTEM_WINDOW = 2999; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index aaf45e5..bfd2959 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.IBinder; import android.os.LocalPowerManager; +import android.os.Looper; import android.view.animation.Animation; import java.io.FileDescriptor; @@ -315,6 +316,36 @@ public interface WindowManagerPolicy { } /** + * Representation of a "fake window" that the policy has added to the + * window manager to consume events. + */ + public interface FakeWindow { + /** + * Remove the fake window from the window manager. + */ + void dismiss(); + } + + /** + * Interface for calling back in to the window manager that is private + * between it and the policy. + */ + public interface WindowManagerFuncs { + /** + * Ask the window manager to re-evaluate the system UI flags. + */ + public void reevaluateStatusBarVisibility(); + + /** + * Add a fake window to the window manager. This window sits + * at the top of the other windows and consumes events. + */ + public FakeWindow addFakeWindow(Looper looper, InputHandler inputHandler, + String name, int windowType, int layoutParamsFlags, boolean canReceiveKeys, + boolean hasFocus, boolean touchFullscreen); + } + + /** * Bit mask that is set for all enter transition. */ public final int TRANSIT_ENTER_MASK = 0x1000; @@ -395,6 +426,7 @@ public interface WindowManagerPolicy { * @param powerManager */ public void init(Context context, IWindowManager windowManager, + WindowManagerFuncs windowManagerFuncs, LocalPowerManager powerManager); /** @@ -762,7 +794,7 @@ public interface WindowManagerPolicy { /** * A new window has been focused. */ - public void focusChanged(WindowState lastFocus, WindowState newFocus); + public int focusChangedLw(WindowState lastFocus, WindowState newFocus); /** * Called after the screen turns off. @@ -968,6 +1000,14 @@ public interface WindowManagerPolicy { public void setUserRotationMode(int mode, int rotation); /** + * Called when a new system UI visibility is being reported, allowing + * the policy to adjust what is actually reported. + * @param visibility The raw visiblity reported by the status bar. + * @return The new desired visibility. + */ + public int adjustSystemUiVisibilityLw(int visibility); + + /** * Print the WindowManagerPolicy's state into the given stream. * * @param prefix Text to print at the front of each line. |