1

Requirement:

The LED lights up and displays a color during the use of the app.

Can the Notification LED be displayed only in the off state?

Is there a way to enable LEDs when using the app?

Or does Android have other APIs to control LED lights?

My app is registered in manifest.

    android:sharedUserId="android.uid.system"

1 Answers1

1

Nope, without Root the LED cannot be directly managed.

Using Root it should be possibile via "/dev/input/event..." interrogation.

emandt
  • 2,547
  • 2
  • 16
  • 20
  • My app is registered in manifest. android:sharedUserId="android.uid.system" Can the Notification API enable the LED when the screen is turned on? – HE XUAN-WEI Mar 13 '19 at 09:17
  • When the screen is turned on it's NOT possibile to change LED status/color using normal Android API. Maybe via Reflection but I never tried and neither know what variable/class to use using reflection. The only available way is access hardware directly from "/dev/input/event..." but it requires Root. – emandt Mar 13 '19 at 10:26