diff options
author | Phil Tunstall <ptunstall@gmail.com> | 2012-07-27 12:02:38 +0100 |
---|---|---|
committer | DvTonder <david.vantonder@gmail.com> | 2012-12-10 19:45:42 -0500 |
commit | 607bdaefa337b73aed8d2ad7ac9439009a5522d1 (patch) | |
tree | 936305ab408f04c17a87b03a4347346bc0377a0f /src/com/android/settings/cyanogenmod/SystemSettings.java | |
parent | f4c96214f152a9fe196a50d9443d3af9ca507eb4 (diff) | |
download | packages_apps_settings-607bdaefa337b73aed8d2ad7ac9439009a5522d1.zip packages_apps_settings-607bdaefa337b73aed8d2ad7ac9439009a5522d1.tar.gz packages_apps_settings-607bdaefa337b73aed8d2ad7ac9439009a5522d1.tar.bz2 |
Settings: Forward port Hardware key custom rebinding (2/2)
Settings for rebinding the actions performed on the following key press events:
Home long-press, menu press, menu long-press, search press, search long-press,
app-switch press and app-switch long-press.
The available actions are: Nothing, open/close menu, recent apps switcher,
search assistant, voice search and in-app search.
Devices with a key configuration other than home, back, menu and search need to
set config_deviceHardwareKeys in an overlay to have the correct preferences
show up.
Change-Id: Id04a598aeb9829d7971dedbd171a61999ce2f919
Diffstat (limited to 'src/com/android/settings/cyanogenmod/SystemSettings.java')
-rw-r--r-- | src/com/android/settings/cyanogenmod/SystemSettings.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/settings/cyanogenmod/SystemSettings.java b/src/com/android/settings/cyanogenmod/SystemSettings.java index 586ef07..703a10d 100644 --- a/src/com/android/settings/cyanogenmod/SystemSettings.java +++ b/src/com/android/settings/cyanogenmod/SystemSettings.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 CyanogenMod + * Copyright (C) 2012 The CyanogenMod project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,13 @@ package com.android.settings.cyanogenmod; +import android.content.Context; import android.os.Bundle; +import android.os.RemoteException; +import android.os.ServiceManager; import android.preference.PreferenceScreen; import android.provider.Settings; +import android.view.IWindowManager; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; @@ -28,6 +32,7 @@ public class SystemSettings extends SettingsPreferenceFragment { private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; private static final String KEY_BATTERY_LIGHT = "battery_light"; + private static final String KEY_HARDWARE_KEYS = "hardware_keys"; private PreferenceScreen mNotificationPulse; private PreferenceScreen mBatteryPulse; @@ -55,6 +60,17 @@ public class SystemSettings extends SettingsPreferenceFragment { updateBatteryPulseDescription(); } } + + // Only show the hardware keys config on a device that does not have a navbar + IWindowManager windowManager = IWindowManager.Stub.asInterface( + ServiceManager.getService(Context.WINDOW_SERVICE)); + try { + if (windowManager.hasNavigationBar()) { + getPreferenceScreen().removePreference(findPreference(KEY_HARDWARE_KEYS)); + } + } catch (RemoteException e) { + // Do nothing + } } private void updateLightPulseDescription() { |