Backed out changeset 288b6ba19e64 (bug 1257304) because it caused merge conflicts with m-c/fx-team
authorWes Kocher <wkocher@mozilla.com>
Fri, 01 Apr 2016 16:04:48 -0700
changeset 291435 6166a6070ec2e78b2994e1670c2fb62db27cb6e2
parent 291434 201173cd688629e57570cf67d1e91c2ae84b3f5f
child 291436 3ed189d26cad66521781f127ebefcc6a93b4d33f
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1257304
milestone48.0a1
backs out288b6ba19e644cec4aa6a3c2cf609cf8c7e975f8
Backed out changeset 288b6ba19e64 (bug 1257304) because it caused merge conflicts with m-c/fx-team MozReview-Commit-ID: HuO0AUpagld
mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
mobile/android/base/java/org/mozilla/gecko/GeckoScreenOrientation.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
@@ -297,17 +297,16 @@ public class GeckoAppShell
     public static native SurfaceBits getSurfaceBits(Surface surface);
 
     public static native void addPresentationSurface(Surface surface);
     public static native void removePresentationSurface(Surface surface);
 
     public static native void onFullScreenPluginHidden(View view);
 
     private static LayerView sLayerView;
-    private static Rect sScreenSize;
 
     public static void setLayerView(LayerView lv) {
         if (sLayerView == lv) {
             return;
         }
         sLayerView = lv;
     }
 
@@ -1263,17 +1262,17 @@ public class GeckoAppShell
     }
 
     private static Intent getOpenURIIntentInner(final Context context,  final String targetURI,
             final String mimeType, final String action, final String title) {
 
         if (action.equalsIgnoreCase(Intent.ACTION_SEND)) {
             Intent shareIntent = getShareIntent(context, targetURI, mimeType, title);
             return Intent.createChooser(shareIntent,
-                                        context.getResources().getString(R.string.share_title));
+                                        context.getResources().getString(R.string.share_title)); 
         }
 
         Uri uri = normalizeUriScheme(targetURI.indexOf(':') >= 0 ? Uri.parse(targetURI) : new Uri.Builder().scheme(targetURI).build());
         if (!TextUtils.isEmpty(mimeType)) {
             Intent intent = getIntentForActionString(action);
             intent.setDataAndType(uri, mimeType);
             return intent;
         }
@@ -1729,17 +1728,17 @@ public class GeckoAppShell
         GeckoProcessesVisitor visitor = new GeckoProcessesVisitor() {
             @Override
             public boolean callback(int pid) {
                 if (pid != android.os.Process.myPid())
                     android.os.Process.killProcess(pid);
                 return true;
             }
         };
-
+            
         EnumerateGeckoProcesses(visitor);
     }
 
     interface GeckoProcessesVisitor{
         boolean callback(int pid);
     }
 
     private static void EnumerateGeckoProcesses(GeckoProcessesVisitor visiter) {
@@ -1751,17 +1750,17 @@ public class GeckoAppShell
             java.lang.Process ps = Runtime.getRuntime().exec("ps");
             BufferedReader in = new BufferedReader(new InputStreamReader(ps.getInputStream()),
                                                    2048);
 
             String headerOutput = in.readLine();
 
             // figure out the column offsets.  We only care about the pid and user fields
             StringTokenizer st = new StringTokenizer(headerOutput);
-
+            
             int tokenSoFar = 0;
             while (st.hasMoreTokens()) {
                 String next = st.nextToken();
                 if (next.equalsIgnoreCase("PID"))
                     pidColumn = tokenSoFar;
                 else if (next.equalsIgnoreCase("USER"))
                     userColumn = tokenSoFar;
                 tokenSoFar++;
@@ -1884,17 +1883,17 @@ public class GeckoAppShell
             return null;
         }
     }
 
     public static String getMimeTypeFromExtension(String ext) {
         final MimeTypeMap mtm = MimeTypeMap.getSingleton();
         return mtm.getMimeTypeFromExtension(ext);
     }
-
+    
     private static Drawable getDrawableForExtension(PackageManager pm, String aExt) {
         Intent intent = new Intent(Intent.ACTION_VIEW);
         final String mimeType = getMimeTypeFromExtension(aExt);
         if (mimeType != null && mimeType.length() > 0)
             intent.setType(mimeType);
         else
             return null;
 
@@ -2608,17 +2607,17 @@ public class GeckoAppShell
     @WrapForJNI(stubName = "GetProxyForURIWrapper")
     public static String getProxyForURI(String spec, String scheme, String host, int port) {
         final ProxySelector ps = new ProxySelector();
 
         Proxy proxy = ps.select(scheme, host);
         if (Proxy.NO_PROXY.equals(proxy)) {
             return "DIRECT";
         }
-
+        
         switch (proxy.type()) {
             case HTTP:
                 return "PROXY " + proxy.address().toString();
             case SOCKS:
                 return "SOCKS " + proxy.address().toString();
         }
 
         return "DIRECT";
@@ -2851,23 +2850,16 @@ public class GeckoAppShell
             return 2;
         } else if (pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
             // 1 finger
             return 1;
         }
         return 0;
     }
 
-    public static synchronized Rect getScreenSize(final boolean update) {
-        if (update || sScreenSize == null) {
-            final WindowManager wm = (WindowManager)
-                    getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
-            final Display disp = wm.getDefaultDisplay();
-            sScreenSize = new Rect(0, 0, disp.getWidth(), disp.getHeight());
-        }
-        return sScreenSize;
-    }
-
     @WrapForJNI
-    public static Rect getScreenSize() {
-        return getScreenSize(/* update */ false);
+    static Rect getScreenSize() {
+        final WindowManager wm = (WindowManager)
+                getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
+        final Display disp = wm.getDefaultDisplay();
+        return new Rect(0, 0, disp.getWidth(), disp.getHeight());
     }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoScreenOrientation.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoScreenOrientation.java
@@ -35,17 +35,17 @@ public class GeckoScreenOrientation {
         DEFAULT(1 << 4);
 
         public final short value;
 
         private ScreenOrientation(int value) {
             this.value = (short)value;
         }
 
-        private final static ScreenOrientation[] sValues = ScreenOrientation.values();
+        private final static ScreenOrientation[] sValues = ScreenOrientation.values(); 
 
         public static ScreenOrientation get(int value) {
             for (ScreenOrientation orient: sValues) {
                 if (orient.value == value) {
                     return orient;
                 }
             }
             return NONE;
@@ -151,18 +151,16 @@ public class GeckoScreenOrientation {
                 aScreenOrientation = ScreenOrientation.PORTRAIT_PRIMARY;
             } else if (aScreenOrientation == ScreenOrientation.LANDSCAPE) {
                 aScreenOrientation = ScreenOrientation.LANDSCAPE_PRIMARY;
             }
             GeckoAppShell.sendEventToGecko(
                 GeckoEvent.createScreenOrientationEvent(aScreenOrientation.value,
                                                         getAngle()));
         }
-        // Update screen size.
-        GeckoAppShell.getScreenSize(/* update */ true);
         return true;
     }
 
     /*
      * @return The Android orientation (Configuration.orientation).
      */
     public int getAndroidOrientation() {
         return screenOrientationToAndroidOrientation(getScreenOrientation());