More work on wallpapers.

- Do better about figuring out when to stop them and other related window
  management.
- Fix problem where we were not redrawing the surface when the orientation
  changed.  This was the cause of the device hang.
This commit is contained in:
Dianne Hackborn
2009-08-14 11:37:52 -07:00
parent 56e7ba2928
commit 7341d7a104
9 changed files with 160 additions and 46 deletions

View File

@@ -663,6 +663,15 @@ public abstract class Drawable {
*/
public static Drawable createFromResourceStream(Resources res, TypedValue value,
InputStream is, String srcName) {
return createFromResourceStream(res, value, is, srcName);
}
/**
* Create a drawable from an inputstream, using the given resources and
* value to determine density information.
*/
public static Drawable createFromResourceStream(Resources res, TypedValue value,
InputStream is, String srcName, BitmapFactory.Options opts) {
if (is == null) {
return null;
@@ -683,7 +692,7 @@ public abstract class Drawable {
// an application in compatibility mode, without scaling those down
// to the compatibility density only to have them scaled back up when
// drawn to the screen.
BitmapFactory.Options opts = new BitmapFactory.Options();
if (opts == null) opts = new BitmapFactory.Options();
opts.inScreenDensity = DisplayMetrics.DENSITY_DEVICE;
Bitmap bm = BitmapFactory.decodeResourceStream(res, value, is, pad, opts);
if (bm != null) {