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

Commit 0ff96280 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Gerrit Code Review
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: I188ac585370fb705cfa50d5ad84786e6f2cbd016
parent d950b527
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -952,4 +952,9 @@
    <string-array translatable="false" name="config_accessoryDockNames">
        <item>"dock"</item>
    </string-array>

    <!-- 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
@@ -3685,6 +3685,7 @@
  <java-symbol type="integer" name="config_deviceHardwareKeys" />
  <java-symbol type="bool" name="config_hasRemovableLid" />
  <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
@@ -529,6 +529,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 (width > maxWidth) {
            width = maxWidth;
        }

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