Bug 1656170 - Update package name used to detect Fenix via ADB r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Sat, 01 Aug 2020 09:24:00 +0000
changeset 543187 7cb90fa4f485fc9dda5c1fef3ae09a826f83774a
parent 543186 0f154c6906db237dbde1cb71fa815f9b819f2f1d
child 543188 ce3679646f67f703b312c8782a91122273cac392
push id123286
push userjdescottes@mozilla.com
push dateTue, 04 Aug 2020 07:04:12 +0000
treeherderautoland@7cb90fa4f485 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1656170
milestone81.0a1
first release with
nightly linux32
7cb90fa4f485 / 81.0a1 / 20200804091327 / files
nightly linux64
7cb90fa4f485 / 81.0a1 / 20200804091327 / files
nightly mac
7cb90fa4f485 / 81.0a1 / 20200804091327 / files
nightly win32
7cb90fa4f485 / 81.0a1 / 20200804091327 / files
nightly win64
7cb90fa4f485 / 81.0a1 / 20200804091327 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1656170 - Update package name used to detect Fenix via ADB r=daisuke The Fenix package name is now org.mozilla.firefox and not org.mozilla.fenix. We need to update the logic in ADB to accommodate for this change. Differential Revision: https://phabricator.services.mozilla.com/D85396
devtools/client/shared/remote-debugging/adb/adb-runtime.js
--- a/devtools/client/shared/remote-debugging/adb/adb-runtime.js
+++ b/devtools/client/shared/remote-debugging/adb/adb-runtime.js
@@ -33,17 +33,38 @@ class AdbRuntime {
     }
   }
 
   get id() {
     return this._adbDevice.id + "|" + this._socketPath;
   }
 
   get isFenix() {
-    return this._packageName().includes("org.mozilla.fenix");
+    // Firefox Release uses "org.mozilla.firefox"
+    // Firefox Beta uses "org.mozilla.firefox_beta"
+    // Firefox Nightly uses "org.mozilla.fenix"
+    const isFirefox =
+      this._packageName().includes("org.mozilla.firefox") ||
+      this._packageName().includes("org.mozilla.fenix");
+
+    if (!isFirefox) {
+      return false;
+    }
+
+    // Firefox Release (based on Fenix) is not released in all regions yet, so
+    // we should still check for Fennec using the version number.
+    // Note that Fennec's versionName followed Firefox versions (eg "68.11.0").
+    // We can find the main version number in it. Fenix on the other hand has
+    // version names such as "Nightly 200730 06:21".
+    const mainVersion = Number(this.versionName.split(".")[0]);
+    const isFennec = mainVersion === 68;
+
+    // Application is Fenix if this is a Firefox application with a version
+    // different from the Fennec version.
+    return !isFennec;
   }
 
   get deviceId() {
     return this._adbDevice.id;
   }
 
   get deviceName() {
     return this._adbDevice.name;
@@ -53,35 +74,31 @@ class AdbRuntime {
     return this._versionName;
   }
 
   get shortName() {
     const packageName = this._packageName();
 
     switch (packageName) {
       case "org.mozilla.firefox":
+        if (!this.isFenix) {
+          // Old Fennec release
+          return "Firefox (Fennec)";
+        }
+        // Official Firefox app, based on Fenix
         return "Firefox";
       case "org.mozilla.firefox_beta":
+        // Official Firefox Beta app, based on Fenix
         return "Firefox Beta";
-      case "org.mozilla.fennec":
-      case "org.mozilla.fennec_aurora":
-        // This package name is now the one for Firefox Nightly distributed
-        // through the Google Play Store since "dawn project"
-        // cf. https://bugzilla.mozilla.org/show_bug.cgi?id=1357351#c8
-        return "Firefox Nightly";
       case "org.mozilla.fenix":
-        // The current Nightly build for Fenix is available under this package name
-        // but the official packages will use fenix, fenix.beta and fenix.nightly.
-        return "Firefox Preview";
-      case "org.mozilla.fenix.beta":
-        return "Firefox Preview Beta";
-      case "org.mozilla.fenix.nightly":
-        return "Firefox Preview Nightly";
+        // Official Firefox Nightly app, based on Fenix
+        return "Firefox Nightly";
       default:
-        return "Firefox Custom";
+        // Unknown package name
+        return `Firefox (${packageName})`;
     }
   }
 
   get socketPath() {
     return this._socketPath;
   }
 
   get name() {