Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if notification LED exists on device and which colors are available

I've implemented red LED light for my notifications for test purposes, but...

Do I have to check if the device has LED (in case that device doesn't have this feature) and if so how to do it? Also, are LED colors predetermined?

I tried to find some docs or thread that would give me an answer for these questions but had no luck...

like image 582
Munez NS Avatar asked Sep 29 '22 03:09

Munez NS


1 Answers

There is no way of doing this.

According to Can I detect the presence/absence of 'LED notification' on an Android device?

Most hardware features are exposed via the package manager:

PackageManager pm = getActivity ().getPackageManager ();
boolean hasBluetooth =  pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH);

But not this one.

There is a feature request on record as well: https://code.google.com/p/android/issues/detail?id=38481

like image 154
Cory Roy Avatar answered Oct 06 '22 20:10

Cory Roy