Is there a way to disable the emergency call functionality of the power button programatically on Android 13? I checked the DevicePolicyManager class (my app is a device owner) but could not find anything.
Related
I'm trying to develop an app that recognizes when a paired bluetooth keyboard's key is pressed and wakes up the app with certain action. The bluetooth device in particular is the Selfie Remote Shutter (this one, no ads intended: http://www.ebay.es/itm/like/361219097614) and it's recognized by the device as a bluetooth keyboard. It sends two different events which the SO in Android identifies as key volume up pressed and enter key pressed.
I've declared a receiver for my app and tried to listen to every bluetooth action in order to identify the command sent from the keyboard to my device, capture that event and trigger certain method in my app, even if it's not open.
I don't know how to achieve this, since when the app is opened, I can override the onKeyDown event and recognize which "key" has the bluetooth keyboard pressed, but can't figure how to achieve that with the app closed. Maybe some intent-filter?
Thanks in advance!
I need to detect whether lockScreen is on or off on android phone.
This is not exactly about lock type. Android Phone security settings allow user to set PIN or graphic pattern screen lock type. A lot of devices show lockScreen BEFORE user can enter PIN or pattern.
So we have three actions to-do to start work with launcher or apps:
Press screen turn on/off hardware button on device
Swipe on screen to go though lockscreen
enter unlock combination (pin or pattern)
Some devices don't show lockscreen so than we have:
Press screen turn on/off hardware button on device
enter unlock combination (pin or pattern)
lock screen
enter pattern screen
Often user can turn lockscreen on of off by choosing creen lock options. Theese options in most cases called None and Swipe
I have spent an hour to know out how to determine whether lockscreen is on or off using official android API but FAILed.
If there is no absolutely stable solution for all lockable android devices - so may be there possibility to determine if lockscreen is on (just 'on' - without 'off') on MOST devices.
I am making an alarm app for Android. Is there a way to disable the volume control and the phone's power button from within the app? If the app needs to ask the user for permission before doing this, thats fine.
For now, I just want to display a "button pressed!" message when I press any button (volume or the call button) on a paired bluetooth headset (LG HBM-770). I've tried the exact method here (this is the code I'm using): Android - registering a headset button click with BroadcastReceiver with no luck, including the suggested fixes. Hours of google searching only point to that type of code. Bluetooth permission is enabled in the manifest.
If I press the call button now, it seems to never get to my app, instead it brings up the menu that asks you to choose which app to handle it (voice search, google voice, etc). If I hold down the bluetooth call button, my phone calls the last dialed number. If I try to replace the Intent filter type with ACTION_POWER_DISCONNECTED, it works flawlessly when I disconnect power, so it seems that the code from that point on works fine.
It would be nice if I could use no filter at all, and just have a Toast pop up displaying the ID of ANY action received, so I know what exactly the buttons look like to the phone.
Prssing call button on bluetooth headset will trigger certain AT commands(check in Hands Free Spec) to phone which phone will take care, ex: when pressed call button for long duration, headset will send an AT command for call redial and so are the other usecases.
Intents and the methods provided in the link are for the button pressed on the phone.
Some new Android devices have a mute button like Iphone. Its an actual physical button that allows you to mute an incoming call instead of long pressing the volume down hardware control or the pressing the power button.
my question: What is the keycode event for this or how can i capture it so i can get my app to respond to it ?
I think you're looking for KeyEvent.KEYCODE_MUTE. Note that no flagship Android devices have this button, so you are left to the mercy of whether or not the manufacturer's OS actually sends this event or not.