0

I tried search but I didn't search anything about it.

Can I turn on my ambient display with code? I think do a service to turn on when I proximity my hand in device like Motorola.

Thanks advance

ViTUu
  • 1,164
  • 9
  • 20

1 Answers1

0

You can do that by calling

Settings.Secure.putInt(getContentResolver(), Settings.Secure.DOZE_ENABLED, on ? 1 : 0);

Unfortunately, writing vale to Secure setting is not allowed on a non-root device.

Sam Lu
  • 3,188
  • 1
  • 25
  • 36