Merge commit '734a78fb' into manualmerge
Conflicts: core/java/android/app/WallpaperManager.java Change-Id: Id103f540329ea484ff2e0829a0fc8158621f3dd3
This commit is contained in:
@@ -279,13 +279,15 @@ public class WallpaperManager {
|
||||
}
|
||||
|
||||
private Bitmap getCurrentWallpaperLocked(Context context) {
|
||||
if (mService == null) {
|
||||
Log.w(TAG, "WallpaperService not running");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Bundle params = new Bundle();
|
||||
ParcelFileDescriptor fd = mService.getWallpaper(this, params);
|
||||
if (fd != null) {
|
||||
int width = params.getInt("width", 0);
|
||||
int height = params.getInt("height", 0);
|
||||
|
||||
try {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
return BitmapFactory.decodeFileDescriptor(
|
||||
@@ -307,27 +309,20 @@ public class WallpaperManager {
|
||||
}
|
||||
|
||||
private Bitmap getDefaultWallpaperLocked(Context context) {
|
||||
try {
|
||||
InputStream is = openDefaultWallpaper(context);
|
||||
if (is != null) {
|
||||
int width = mService.getWidthHint();
|
||||
int height = mService.getHeightHint();
|
||||
|
||||
InputStream is = openDefaultWallpaper(context);
|
||||
if (is != null) {
|
||||
try {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
return BitmapFactory.decodeStream(is, null, options);
|
||||
} catch (OutOfMemoryError e) {
|
||||
Log.w(TAG, "Can't decode stream", e);
|
||||
} finally {
|
||||
try {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
return BitmapFactory.decodeStream(is, null, options);
|
||||
} catch (OutOfMemoryError e) {
|
||||
Log.w(TAG, "Can't decode stream", e);
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
// Ignore
|
||||
}
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
// Ignore
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user