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

Commit 9c1ca71f authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
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

Conflicts:
	core/res/res/values/config.xml
parent c19e1e7f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1321,4 +1321,9 @@
    <!-- Boolean to enable stk functionality on Samsung phones -->
    <bool name="config_samsung_stk">false</bool>

    <!-- 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
@@ -1760,6 +1760,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" />

  <!-- Notification and battery light -->
  <java-symbol type="bool" name="config_intrusiveBatteryLed" />
+6 −0
Original line number Diff line number Diff line
@@ -649,6 +649,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;