Android14实现Settings左右分屏显示的 代码修改
Settings在大屏会自动显示出左右两部分,分屏的效果。
现在要在小屏上也调出这样的效果。
1、qssi14/packages/apps/Settings/Android.bp
添加以下内容:
"androidx.cardview_cardview","androidx.compose.runtime_runtime-livedata","androidx.preference_preference",
+ "androidx.window.extensions",
+ "androidx.window.sidecar","androidx.recyclerview_recyclerview","androidx.window_window",
2、qssi14/packages/apps/Settings/src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java
修改以下函数:
public static boolean isEmbeddingActivityEnabled(Context context) {// Activity Embedding feature is not enabled if Settings doesn't enable large screen// optimization or the device is not supported.return true;}
3、修改 build.prop文件
位置在:
qssi14/device/qcom/qssi/system.prop
具体参数为 ro.product.is_support_SettingsSplitEnabled 在system.prop中设置为true即可。
#Battery Property
ro.charger.enable_suspend = 1
#Disable MTE Async for system server
arm64.memtag.process.system_server=off# Disable blur on app launch
ro.launcher.blur.appLaunch=0
ro.product.is_support_SettingsSplitEnabled=true#新加的参数