Bug 1269682 - Always detect guest mode first; r=margaret
authorJim Chen <nchen@mozilla.com>
Mon, 09 May 2016 22:31:18 -0400
changeset 321231 fe2780a12fd33798a2bdce62497bc175f054418e
parent 321230 710f4c21891e81e0363eca32b412980951d38116
child 321232 bc8055a37b4a8e2f17a88bb50780f252a2ed8955
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1269682
milestone49.0a1
Bug 1269682 - Always detect guest mode first; r=margaret Always check for guest mode even if we don't have arguments, because we can still be in guest mode even if we don't have arguments.
mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
@@ -109,24 +109,24 @@ public final class GeckoProfile {
         UNLOCKED,
         UNDEFINED
     };
 
     /**
      * Can return null.
      */
     public static GeckoProfile getFromArgs(final Context context, final String args) {
+        if (GuestSession.shouldUse(context, args)) {
+            return GeckoProfile.getOrCreateGuestProfile(context);
+        }
+
         if (args == null) {
             return null;
         }
 
-        if (GuestSession.shouldUse(context, args)) {
-            return GeckoProfile.getOrCreateGuestProfile(context);
-        }
-
         String profileName = null;
         String profilePath = null;
         if (args.contains("-P")) {
             final Pattern p = Pattern.compile("(?:-P\\s*)(\\w*)(\\s*)");
             final Matcher m = p.matcher(args);
             if (m.find()) {
                 profileName = m.group(1);
             }