Stack Overflow archive
9 scoreaccepted

How Do We Identify If an Android Device Is Running Official Android 7.0+ Freeform Multi-Window Mode?

score
9
question views
1.3K
license
CC BY-SA 3.0

SystemUI uses the following to determine if freeform multi-window mode is available:

java
mHasFreeformWorkspaceSupport =
    mPm.hasSystemFeature(PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT) ||
            Settings.Global.getInt(context.getContentResolver(),
                    DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, 0) != 0;

See: https://github.com/android/platform_frameworks_base/blob/nougat-release/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java#L213-216


DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT is hidden, so you would need to replace that with "enable_freeform_support":

java
boolean hasFreeFormWorkspaceSupport =
    getPackageManager().hasSystemFeature(PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT) ||
        Settings.Global.getInt(getContentResolver(), "enable_freeform_support", 0) != 0;

I don't have Android-on-Chrome-OS or DeX to test this on, however, this is how SystemUI is checking if freeform multi-window support is enabled. Perhaps you could decompile the settings or systemui app from DeX or Chrome and check if they have made changes here.

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.