Skip to content
Snippets Groups Projects
Commit 5d602200 authored by Divya Dubey's avatar Divya Dubey Committed by Mattias Nilsson
Browse files

Do not overwrite user set or live wallpapers

WallpaperUpdateReceiver unconditionally updates the wallpaper
to the default_wallpaper when DEVICE_CUSTOMIZATION_READY is
received.

This overwrites live wallpapers and user set wallpapers.
Just clear the wallpaper when there is no live wallpaper to
avoid this from happening.

Test: set a wallpaper and run
adb shell am broadcast \
  -a android.intent.action.DEVICE_CUSTOMIZATION_READY \
  -f 0x01000000

Bug: 159673283
Change-Id: I385c28be84b9146e8620910258495f5d71b9c04e
parent 24ea590c
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,6 @@ import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.ParcelFileDescriptor;
import android.util.Slog;
......@@ -59,10 +58,10 @@ public class WallpaperUpdateReceiver extends BroadcastReceiver {
return;
}
if (DEBUG) Slog.d(TAG, "Set customized default_wallpaper.");
Bitmap blank = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
// set a blank wallpaper to force a redraw of default_wallpaper
wallpaperManager.setBitmap(blank);
wallpaperManager.setResource(com.android.internal.R.drawable.default_wallpaper);
// Check if it is not a live wallpaper set
if (wallpaperManager.getWallpaperInfo() == null) {
wallpaperManager.clearWallpaper();
}
} catch (Exception e) {
Slog.w(TAG, "Failed to customize system wallpaper." + e);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment