Example usage for android.accessibilityservice AccessibilityServiceInfo FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

List of usage examples for android.accessibilityservice AccessibilityServiceInfo FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

Introduction

In this page you can find the example usage for android.accessibilityservice AccessibilityServiceInfo FLAG_INCLUDE_NOT_IMPORTANT_VIEWS.

Prototype

int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS

To view the source code for android.accessibilityservice AccessibilityServiceInfo FLAG_INCLUDE_NOT_IMPORTANT_VIEWS.

Click Source Link

Document

If this flag is set the system will regard views that are not important for accessibility in addition to the ones that are important for accessibility.

Usage

From source file:net.grayswander.rotationmanager.RotationManagerService.java

@Override
protected void onServiceConnected() {
    super.onServiceConnected();

    //Configure these here for compatibility with API 13 and below.
    AccessibilityServiceInfo config = new AccessibilityServiceInfo();
    config.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;

    if (Build.VERSION.SDK_INT >= 16)
        //Just in case this helps
        config.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;

    setServiceInfo(config);/*from  w w w .  j  a  v  a  2 s . c  o  m*/

    this.context = getApplicationContext();

    PreferenceManager.setDefaultValues(context, R.xml.preferences, false);

    configuration = new Configuration(this.context);
    this.resources = context.getResources();

}