diff --git a/target/product/base_system_ext.mk b/target/product/base_system_ext.mk index 76f008f323..f0e6ec90c5 100644 --- a/target/product/base_system_ext.mk +++ b/target/product/base_system_ext.mk @@ -28,3 +28,6 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \ hwservicemanager \ android.hidl.allocator@1.0-service \ + +# Window Extensions +$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions_base.mk) diff --git a/target/product/window_extensions.mk b/target/product/window_extensions.mk index 5f5431f677..d27a613a61 100644 --- a/target/product/window_extensions.mk +++ b/target/product/window_extensions.mk @@ -14,11 +14,14 @@ # limitations under the License. # -# /system_ext packages -PRODUCT_PACKAGES += \ - androidx.window.extensions \ - androidx.window.sidecar - -# properties +# Extension of window_extensions_base.mk to enable the activity embedding +# feature for all apps by default. All large screen devices must inherit +# this in build. Optional for other form factors. +# +# Indicated whether the Activity Embedding feature should be guarded by +# Android 15 to avoid app compat impact. +# If true (or not set), the feature is only enabled for apps with target +# SDK of Android 15 or above. +# If false, the feature is enabled for all apps. PRODUCT_PRODUCT_PROPERTIES += \ - persist.wm.extensions.enabled=true + persist.wm.extensions.activity_embedding_guard_with_android_15=false diff --git a/target/product/window_extensions_base.mk b/target/product/window_extensions_base.mk new file mode 100644 index 0000000000..07ed5e3043 --- /dev/null +++ b/target/product/window_extensions_base.mk @@ -0,0 +1,34 @@ +# +# Copyright (C) 2024 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# The base version of window_extensions.mk to be included on all devices. +# Devices that don't support multi-window can choose to drop this. +# TODO(b/326009200): Remove from build that doesn't support multi-window. +# +# Note: by default the Activity Embedding feature is guarded by app's +# targetSDK on Android 15 to avoid app compat impact. +# +# Large screen devices must inherit window_extensions.mk to enable the +# Activity Embedding feature for all apps. + +# /system_ext packages +PRODUCT_PACKAGES += \ + androidx.window.extensions \ + androidx.window.sidecar + +# properties +PRODUCT_PRODUCT_PROPERTIES += \ + persist.wm.extensions.enabled=true