Merge "Allow wallpaper to be configured to have top app" into main
This commit is contained in:
@@ -4125,6 +4125,10 @@
|
||||
-->
|
||||
<string name="config_wallpaperCropperPackage" translatable="false">com.android.wallpapercropper</string>
|
||||
|
||||
<!-- Wallpaper will get top app scheduling priority if this is set to true.
|
||||
-->
|
||||
<bool name="config_wallpaperTopApp">false</bool>
|
||||
|
||||
<!-- True if the device supports at least one form of multi-window.
|
||||
E.g. freeform, split-screen, picture-in-picture. -->
|
||||
<bool name="config_supportsMultiWindow">true</bool>
|
||||
|
||||
@@ -3247,6 +3247,7 @@
|
||||
<!-- WallpaperManager config -->
|
||||
<java-symbol type="string" name="config_wallpaperCropperPackage" />
|
||||
<java-symbol type="string" name="expand_action_accessibility" />
|
||||
<java-symbol type="bool" name="config_wallpaperTopApp" />
|
||||
|
||||
<java-symbol type="id" name="textSpacerNoTitle" />
|
||||
<java-symbol type="id" name="titleDividerNoCustom" />
|
||||
|
||||
@@ -3629,10 +3629,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
||||
intent.putExtra(Intent.EXTRA_CLIENT_LABEL,
|
||||
com.android.internal.R.string.wallpaper_binding_label);
|
||||
intent.putExtra(Intent.EXTRA_CLIENT_INTENT, clientIntent);
|
||||
boolean bindSuccess = mContext.bindServiceAsUser(intent, newConn,
|
||||
Context.BIND_AUTO_CREATE | Context.BIND_SHOWING_UI
|
||||
int bindFlags = Context.BIND_AUTO_CREATE | Context.BIND_SHOWING_UI
|
||||
| Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE
|
||||
| Context.BIND_INCLUDE_CAPABILITIES,
|
||||
| Context.BIND_INCLUDE_CAPABILITIES;
|
||||
|
||||
if (mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_wallpaperTopApp)) {
|
||||
bindFlags |= Context.BIND_SCHEDULE_LIKE_TOP_APP;
|
||||
}
|
||||
boolean bindSuccess = mContext.bindServiceAsUser(intent, newConn, bindFlags,
|
||||
new UserHandle(serviceUserId));
|
||||
if (!bindSuccess) {
|
||||
String msg = "Unable to bind service: " + componentName;
|
||||
|
||||
Reference in New Issue
Block a user