Bug 752709 - Extract a getDisplayMetrics function into GeckoApp. r=cpeterson
This commit is contained in:
@@ -461,8 +461,7 @@ public class GeckoAppShell
|
||||
if (restoreMode != RESTORE_NONE)
|
||||
combinedArgs += " -restoremode " + restoreMode;
|
||||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
DisplayMetrics metrics = GeckoApp.mAppContext.getDisplayMetrics();
|
||||
combinedArgs += " -width " + metrics.widthPixels + " -height " + metrics.heightPixels;
|
||||
|
||||
GeckoApp.mAppContext.runOnUiThread(new Runnable() {
|
||||
@@ -1182,9 +1181,7 @@ public class GeckoAppShell
|
||||
|
||||
public static int getDpi() {
|
||||
if (sDensityDpi == 0) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
sDensityDpi = metrics.densityDpi;
|
||||
sDensityDpi = GeckoApp.mAppContext.getDisplayMetrics().densityDpi;
|
||||
}
|
||||
|
||||
return sDensityDpi;
|
||||
|
||||
Reference in New Issue
Block a user