public static final int PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER = 1 << 10;
/**
+ * When set, the activities associated with this application are resizeable by default.
+ * @see android.R.styleable#AndroidManifestActivity_resizeableActivity
+ *
+ * @hide
+ */
+ public static final int PRIVATE_FLAG_RESIZEABLE_ACTIVITIES = 1 << 11;
+
+ /**
* Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
* {@hide}
*/
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_RESIZEABLE_ACTIVITIES;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_BAD_MANIFEST;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING;
ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_ENCRYPTION_AWARE;
}
+ if (sa.getBoolean(R.styleable.AndroidManifestApplication_resizeableActivity,
+ owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.N)) {
+ ai.privateFlags |= PRIVATE_FLAG_RESIZEABLE_ACTIVITIES;
+ }
+
String str;
str = sa.getNonConfigurationString(
com.android.internal.R.styleable.AndroidManifestApplication_permission, 0);
a.info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.N) {
- if (sa.getBoolean(R.styleable.AndroidManifestActivity_resizeableActivity, true)) {
+ final boolean appDefault = (owner.applicationInfo.privateFlags
+ & PRIVATE_FLAG_RESIZEABLE_ACTIVITIES) != 0;
+ if (sa.getBoolean(
+ R.styleable.AndroidManifestActivity_resizeableActivity, appDefault)) {
if (sa.getBoolean(R.styleable.AndroidManifestActivity_supportsPictureInPicture,
false)) {
a.info.resizeMode = RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
<attr name="extractNativeLibs" />
<attr name="forceDeviceEncrypted" format="boolean" />
<attr name="encryptionAware" />
+ <attr name="resizeableActivity" />
</declare-styleable>
<!-- The <code>permission</code> tag declares a security permission that can be
used to control access from other packages to specific components or