3

Ho do I set Android system settings to dim after a set period of time.

android.provider.Settings.System.putInt(getContentResolver(),
            Settings.System.DIM_SCREEN, time);

but Settings.System.DIM_SCREEN is deprecated.I also tried Power Manager PowerManager.SCREEN_DIM_WAKE_LOCK which is also deprecated Any other way around for the same.

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3207655
  • 188
  • 2
  • 15

1 Answers1

2
WindowManager.LayoutParams WMLP = getWindow().getAttributes();
WMLP.screenBrightness = 0.15F;
getWindow().setAttributes(WMLP);
Amarjit
  • 4,327
  • 2
  • 34
  • 51
  • i need to change android system setting. – user3207655 Jul 01 '15 at 09:19
  • i hae gone through this link earlier . Here at this link the sol is for brightness i need something for auto dim.Moreover could not download the jar – user3207655 Jul 02 '15 at 05:26
  • at this [link](http://stackoverflow.com/questions/8062305/how-change-screen-led-like-cyanogenmod-widgetrenderfx-night-mod/31176264#31176264) it says this approch not working. Any other way aroud? – user3207655 Jul 02 '15 at 05:37
  • First of all please test this approach and then make any conclusion – Amarjit Jul 02 '15 at 08:54
  • Hi @bpA already tried but got same problem as [this](http://stackoverflow.com/questions/8062305/how-change-screen-led-like-cyanogenmod-widgetrenderfx-night-mod/31176264#31176264) – user3207655 Jul 03 '15 at 12:35