Freeform Windows, the 7.0 CDD, and You
After some delay, Google published the Android 7.0 edition of Compatibility Definition Document. This outlines the requirements of Android device manufacturers who wish to license the Play Store and other Google proprietary apps.
I was waiting for this CDD to be released, to see what it covered regarding freeform multi-window mode. The SDK documentation has:
Manufacturers of larger devices can choose to enable freeform mode, in which the user can freely resize each activity. If the manufacturer enables this feature, the device offers freeform mode in addition to split-screen mode.
However, at the same time, we do not have an official freeform multi-window test environment. Hence, I was hoping that the SDK documentation passage represented a bit of a documentation bug. Even if the OS itself supported freeform mode, surely Google would not authorize its use via the CDD. After all, new Android releases are riddled with bugs, including many 7.0 bugs with split-screen multi-window mode. It would be risky, at best, for Google to officially condone freeform multi-window mode when the vast majority of Android developers have no formal means of testing Android’s freeform multi-window mode.
Google tells manufacturers to use it anyway.
Specifically, the section on multi-window support contains two passages directly referencing freeform:
Device implementations MUST NOT offer split-screen or freeform mode if both the screen height and width is less than 440 dp.
This is what enforces the “your window will never be smaller than 220dp” rule. This is reasonable, though strangely it does allow picture-in-picture (PIP) mode for these small screens, and a later passage allows that PIP window to be 240x135dp.
Device implementations with screen size xlarge SHOULD support freeform mode.
In the parlance of this CDD, there appear to be three levels of endorsement: SHOULD, STRONLY ENCOURAGED, and MUST. SHOULD is the weakest of the three, but it is still an endorsement. So, 10”+ tablets running 7.0 may well start offering freeform multi-window mode, literally at any point.
Except, of course, for the Pixel C, the one official Google device that
xlarge requirement. It does not, as of today, offer freeform
mode, meaning that Google is not listening to Google.
The technique that I mentioned a month ago,
adb shell settings put global enable_freeform_support 1, does
work with the Pixel C, as well as with emulators and other Android 7.0/7.1
However, this hacked freeform mode is fairly weak.
It is difficult for me to believe that Google wants manufacturers
shipping with this as the stock behavior. Perhaps the
freeform mode that manufacturers would enable is different from
enable_freeform_support offers… but then, we still would need an official
test environment to see how our apps will work and whether freeform
multi-window mode has any bugs.
What should you do?
Try your app with
enable_freeform_supportenabled, at least on an
xlarge-caliber emulator. This is unofficial and may bear little resemblance to what future devices will use, but it is all we have.
Pray to the deity of your choice that no manufacturer ships with freeform enabled until we have an official way of testing our app’s behavior.
Need Android app development training for your team? Mark Murphy has trained hundreds! Learn more!