1

I'm using a OnePlus 6 (Magisk; systemless Xposed, stock ROM at Android 8.1.0). One of the features that constantly irritates me is the accidental dialing of emergency number. The system by-default looks for triple power button tap and automatically dials Emergency number (112). I read on XDA here that this is a feature specific to India and Indian SIMs, and I also bought this in India and use an Indian SIM. Other regional users, per some threads of OnePlus subreddit and OnePlus forums, do not have this problem and can customize the shortcut from Camera app or under Settings app, while I cannot.

I found this YouTube video but the recommended solution does not work because the Emergency Info app in my system doesn't have the activity used in the video. That app only has these two activities which only leads to editing Emergency specific user details:

.view.ViewInfoActivity
.edit.EditInfoActivity

How do I change this behavior? I'm looking to prevent emergency number dial on triple power button tap, and if possible, customization of that double power button tap to Camera launch. Furthermore, if possible, please provide a non-root based solution.

1

I used and found that the service GestureLauncherService (a sub-service of SystemService) actively looks for the triple power button tap and takes action accordingly. While I couldn't find such sub-service through GUI (Running services), dumpsys and cmd commands, I did notice this line in the logcat's output:

[ 11-15 21:21:27.368  1292: 1825 I/ActivityManager ]
START u0 {act=android.intent.action.CALL_PRIVILEGED dat=tel:xxx flg=0x10000000 cmp=com.android.server.telecom/.PrivilegedCallActivity} from uid 1000 pid 1292

I cross-checked it with adb shell dumpsys activity recents and found that PrivilegedCallActivity is the activity that shows up when the number is dialed.

So, while I can't prevent the gesture service, I can prevent the number being dialed successfully. I immediately disabled the component PrivilegedCallActivity of the package com.android.server.telecom (Call Management app) using adb (requires root) like this:

adb shell su -c 'pm disable com.android.server.telecom/.PrivilegedCallActivity'

One can also use an app to disable that activity. From henceforth, that triple power button tap wouldn't make the call.

Note: disabling that activity does not prevent Emergency calls (both to user provided emergency contacts and country specific emergency numbers) from taking place from Emergency dialer at lock screen because that uses a different activity. It is just that the system cannot dial the emergency number without user's explicit consent on the dialer, anymore.

1

In Android Pie in OnePlus 6 you can now access the activity shown in the video via Settings → Security & lock screen → Emergency Rescue.

enter image description here

(Image sourced from OnePlus Forums)

0

For those uncomfortable with disabling a component of a critical system app, as recommended here, they can use a solution which is safe and tested by others already.

At XDA, kashayapha1994 found this hack:

adb shell settings put global emergency_affordance_needed 0

That enables the quick capture shortcut setting in stock Camera app and in Settings app automatically. This also prevents dialing emergency number because system always fires the Camera app at double button press when the shortcut is enabled.

However, the hack doesn't survive a reboot, so anirudhnyg at XDA came up with a Magisk module (requires a rooted device) to automatically apply the aforesaid hack et al. Download it from the aforementioned link, install it and reboot. That's it.

You can also choose to apply that hack at boot using any app which can run a command/script at boot, such as Tasker, MacroDroid, Xposed Edge. Do note that all such apps would require root access or being set as Device Owner such as SecureTask (doesn't require root).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.