Code example for AccessibilityEvent

Methods: getPackageName

0
 
    @Override 
    public void onAccessibilityEvent(AccessibilityEvent event) {
        SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
 
        if(mPrefs.getBoolean((String) event.getPackageName(), false)) {
            if(shouldTurnOnScreen(mPrefs)) {
                PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
 
                if(!pm.isScreenOn()) {
                    if(mPrefs.getBoolean("proxSensor", false)) {
                        turnOnScreen(mPrefs, pm);
 
                        SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
                        sensorManager.unregisterListener(this);
                    } 
                    else { 
                        if(close == false)
                            turnOnScreen(mPrefs, pm);
 
Connect your IDE to all the code out there  Get Codota for Java