FileDocCategorySizeDatePackage
BrightnessLimit.javaAPI DocAndroid 5.1 API1875Thu Mar 12 22:22:12 GMT 2015android.os

BrightnessLimit

public class BrightnessLimit extends android.app.Activity implements android.view.View.OnClickListener
Tries to set the brightness to 0. Should be silently thwarted by the framework.

Fields Summary
Constructors Summary
Methods Summary
public voidonClick(android.view.View v)

        IPowerManager power = IPowerManager.Stub.asInterface(
                ServiceManager.getService("power"));
        if (power != null) {
            try {
                power.setTemporaryScreenBrightnessSettingOverride(0);
            } catch (RemoteException darn) {
                
            }
        }
        Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 0);
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.brightness_limit);
        
        Button b = (Button) findViewById(R.id.go);
        b.setOnClickListener(this);