Example usage for android.view Display getFlags

List of usage examples for android.view Display getFlags

Introduction

In this page you can find the example usage for android.view Display getFlags.

Prototype

public int getFlags() 

Source Link

Document

Returns a combination of flags that describe the capabilities of the display.

Usage

From source file:org.acra.collector.DisplayManagerCollector.java

@NonNull
private String collectFlags(@NonNull Display display) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        final int flags = display.getFlags();
        for (Field field : display.getClass().getFields()) {
            if (field.getName().startsWith("FLAG_")) {
                try {
                    flagNames.put(field.getInt(null), field.getName());
                } catch (IllegalAccessException ignored) {
                }/*w ww  . j  ava  2 s  .  com*/
            }
        }
        return display.getDisplayId() + ".flags=" + activeFlags(flags) + '\n';
    }
    return "";
}

From source file:de.fhg.fokus.famium.presentation.CDVPresentationPlugin.java

private void addDisplay(final Display display) {
    if ((display.getFlags() & Display.FLAG_PRESENTATION) != 0) {
        getActivity().runOnUiThread(new Runnable() {
            @Override//w  ww  .ja v a2 s.  c o m
            public void run() {
                int oldSize = getSessions().size();
                SecondScreenPresentation presentation = new SecondScreenPresentation(getActivity(), display,
                        getDefaultDisplay());
                getPresentations().put(display.getDisplayId(), presentation);
                presentation.show();
                int newSize = getPresentations().size();
                CallbackContext callbackContext = getAvailableChangeCallbackContext();
                if (oldSize == 0 && newSize == 1 && callbackContext != null) {
                    sendAvailableChangeResult(callbackContext, getPresentations().size() > 0);
                }
            }
        });
    }
}

From source file:me.wimanacra.collector.DisplayManagerCollector.java

private void collectFlags(@NonNull Display display, @NonNull JSONObject container) throws JSONException {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        final int flags = display.getFlags();
        for (Field field : display.getClass().getFields()) {
            if (field.getName().startsWith("FLAG_")) {
                try {
                    flagNames.put(field.getInt(null), field.getName());
                } catch (IllegalAccessException ignored) {
                }//ww  w.j a  va  2s  . co  m
            }
        }
        container.put("flags", activeFlags(flags));
    }
}