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

Commit 9302a3b0 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan
Browse files

framework: Allow specifying max wallpaper width

For some devices with very high-res screen (1920x1200), the wallpaper
width suggested by the launcher may be too large for the GPU and so
we need to limit it. (2048 for the above mentioned screen)

We don't need to limit the height since that's the height of the
screen.

Change-Id: I5b25bd931db0b2610e260921f28b92d8b0966aa6
parent 6797a3e6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1069,4 +1069,9 @@
         config to 7. -->
    <integer name="config_deviceHardwareKeys">15</integer>

    <!-- Maximum wallpaper width for devices with very high-res screen (1920x1200)
         the wallpaper width suggestion by the launcher may be too large for
         the GPU to handle. -->
    <integer name="config_wallpaperMaxWidth">-1</integer>

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -1836,6 +1836,7 @@
  <java-symbol type="bool" name="config_show_cmIMESwitcher"/>
  <java-symbol type="bool" name="config_smsSamsungCdmaAlternateMessageIDEncoding" />
  <java-symbol type="bool" name="config_samsung_stk" />
  <java-symbol type="integer" name="config_wallpaperMaxWidth" />

  <!-- Hardware Key ReMapping -->
  <java-symbol type="integer" name="config_deviceHardwareKeys" />
+6 −0
Original line number Diff line number Diff line
@@ -639,6 +639,12 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
                throw new IllegalArgumentException("width and height must be > 0");
            }

            int maxWidth = mContext.getResources().getInteger(
                    com.android.internal.R.integer.config_wallpaperMaxWidth);
            if (maxWidth != -1 && width > maxWidth) {
                  width = maxWidth;
            }

            if (width != wallpaper.width || height != wallpaper.height) {
                wallpaper.width = width;
                wallpaper.height = height;