summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2014-09-14 14:55:16 -0700
committerMichael Wright <michaelwr@google.com>2014-09-15 14:24:59 -0700
commita59e62341ceb4f27aa1dc8a664efba42d00d668c (patch)
tree6f05d8a700d023a573c9490dd7f0b6078695dc52 /services
parenta11757c187a5492e39ecc836dc72ff3752a483bd (diff)
downloadframeworks_base-a59e62341ceb4f27aa1dc8a664efba42d00d668c.zip
frameworks_base-a59e62341ceb4f27aa1dc8a664efba42d00d668c.tar.gz
frameworks_base-a59e62341ceb4f27aa1dc8a664efba42d00d668c.tar.bz2
Add config option for permanent dpad presence.
Since all TV devices are required to have a DPad as a form of navigation we should suppress any configuration instances where it claims one doesn't exist just because it isn't currently connected. This prevents applications from going through a configuration change and potentially an app restart when a remote disconnects to save battery. Bug: 17493314 Change-Id: Ice87b7056984afe02917ccba9196fdbcac9985fc
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 9033f30..a3da1e6 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -333,6 +333,8 @@ public class WindowManagerService extends IWindowManager.Stub
final boolean mHaveInputMethods;
+ final boolean mHasPermanentDpad;
+
final boolean mAllowBootMessages;
final boolean mLimitedAlphaCompositing;
@@ -804,6 +806,8 @@ public class WindowManagerService extends IWindowManager.Stub
mOnlyCore = onlyCore;
mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha);
+ mHasPermanentDpad = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_hasPermanentDpad);
mInputManager = inputManager; // Must be before createDisplayContentLocked.
mDisplayManagerInternal = LocalServices.getService(DisplayManagerInternal.class);
mDisplaySettings = new DisplaySettings(context);
@@ -7182,6 +7186,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ if (config.navigation == Configuration.NAVIGATION_NONAV && mHasPermanentDpad) {
+ config.navigation = Configuration.NAVIGATION_DPAD;
+ navigationPresence |= WindowManagerPolicy.PRESENCE_INTERNAL;
+ }
+
// Determine whether a hard keyboard is available and enabled.
boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
if (hardKeyboardAvailable != mHardKeyboardAvailable) {
@@ -10976,6 +10985,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
pw.println();
pw.print(" mCurConfiguration="); pw.println(this.mCurConfiguration);
+ pw.print(" mHasPermanentDpad="); pw.println(mHasPermanentDpad);
pw.print(" mCurrentFocus="); pw.println(mCurrentFocus);
if (mLastFocus != mCurrentFocus) {
pw.print(" mLastFocus="); pw.println(mLastFocus);