diff options
author | Adam Powell <adamp@google.com> | 2010-08-24 14:18:10 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2010-08-24 14:18:10 -0700 |
commit | f4a6ec4e9398c1beb019e1c208272bf56401f925 (patch) | |
tree | 162fd050fa96d371f0adc3577e597c598d113d55 /policy | |
parent | 0a5699654f33fc41a9baed26abb9b867ba439399 (diff) | |
download | frameworks_base-f4a6ec4e9398c1beb019e1c208272bf56401f925.zip frameworks_base-f4a6ec4e9398c1beb019e1c208272bf56401f925.tar.gz frameworks_base-f4a6ec4e9398c1beb019e1c208272bf56401f925.tar.bz2 |
Disable FEATURE_ACTION_BAR on windows with incompatible feature sets.
Change-Id: I70c860c72eb9e1f1f123764202334ab714f4f830
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 2dabf72..ca9a484 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -199,6 +199,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { /* Custom title feature is enabled and the user is trying to enable another feature */ throw new AndroidRuntimeException("You cannot combine custom titles with other title features"); } + if ((features & (1 << FEATURE_NO_TITLE)) != 0 && featureId == FEATURE_ACTION_BAR) { + return false; // Ignore. No title dominates. + } + if ((features & (1 << FEATURE_ACTION_BAR)) != 0 && featureId == FEATURE_NO_TITLE) { + // Remove the action bar feature if we have no title. No title dominates. + removeFeature(FEATURE_ACTION_BAR); + } return super.requestFeature(featureId); } @@ -2365,11 +2372,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } else { layoutResource = com.android.internal.R.layout.screen_title_icons; } + // XXX Remove this once action bar supports these features. + removeFeature(FEATURE_ACTION_BAR); // System.out.println("Title Icons!"); } else if ((features & ((1 << FEATURE_PROGRESS) | (1 << FEATURE_INDETERMINATE_PROGRESS))) != 0) { // Special case for a window with only a progress bar (and title). // XXX Need to have a no-title version of embedded windows. layoutResource = com.android.internal.R.layout.screen_progress; + // XXX Remove this once action bar supports these features. + removeFeature(FEATURE_ACTION_BAR); // System.out.println("Progress!"); } else if ((features & (1 << FEATURE_CUSTOM_TITLE)) != 0) { // Special case for a window with a custom title. @@ -2379,6 +2390,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } else { layoutResource = com.android.internal.R.layout.screen_custom_title; } + // XXX Remove this once action bar supports these features. + removeFeature(FEATURE_ACTION_BAR); } else if ((features & (1 << FEATURE_NO_TITLE)) == 0) { // If no other features and not embedded, only need a title. // If the window is floating, we need a dialog layout |