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

Commit e430513c authored by Paul Daniel Faria's avatar Paul Daniel Faria
Browse files

Allow wallpaper to be configured to have top app

Bug: 272527880
Test: adb shell dumpsys activity processes -> Wallpapers get top-app
schedule group when flag is enabled

Change-Id: I0e93c04f2e186c8805edbf9f5730f13133cb1040
parent f4517f85
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;