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

Commit c067c9c3 authored by Mike Lockwood's avatar Mike Lockwood Committed by Mike Lockwood
Browse files

Add support for disabling wallpaper service

parent 491f40dd
Loading
Loading
Loading
Loading
+31 −2
Original line number Diff line number Diff line
@@ -433,7 +433,12 @@ public class WallpaperManager {
     */
    public WallpaperInfo getWallpaperInfo() {
        try {
            if (sGlobals.mService == null) {
                Log.w(TAG, "WallpaperService not running");
                return null;
            } else {
                return sGlobals.mService.getWallpaperInfo();
            }
        } catch (RemoteException e) {
            return null;
        }
@@ -451,6 +456,10 @@ public class WallpaperManager {
     * wallpaper.
     */
    public void setResource(int resid) throws IOException {
        if (sGlobals.mService == null) {
            Log.w(TAG, "WallpaperService not running");
            return;
        }
        try {
            Resources resources = mContext.getResources();
            /* Set the wallpaper to the default values */
@@ -483,6 +492,10 @@ public class WallpaperManager {
     * wallpaper.
     */
    public void setBitmap(Bitmap bitmap) throws IOException {
        if (sGlobals.mService == null) {
            Log.w(TAG, "WallpaperService not running");
            return;
        }
        try {
            ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null);
            if (fd == null) {
@@ -515,6 +528,10 @@ public class WallpaperManager {
     * wallpaper.
     */
    public void setStream(InputStream data) throws IOException {
        if (sGlobals.mService == null) {
            Log.w(TAG, "WallpaperService not running");
            return;
        }
        try {
            ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null);
            if (fd == null) {
@@ -558,6 +575,10 @@ public class WallpaperManager {
     * mandatory.
     */
    public int getDesiredMinimumWidth() {
        if (sGlobals.mService == null) {
            Log.w(TAG, "WallpaperService not running");
            return 0;
        }
        try {
            return sGlobals.mService.getWidthHint();
        } catch (RemoteException e) {
@@ -581,6 +602,10 @@ public class WallpaperManager {
     * mandatory.
     */
    public int getDesiredMinimumHeight() {
        if (sGlobals.mService == null) {
            Log.w(TAG, "WallpaperService not running");
            return 0;
        }
        try {
            return sGlobals.mService.getHeightHint();
        } catch (RemoteException e) {
@@ -599,7 +624,11 @@ public class WallpaperManager {
     */
    public void suggestDesiredDimensions(int minimumWidth, int minimumHeight) {
        try {
            if (sGlobals.mService == null) {
                Log.w(TAG, "WallpaperService not running");
            } else {
                sGlobals.mService.setDimensionHints(minimumWidth, minimumHeight);
            }
        } catch (RemoteException e) {
            // Ignore
        }
+3 −0
Original line number Diff line number Diff line
@@ -545,6 +545,9 @@
         specified -->
    <string name="default_wallpaper_component" translatable="false">@null</string>

    <!-- True if WallpaperService is enabled -->
    <bool name="config_enableWallpaperService">true</bool>

    <!-- Component name of the service providing network location support. -->
    <string name="config_networkLocationProvider" translatable="false">@null</string>

+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@
  <java-symbol type="bool" name="skip_restoring_network_selection" />
  <java-symbol type="bool" name="split_action_bar_is_narrow" />
  <java-symbol type="bool" name="config_useMasterVolume" />
  <java-symbol type="bool" name="config_enableWallpaperService" />

  <java-symbol type="integer" name="config_cursorWindowSize" />
  <java-symbol type="integer" name="config_longPressOnPowerBehavior" />
+10 −7
Original line number Diff line number Diff line
@@ -463,6 +463,8 @@ class ServerThread extends Thread {
                reportWtf("starting DropBoxManagerService", e);
            }

            if (context.getResources().getBoolean(
                        com.android.internal.R.bool.config_enableWallpaperService)) {
                try {
                    Slog.i(TAG, "Wallpaper Service");
                    if (!headless) {
@@ -472,6 +474,7 @@ class ServerThread extends Thread {
                } catch (Throwable e) {
                    reportWtf("starting Wallpaper Service", e);
                }
            }

            if (!"0".equals(SystemProperties.get("system_init.startaudioservice"))) {
                try {