{"push_id":621989106,"size":1,"distinct_size":1,"ref":"refs/heads/lp5.0-caf","head":"92ba135abb650f52cb75a4aefd9896a5aca3c0d6","before":"5097f9210c0dfa05be80281e5a97bb2e2b446fe7","commits":[{"sha":"92ba135abb650f52cb75a4aefd9896a5aca3c0d6","author":{"email":"906ecc648efce5c6d4226cafc47e54f0b35a2621@gmail.com","name":"ralpheeee88"},"message":"[2/2] Settings: Slims Hardware Key Rebinding\n\nFirst thanks to CM team for the 2 years where we used their approach for our\ncustom hw key rebinding. This hardware key rebinding\npatches did in the past a good job and we extended it prior 4.3 with a lot\nSlim custom stuff.\n\nBut it is time to go new way and to do the complete\nhardware key rebinding more flexible and more centralized. Especially due\nthat we have now all possible shorcutactions centralized in 4.4\n\nPossible mapping are:\nACTION_HOME\nACTION_BACK\nACTION_SEARCH (in app search)\nACTION_VOICE_SEARCH\nACTION_MENU_BIG\nACTION_POWER\nACTION_NOTIFICATIONS\nACTION_QS\nACTION_RECENTS\nACTION_SCREENSHOT\nACTION_IME\nACTION_LAST_APP\nACTION_KILL\nACTION_ASSIST\nACTION_VIB\nACTION_SILENT\nACTION_VIB_SILENT\nACTION_POWER_MENU\nACTION_TORCH\nACTION_EXPANDED_DESKTOP\nACTION_THEME_SWITCH\n\nand custom app/shorcut of course\n\nPossible actions on all keys are:\nnormal tap / longpress / double tap\n\nSo to sumarize if it is in settings array enabled user can bind whatever of the above\nactions to every hardware key action.\n\nMain changes to prior solutions are:\n- do not depend anymore on hardcoded integer values. We use now strings. This has\n  the advantage that we can save whatever shorcut or intent URI we have into this\n  value. And gives us the possibility in future without changing anything on the hw\n  key rebinding code to get more options/or modify the options. Actions are holded\n  like on all other of our features in ButtonsConstants.java\n- All actions are peformed over our SlimActions like all other features. SlimActions\n  takes care about all possible solutions the user can run into and sets the right\n  open animation, keyguard handling etc etc. As well it is easier to maintain only\n  one code base.\n- Only observe and update the values on hardware key devices. On non hw key devices\n  the complete code is non operational\n- Removed in settings the not needed overlay due that we can use the fb one to\n  check if it is a hw key device or not.\n- Major cleanup of a lot old code.\n\nThis patch add as well one new SlimActions action....VOICE_SEARCH\n\nTo configure your device you need to add the device overlay as usual:\n\noverlay/frameworks/base/core/res/res/values/config.xml\n<!-- Hardware \"softkeys\" present on the device, stored as a bit field.\n         This integer should equal the sum of the corresponding value for each\n         of the following keys present:\n            1 - Home\n            2 - Back\n            4 - Menu\n            8 - Assistant (search)\n           16 - App switch\n        For example, a device with Home, Back and Menu keys would set this\n        config to 7. -->\n    <integer name=\"config_deviceHardwareKeys\">7</integer>\n\nAlso requires fb commit.\n\nCheers HCP and kufi\n\nChanges to prior patchsets:\n- reflect fb changes\n- simplify code\n- code cleanup\n- instance handling of error dialog\n- some minor tweaks\n\nPS:\n- complete reworked....using now like on navbar etc custom dialogs to be\n  consistent and pretty :D\n- reset to default is not implemented yet...no idea if we want that or not. Any opinions on it?\n\nPS:\n- implement fb changes and use central HwKeyHelper class\n\nPS:\n- added reset button\n\nPS:\n- added double tap to all bindable keys\n\nChange-Id: Ie4794073236f0b6fe308b931d7d6e9d02a1ddf02\nSigned-off-by: reS28raM <reS28raMv2@gmail.com>\n\nConflicts:\n\tres/values/config.xml\n\tres/values/slim_arrays.xml\n\tres/values/slim_strings.xml\n\tres/xml/slim_navigation_settings.xml\n\tsrc/com/android/settings/slim/NavigationSettings.java\n\nRemove nav key settings from HW key rebinding commits for devices\nthat have soft keys.\n\nChange-Id: Ie3ef3194930dce38ee05332f5b4d402aae37ad5c\nSigned-off-by: reS28raM <reS28raMv2@gmail.com>\n\nConflicts:\n\tres/values/slim_strings.xml","distinct":true,"url":"https://api.github.com/repos/ralpheeee88/packages_apps_Settings/commits/92ba135abb650f52cb75a4aefd9896a5aca3c0d6"}]}