[APP] Button Mapper - Customize your hardware buttons

Search This thread

stormy1777

Senior Member
Feb 12, 2016
159
44
Having this crazy experience after trying the Button Mapper few weeks, realized it's probably not what i'm after, since trying to find more ways to NOT press keys on the device..

in any event, UNINSTALLED, and as soon as that is done, the vol keys stop working!! Using Redmi 7A (MIUI10, Android 9)..

Tried again and again, each time, when app is installed, vol keys working fine (in phone, and youtube for volume), as soon as it is removed, they completely stop working for volume purposes.

It's not a physical issue , since screenshot is POWER + VOLDOWN and that works, but VOLDOWN itself does not work (when app is not installed).

Tried reboot, and it fixes the issue for short time, but after few hours again, vol keys do not work.. install the Button Mapper app and everything works immediately (no reboot required). Uninstall the app, and vol keys are non-functional again :)

Tried "Restore to Defaults" in menu app, but no luck..

Using logcat captured these lines when the app IS installed:


Code:
05-15 11:05:10.131  1596  3072 D MediaSessionService: dispatchVolumeKeyEvent, pkg=flar2.homebutton, pid=28020, uid=10355, asSystem=true, event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_VOLUME_UP, scanCode=115, metaState=0, flags=0x8, repeatCount=22, eventTime=31830660, downTime=31829090, deviceId=6, source=0x101 }
05-15 11:05:10.131  1596  3072 D MediaSessionService: Adjusting null by 1. flags=4113, suggestedStream=-2147483648, preferSuggestedStream=false
05-15 11:05:10.135   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.135   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.135   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.135   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.135   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.135   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.135   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.136   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.136   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.136   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.136   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.136   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.136   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.136   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.183  1596  6427 D MediaSessionService: dispatchVolumeKeyEvent, pkg=flar2.homebutton, pid=28020, uid=10355, asSystem=true, event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_VOLUME_UP, scanCode=115, metaState=0, flags=0x8, repeatCount=23, eventTime=31830710, downTime=31829090, deviceId=6, source=0x101 }
05-15 11:05:10.183  1596  6427 D MediaSessionService: Adjusting null by 1. flags=4113, suggestedStream=-2147483648, preferSuggestedStream=false
05-15 11:05:10.187   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.188   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.188   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.188   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.188   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.188   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.188   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.189   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.189   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.189   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.189   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.189   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.189   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -




by comparison these lines when app is not installed and button is pressed:

Code:
05-15 11:08:29.840  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:29.842  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.041  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.041  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32030570 downTime:32030370 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.150  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32030680 downTime:32030680 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.150  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.152  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.156   726   726 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
05-15 11:08:30.242   726   726 I chatty  : uid=1000(system) /system/bin/surfaceflinger identical 7 lines
05-15 11:08:30.242   726   726 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
05-15 11:08:30.361  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.361  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32030890 downTime:32030680 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.461  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32030990 downTime:32030990 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.460  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.461  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.653   850  2167 D         : readbrightness,out1:2047V▒▒▒▒l)▒▒.
05-15 11:08:30.653   850  2167 D         : readbrightness,out2:2047.
05-15 11:08:30.671  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.672  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32031200 downTime:32030990 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.791  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32031320 downTime:32031320 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.790  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.792  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.991  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.992  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32031520 downTime:32031320 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:31.081  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32031610 downTime:32031610 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:31.080  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:31.082  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567


a) Is this a known issue?
b) What is the component in MIUI/Android that is supposed to handle this functionality?
c) How to force/refresh default volume key behavior? Tried restarting Launcher, did not help, any other app/process to restart (short of rebooting every few hours ) ?

Thanks much.
 

flar2

Recognized Developer
Jun 11, 2012
18,786
87,756
Southwestern Ontario
elementalx.org
Having this crazy experience after trying the Button Mapper few weeks, realized it's probably not what i'm after, since trying to find more ways to NOT press keys on the device..

in any event, UNINSTALLED, and as soon as that is done, the vol keys stop working!! Using Redmi 7A (MIUI10, Android 9)..

Tried again and again, each time, when app is installed, vol keys working fine (in phone, and youtube for volume), as soon as it is removed, they completely stop working for volume purposes.

It's not a physical issue , since screenshot is POWER + VOLDOWN and that works, but VOLDOWN itself does not work (when app is not installed).

Tried reboot, and it fixes the issue for short time, but after few hours again, vol keys do not work.. install the Button Mapper app and everything works immediately (no reboot required). Uninstall the app, and vol keys are non-functional again :)

Tried "Restore to Defaults" in menu app, but no luck..

Using logcat captured these lines when the app IS installed:


Code:
05-15 11:05:10.131  1596  3072 D MediaSessionService: dispatchVolumeKeyEvent, pkg=flar2.homebutton, pid=28020, uid=10355, asSystem=true, event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_VOLUME_UP, scanCode=115, metaState=0, flags=0x8, repeatCount=22, eventTime=31830660, downTime=31829090, deviceId=6, source=0x101 }
05-15 11:05:10.131  1596  3072 D MediaSessionService: Adjusting null by 1. flags=4113, suggestedStream=-2147483648, preferSuggestedStream=false
05-15 11:05:10.135   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.135   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.135   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.135   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.135   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.135   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.135   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.136   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.136   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.136   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.136   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.136   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.136   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.136   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.183  1596  6427 D MediaSessionService: dispatchVolumeKeyEvent, pkg=flar2.homebutton, pid=28020, uid=10355, asSystem=true, event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_VOLUME_UP, scanCode=115, metaState=0, flags=0x8, repeatCount=23, eventTime=31830710, downTime=31829090, deviceId=6, source=0x101 }
05-15 11:05:10.183  1596  6427 D MediaSessionService: Adjusting null by 1. flags=4113, suggestedStream=-2147483648, preferSuggestedStream=false
05-15 11:05:10.187   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.188   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.188   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.188   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.188   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.188   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -
05-15 11:05:10.188   723   876 I hash_map_utils: key: 'hifi_mode' value: ''
05-15 11:05:10.189   667 16516 D audio_hw_primary: adev_get_parameters:hifi_mode=
05-15 11:05:10.189   667 16516 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
05-15 11:05:10.189   667 16516 D soundtrigger: audio_extn_sound_trigger_get_parameters input string<hifi_mode=>
05-15 11:05:10.189   667 16516 D soundtrigger: extract_sm_handle input string <hifi_mode=> param string <hifi_mode=>
05-15 11:05:10.189   667 16516 D audio_hw_extn: audio_extn_get_parameters: returns
05-15 11:05:10.189   667 16516 D audio_hw_primary: adev_get_parameters: exit: returns -




by comparison these lines when app is not installed and button is pressed:

Code:
05-15 11:08:29.840  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:29.842  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.041  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.041  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32030570 downTime:32030370 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.150  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32030680 downTime:32030680 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.150  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.152  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.156   726   726 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
05-15 11:08:30.242   726   726 I chatty  : uid=1000(system) /system/bin/surfaceflinger identical 7 lines
05-15 11:08:30.242   726   726 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
05-15 11:08:30.361  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.361  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32030890 downTime:32030680 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.461  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32030990 downTime:32030990 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.460  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.461  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.653   850  2167 D         : readbrightness,out1:2047V▒▒▒▒l)▒▒.
05-15 11:08:30.653   850  2167 D         : readbrightness,out2:2047.
05-15 11:08:30.671  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.672  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32031200 downTime:32030990 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.791  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32031320 downTime:32031320 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:30.790  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.792  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567 android.app.ContextImpl.sendBroadcastAsUser:1195 com.android.server.policy.BaseMiuiPhoneWindowManager$16.run:2396 android.os.Handler.handleCallback:873
05-15 11:08:30.991  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:30.992  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:false eventTime:32031520 downTime:32031320 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:31.081  1596  2060 W BaseMiuiPhoneWindowManager: keyCode:24 down:true eventTime:32031610 downTime:32031610 policyFlags:22000000 flags:8 deviceId:6 isScreenOn:true keyguardActive:false repeatCount:0
05-15 11:08:31.080  1596  2060 D KeyLayoutMap: mapKey: scanCode=115, usageCode=0x00000000 ~ Result keyCode=24, outFlags=0x00000000.
05-15 11:08:31.082  1596  1786 W ActivityManager: Sending non-protected broadcast miui.intent.action.KEYCODE_EXTERNAL from system 1596:system/1000 pkg android. Callers=com.android.server.am.ActivityManagerService.broadcastIntentLocked:22424 com.android.server.am.ActivityManagerService.broadcastIntent:22567


a) Is this a known issue?
b) What is the component in MIUI/Android that is supposed to handle this functionality?
c) How to force/refresh default volume key behavior? Tried restarting Launcher, did not help, any other app/process to restart (short of rebooting every few hours ) ?

Thanks much.


If Button Mapper is not installed, it has absolutely no effect on your device. Uninstall Button Mapper and reboot. Any further issues are not related to this app
 

stormy1777

Senior Member
Feb 12, 2016
159
44
If Button Mapper is not installed, it has absolutely no effect on your device. Uninstall Button Mapper and reboot. Any further issues are not related to this app
Thanks... is there no possibility the app changed some "static state" on the device, and even after removing it remains.. after uninstall and reboot, vol keys work ok, but few hours later, they stop working...
once button mapper is installed, keys work right away and keep working, sort of like i must have it installed, without any configuration at all, for keys to work ok.. very strange... i just don't know enough about how/why such basic functionality would not work :)
 

flar2

Recognized Developer
Jun 11, 2012
18,786
87,756
Southwestern Ontario
elementalx.org
Thanks... is there no possibility the app changed some "static state" on the device, and even after removing it remains.. after uninstall and reboot, vol keys work ok, but few hours later, they stop working...
once button mapper is installed, keys work right away and keep working, sort of like i must have it installed, without any configuration at all, for keys to work ok.. very strange... i just don't know enough about how/why such basic functionality would not work :)
A third party app can't change anything on your device. This is likely some weird MIUI thing, Xiaomi makes some nice hardware, but they really mess with Android internals.
 

Artieza

Senior Member
Mar 17, 2016
467
173
LG G8
LG V60 ThinQ
I found a bug. About Assistant button. I configured one press and long press. Long press is broken. It vibrates a lot, triggers one press action and long press action together. I noticed that long press seems to work properly if Zello PTT is enabled. Nothing happens for me but vibration seems ok. I don't know what is Zello PTT. Could you fix this issue?
 

flar2

Recognized Developer
Jun 11, 2012
18,786
87,756
Southwestern Ontario
elementalx.org
I found a bug. About Assistant button. I configured one press and long press. Long press is broken. It vibrates a lot, triggers one press action and long press action together. I noticed that long press seems to work properly if Zello PTT is enabled. Nothing happens for me but vibration seems ok. I don't know what is Zello PTT. Could you fix this issue?
This will be highly on your hardware, it's different on every device.

Try changing the alternate button handling option.
 

fecchan

Member
Mar 11, 2017
16
7
LG V60, android 11. No setting to enable screen off long press action. Already enabled permission through ADB to write secure settings, volume listener, even keyevent.sh. Where it went?
Screenshot_20220522-131341.png
 

MarkLev

Senior Member
Dec 24, 2019
84
80
Installed this app on androidTV TCL 55P615 model running Android 11. Everytime the TV restarts, I have to also reset "accessibility right" to make the app work.

Anyone got this issue? Any solution?
 

MarkLev

Senior Member
Dec 24, 2019
84
80
@flar2 what is the servicename if I want the below adb commands to set accessibility and start the app service?

Bash:
adb shell settings put secure enabled_accessibility_services flar2.homebutton/servicename
adb shell am startservice flar2.homebutton/servicename
 

flar2

Recognized Developer
Jun 11, 2012
18,786
87,756
Southwestern Ontario
elementalx.org
@flar2 what is the servicename if I want the below adb commands to set accessibility and start the app service?

Bash:
adb shell settings put secure enabled_accessibility_services flar2.homebutton/servicename
adb shell am startservice flar2.homebutton/servicename
IIRC, the service name is a.ai

You can also do this to allow the app to start the service itself

adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
 
  • Like
Reactions: MarkLev

flar2

Recognized Developer
Jun 11, 2012
18,786
87,756
Southwestern Ontario
elementalx.org
Add above WRITE_SECURE_SETTINGS permission and disable "Safety Guard Auto Launch" for ButtonMapper solved my accessibility issue on TCL android 11 TV.
Thank you.
Google really needs to crack down in manufacturers breaking Android. So many TVs hide or disable accessibility, despite the fact that disabled people use TVs. And now they are preventing accessibility from starting at boot, which is different from other apps, which use the "on boot complete" intent. Accessibility is supposed to start automatically even without that.
 
  • Like
Reactions: MarkLev

MarkLev

Senior Member
Dec 24, 2019
84
80
@flar2 Is there a way to support multiple profiles?
can profiles be activated through shell command?
I imagine creating some some profiles and can activate them quickly using termux:widget

Edit: or maybe restore a backup using shell command? This way is simple enough to implement and can easily achieve the above purpose.
 

mremmawatson

New member
Jun 2, 2022
1
0
Hey, I'm trying to use this app for a Galaxy s8. Android version is 9. I'm trying to remap bixby to work as a power button to turn on/off the phone because my power button broke off. I can customize the button but I don't see where you can make it so you can turn the phone on with just 1 click of the Bixby button when the phone is turned off (locked).
 
Last edited:

GivIn2It

Member
Jul 12, 2021
40
14
Samsung Galaxy A52 5G
I'm wondering why no one answered this guy's post, it would be damn handy to remap HDMI inputs, and I can't figure out how to do it on my Hisense android remote. AND I paid for the pro version. It is the only reason I bought the program. I did the USB Cable app step from windows. Posting follows:

flar2

Recognized Developer Jun 11, 2012 Southwestern Ontario
  • Nov 19, 2021
  • #2,424

  • Hi, if someone could help out a bit. I have a Philips android Tv and I want to map a button to switch to HDMI 1. I can send: adb shell input keyevent KEYCODE_F6 from the computer and

    adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

    but I am not able to make it work in Button mapper. I have the Pro version.

    Click to collapse
    Did you try the "broadcast intent" action?

    luksson

    Member​

    Nov 1, 2010 Halmstad
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Okay so I managed to make it work. In case anyone needs an idea how Broadcast Intent works here's my experience.

    I wanted to go straight to a specific section in the settings. Here's how you can do it.

    1. Figure out what the activity is. I have only one way of figuring this out and that's by installing Activity Launcher from the PlayStore, find the activity I wanted.

    1.a. I wanted to go straight to the Picture settings. So inside Activity Launcher I searched Picture and I just tried to narrow it down. You can try to launch the listed activities so you know it's the right one.

    1.b. When you try to launch the activity there will be a toast and watch it closely and remember what is written. In my case it said it started intent: com.android.tv.settings/.partnercustomizer.picture.PictureActivity

    1.c. Take note of the activity class. It is written right there in the list. In my case it's com.android.tv.settings.partnercustomizer.picture.PictureActivity.

    2. Once we have the activity class we can go to the Button Mapper app.

    2.a. Go to the button you want to customize, pick the event you want to hook it into.

    2.b. Pick Broadcast Intent. And here's how you will fill it in based in my example activity class in 1.c.

    Action: /.partnercustomizer.picture.PictureActivity
    Package: com.android.tv.settings
    Component: com.android.tv.settings.partnercustomizer.picture.PictureActivity

    Note: The action starts with the forward slash. You saw in 1.b. that when the intent was launched, there was that forward slash just right after the package name.

    So that is it. That's how I managed to make it work and maybe it will be the same for other activities I'll want to launch by broadcasting an intent.

    Thanks @flar2 for an amzing software. The Pro version is worth it for that price. It was a steal to be honest.
    1
    IIRC, the service name is a.ai

    You can also do this to allow the app to start the service itself

    adb shell pm grant flar2.homebutton android.permission.WRITE_SECURE_SETTINGS
    Add above WRITE_SECURE_SETTINGS permission and disable "Safety Guard Auto Launch" for ButtonMapper solved my accessibility issue on TCL android 11 TV.
    Thank you.
    1
    Add above WRITE_SECURE_SETTINGS permission and disable "Safety Guard Auto Launch" for ButtonMapper solved my accessibility issue on TCL android 11 TV.
    Thank you.
    Google really needs to crack down in manufacturers breaking Android. So many TVs hide or disable accessibility, despite the fact that disabled people use TVs. And now they are preventing accessibility from starting at boot, which is different from other apps, which use the "on boot complete" intent. Accessibility is supposed to start automatically even without that.
    1
    Oh, do Android TVs have adb server built in? I didn't know.

    Maybe when I need to run other commands, I'll give that a try. But for now, my purpose is to launch activities and the Broadcast Intent handles it so that should ve good for now.

    Thanks for the tip though! I'll find uses for that in the future.

    EDIT:

    I may have misunderstood your comment. I checked and there's no adb binary in the /system/bin so that might not work.
    You can use Termux app, and install adb binary
    1
    But can you access Termux binaries (adb along with it) inside Button Mapper shell execution?
    You can use RUN_COMMAND Intent. Refer "top command with am startservice command"
  • 142
    p2142635636.jpg



    Button Mapper allows you to remap any action you want to physical or capacitive hardware buttons. This includes volume buttons, camera button, home button on Samsung devices and capacitive home, back and recents, Bixby, Active Edge, LG assistant button and many buttons on game controllers and other hardware. It does NOT work with onscreen home, back and recents buttons (i.e. soft keys or the navigation bar).

    You can launch shortcuts, apps or actions to single press, double tap and long press for hardware buttons.





    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    Limitations:
    -does not work when the screen is off (unless rooted)
    -only works with hardware buttons, not onscreen buttons (i.e. navigation bar)
    -power button cannot be modified
    -there can be quirks with some devices due to non-standard hardware and software implementations by various manufacturers. I try to fix them, but sometimes it's difficult if I don't have the device to test.




    .
    31
    Examples of things you can do with this app:

    -Lockscreen peek: press and hold the home button to quickly check your lockscreen messages, release to turn off the screen (requires PRO VERSION)
    -Launch an app by long pressing the home button
    -Swap the back and recents buttons (capacitive buttons only, like on Samsung Galaxy or Asus Zenfone or One Plus One)
    -Use the home button to the turn the screen off from the homescreen on your Samsung Galaxy (requires PRO VERSION)
    -Control the button lights on your Samsung Galaxy. Turn them on or off, or change the length of time they light up
    18
    Big update!


    After many weeks of work, I've released an update that adds many new features and improvements, and fixes some longstanding bugs.

    The new version is rolling out to a small number of users on the Google Play Store.
    You can download the new version now on XDA Labs.



    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    Pixel 2 Active Edge
    The Pixel 2 battery drain was caused by remapping Active Edge with root and not enabling screen off actions. It has nothing to do with the method that I use to remap the Edge squeeze, it was caused by a typo in the options logic. There are a lot of myths about how this app handles Active Edge. First of all, it does not consume battery and does not slow down your system. Such claims are false (notwithstanding the bug, which is now fixed). The method for remapping Active Edge does not scan through every logcat message. With root, it's 100% reliable and you will never see the Assistant and will remain in your current app. Without root, you will occasionally see the Assistant and it may bring you to the homescreen. The only limitation is you need to use English language until Google enables the Assistant for other languages.

    Root Command
    You can now remap buttons to a root command. This offers unlimited possibilities for power users. Obviously this requires root! It's available in the Pro version only

    Custom Key Codes
    You can also remap buttons to custom key codes. This means you can fully remap game controllers, tv remotes and other hardware attached to your device. I've compiled a list of key codes that are recognized by Android here. This requires root, unfortunately. It's available in the Pro version only.

    MIUI
    MIUI does some really stupid things to Android. In order for Button Mapper to work correctly, you need to grant the "Autostart" permission and disable battery optimization. If you do not grant the autostart permission, swiping Button Mapper away in recents will kill the service. If you do not set battery optimization to "No restrictions", then Button Mapper's service will be killed every 10 minutes or so.

    To grant these permissions, in go to the menu at upper right in Button Mapper and select "Introduction." Swipe to the screen title Permissions and follow the instructions.

    Samsung volume bug
    I tracked down a few obscure bugs on Samsung phones, including the volume scaling bug that I could never reproduce. This occurred when the volume buttons were remapped and then later the "Bixby only" option was selected without rebooting.

    Pirating this app
    Don't install pirated versions of this app (or any app that uses Accessibility or root), even just to try for a few minutes. Because it uses Accessibility Service and root, you must fully trust the developer. Using a pirated version of any root app gives hackers carte blanche on your device.



    • New actions:
      -toggle BlueTooth
      -headset key press
      -change keyboard
      -root command (requres root and PRO)
      -custom keycodes (requires root and PRO)
    • Android TV support
    • Screen off only option (requires root and PRO)
    • Fix battery drain on rooted Pixel 2
    • Update translations
    • Fix volume change for screen off actions
    • Improve Bixby handling
    • Fix volume bug on S8/Note8
    • Improve UI
    • Add 180 rotation to swap volume orientation setting
    • Improve root handling
    • Improve MIUI behaviour
    • New intro
    • Add feedback form
    • Speed and memory optimizations
    • Many other bug fixes and improvements



    .
    15
    Button Mapper update!

    There is an awesome new update for Button Mapper rolling out. You can get it on XDA Labs now, and on the Play Store in the coming days. This update improves volume button behavior, has fixes for Android Pie, improves Bixby remapping, lots of updates for Blackberry devices and adds a bunch of new actions, such as fullscreen mode, invert colors, toggles for NFC, airplane mode and mobile data, broadcast intents, Greek and Arabic languages, plus the usual bugfixes.

    Download on XDA Labs:
    https://labs.xda-developers.com/store/app/flar2.homebutton

    I want to highlight two important new features.

    First, the broadcast intent action (pro version only!). With this action, you can use a button press to broadcast an intent, which is Android's way of communicating between apps. This opens up literally endless possibilities. For example, if you have my High Brightness Mode app installed, you could enter flar2.hbmwidget.TOGGLE_HBM for long-press of volume button to toggle high brightness mode.

    The second feature is a new option to disable volume button remapping when the volume panel is showing. For example, if you have long press volume down mapped to toggle the flashlight, when the volume panel is showing, holding down volume will turn the volume down rather than turning on the flashlight. Once the volume panel disappears, holding the volume button will once again toggle the flashlight. I think this makes the volume button behavior more intuitive, so it's enabled by default. This can be turned off if you don't like it, the option is in Advanced options->Volume panel bypass.

    Please enjoy, and don't forget to leave a positive review if you find Button Mapper useful.
    12
    Version 0.66 is now released. It will roll out slowly on the Play Store, if you want it now, get it from XDA Labs
    https://labs.xda-developers.com/store/app/flar2.homebutton

    This version has tons of small fixups: volume button behavior is vastly improved, activities open right away after pressing home, everything is faster, and there are more options. Also quite a few UI improvements. New actions include toggle mobile data (root only), toggle wifi hotspot (Nougat and lower only), toggle autobrightness and clearn notifications. There is a new option to enable pocket detection, so actions won't occur while the phone is in your pocket (requires pro version).

    For Android P users, I've fixed the volume buttons to default to media and added an option to force them to control ring volume like older versions of Android.

    There is now an option to lock the screen in a way that allows you to unlock with the fingerprint. Rooted users could always do that, now unrooted users can too.

    I've also added an option to force audio routing through the speaker while Pressy, MiKey or other headphone jack buttons are plugged in. I don't have one of these devices, but it should all work.


    Changes:
    Pocket detection (pro)
    Toggle auto brightness
    Toggle Wifi hotspot (Android 7 and lower)
    Toggle mobile data (root)
    Clear notifications
    Compatibility with Android P
    Option to use speaker with Pressy, MiKey, etc
    Global bypass option
    More long press duration options
    Receive incoming phone calls with home button (Samsung)
    Add Spanish
    Update translations
    UI improvements
    Optional lock method that allows fingerprint unlocking
    Fix AOD crash with screenshot action (Samsung)
    Optimizations and bugfixes