As my Motorola i1 refuses to light its LED in the usual programmatic way (using NotificationManager with LED on specified), I've dived into Android Cupcake's source code and found out that the native applications such as Calendar & Messaging do this using NotificationManagerService, which uses
IHardwareService.setLedState()
which, in turn, calls the
setLightFlashing_UNCHECKED()
function of the kernel (or is it a component other than the kernel?).
How do I either instantiate the HardwareService implementing IHardwareService, or call the setLightFlashing_UNCHECKED myself?
You can't, applications don't have permission to directly access such hardware.
Related
Is there is api where i can record all the incoming and outgoing call in android pie version . It seems nearly impossible to record a call. Please suggest what can be done in this scenario
Android disabled the api with their security update policy. Looking at the permissions list the closest you can find is the MANAGE_OWN_CALLS, meaning that the best solution for you is to implement a standalone application for calling where you should be able to interact with microphone directly.
I have a remote playback device that is not a cast-device (let's call him Johnny 5 for now).
From a client app, I want to be able to cast content to a Chromecast or to my Johnny 5 device. The app is based on the Cast SDK v3.
In order to integrate my non-cast device, I built a Media Router Provider and extended the Session & SessionProvider classes. The Session Provider is added in the getAdditionalSessionProviders method of my OptionsProvider class.
I managed to make things work: my device appears in the list of the detected devices with the Chromecast (thanks to the MediaRouterProvider), and when I select it, session is started, and then I can cast contents on it.
However, it seems like the RemoteMediaClient object is Google-cast specific (cannot be used with non-cast devices), like a lot of Cast SDK features (mini controller, expanded controller...).
Question here regards the Cast Dialog, the Remote Control Notification and the Lock Screen: is that possible to use these with my non-cast device ? Or do I have to code the whole bunch to 'mimic' the Cast SDK features ?
Regarding the Cast Dialog, I would like to be able to customize it to have the same behavior as for the Chromecast without coding my own device picker or overriding the default button behavior.
The majority of work would be on your side, coding most everything for non-cast devices. Cast APIs, as you've noticed, do not interact with Sessions that are not CastSessions. So your options is to write an interface that is already implemented by Cast SDK for cast devices and by you for non-cast devices and try to use that common interface as much as possible. Getting things like lock screen amounts to creating a MediaStyle notification; CastSdk handles that for when there is a CastSession involved and you need to create a similar notification when a different type of Session is involved. This is true for almost all UI elements that the Cast SDK provides out of the box.
I'm building a voip app and will be using Android's incoming call UI. I've successfully registered a phoneAccount using the TelecomManager and managed to get addNewIncomingCall working.
The problem is that when the phone is locked I get the incoming call UI but NO actions to answer or dismiss the call.
In the other hand, if the phone is not locked I still get the incoming call UI but it DOES contain actions to answer or dismiss the call.
Any ideas as to what might be happening?
I can attach code if needed.
But basically I'm following this android's documentation:
https://developer.android.com/reference/android/telecom/TelecomManager.html
https://developer.android.com/reference/android/telecom/ConnectionService.html
There is a test implementation of these APIs in the AOSP repository. Take a look at how the TestConnectionService does things.
Be forewarned, the CTS test coverage for these APIs was not complete in M (or even N for that matter), so its possible that OEMs do not fully support them in their intended manner. Starting in O the CTS test coverage has been improved so OEM compatibility should improve.
I've got an android phone with root and su access. I'd like to intercept all intents fired by any app and their extras bundles in my android app. Is there a way of doing that without writing a custom aosp ROM? Is it possible to change how Zygote or ActivityManager work?
I know using "adb shell dumpsys" will provide a historical view on past intents but it's missing the intent payload.
I've got a list of all the intents' action names that can be fired and added those to my androidmanfiest.xml. But some are routed to specific packages or limited behind security permissions.
Is there a one-size-fits-all approach that'll intercept all intents in Android?
Have you tried using Xposed framework? It basically allows you to intercept any method (such as Context.startService(), or any of ActivityManager's) and add your own code.
What is the official API in Qt5.2 (which started supporting Android and iOS officially) for sending text messages? or generally the Messaging API.
Currently Qt mostly work for GUI only stuff on Android. To be able to do what you want you have to call Java code from C++. I suggest you start of by extending QtActivity (and call super on the functions already implemented like onCreate() etc.). Then you would have to code using the Android SMS Manager class.
More information and an example on how to call Java code from C++/Qt can be found here.
This should get you started if you decide to proceed.