Bug 827250 - Wallpaper over the WallpaperManager crash r=kats a=android-only
authorMark Finkle <mfinkle@mozilla.com>
Mon, 21 Jan 2013 17:32:00 -0500
changeset 119429 bd85ddd4cb5a25d8469640c4a39fbd3e062ca23f
parent 119428 6025bc9ec1d8da4a1a120b2992fecb22a396d096
child 119430 358793835d8b3f0acf81641b786ce941ba9c4c87
push id21682
push usermfinkle@mozilla.com
push dateMon, 21 Jan 2013 22:32:13 +0000
treeherdermozilla-inbound@bd85ddd4cb5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, android-only
bugs827250
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 827250 - Wallpaper over the WallpaperManager crash r=kats a=android-only
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1279,30 +1279,33 @@ abstract public class GeckoApp
         notification.setLatestEventInfo(mAppContext, fileName, progText, emptyIntent );
         notification.flags |= Notification.FLAG_ONGOING_EVENT;
         notification.show();
         new GeckoAsyncTask<Void, Void, Boolean>(mAppContext, GeckoAppShell.getHandler()){
 
             @Override
             protected Boolean doInBackground(Void... params) {
                 WallpaperManager mgr = WallpaperManager.getInstance(mAppContext);
+                if (mgr == null) {
+                    return false;
+                }
 
                 // Determine the ideal width and height of the wallpaper
                 // for the device
 
                 int idealWidth = mgr.getDesiredMinimumWidth();
                 int idealHeight = mgr.getDesiredMinimumHeight();
 
                 // Sometimes WallpaperManager's getDesiredMinimum*() methods
                 // can return 0 if a Remote Exception occurs when calling the
                 // Wallpaper Service. So if that fails, we are calculating
                 // the ideal width and height from the device's display 
                 // resolution (excluding the decorated area)
 
-                if(idealWidth <= 0 || idealHeight <= 0) {
+                if (idealWidth <= 0 || idealHeight <= 0) {
                     int orientation;
                     Display defaultDisplay = getWindowManager().getDefaultDisplay();
                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
                         orientation = defaultDisplay.getRotation();
                     } else {
                         orientation = defaultDisplay.getOrientation();
                     }
                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {