Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d41ec1e authored by Paul Faria's avatar Paul Faria Committed by Android (Google) Code Review
Browse files

Merge "Allow wallpaper to be configured to have top app" into main

parents ba90f637 e430513c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -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" />
+8 −3
Original line number Diff line number Diff line
@@ -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;