Bug 1242213 - Part 0: Use org.mozilla.gecko.BrowserApp instead of .App. r=me,gbrown,bc

This approach lets us get rid of the .App <activity-alias> definitions, at
least.

In Bug 1237755, I tried pretty hard to use real intent filters, rather
than a different hard-code path name, but ran into significant issues,
and finally into the hard reality that Android 2.3 doesn't support
bare package names.  (It only supports package/class component names.)
Android 2.3 can't die fast enough.

Sadly, this approach doesn't address the issues I see loading URLs
that prompted Bug 1237755.

This is the path of least resistance.  Onwards!

Tested via:

nalexander@chocho ~/M/gecko> ./mach run
Starting: Intent { act=android.activity.MAIN cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
Warning: Activity not started, its current task has been brought to the front
nalexander@chocho ~/M/gecko> ./mach run https://mozilla.org
Starting: Intent { act=android.activity.MAIN dat=https://mozilla.org cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
nalexander@chocho ~/M/gecko> ./mach run file:///mnt/sdcard/test.html
Starting: Intent { act=android.activity.MAIN dat=file:///mnt/sdcard/test.html cmp=org.mozilla.fennec_nalexander/org.mozilla.gecko.BrowserApp }
This commit is contained in:
Nick Alexander 2016-01-27 12:15:19 -08:00
parent ac80a4931a
commit d17f5bdf00
5 changed files with 7 additions and 7 deletions

View File

@ -391,7 +391,7 @@ class ADBAndroid(ADBDevice):
if extra_args:
extras['args'] = " ".join(extra_args)
self.launch_application(app_name, ".App", intent, url=url, extras=extras,
self.launch_application(app_name, "org.mozilla.gecko.BrowserApp", intent, url=url, extras=extras,
wait=wait, fail_if_running=fail_if_running,
timeout=timeout)

View File

@ -380,7 +380,7 @@ class DeviceManagerADB(DeviceManager):
else:
args = cmd[i:].strip()
acmd.append("-n")
acmd.append(cmd[0:i] + "/.App")
acmd.append(cmd[0:i] + "/org.mozilla.gecko.BrowserApp")
if args != "":
acmd.append("--es")
acmd.append("args")

View File

@ -103,7 +103,7 @@ class DroidMixin(object):
if extraArgs:
extras['args'] = " ".join(extraArgs)
self.launchApplication(appName, ".App", intent, url=url, extras=extras,
self.launchApplication(appName, "org.mozilla.gecko.BrowserApp", intent, url=url, extras=extras,
wait=wait, failIfRunning=failIfRunning)
def getInstalledApps(self):
@ -168,7 +168,7 @@ class DroidADB(DeviceManagerADB, DroidMixin):
# activity is indicated by something like:
# mFocusedApp=AppWindowToken{483e6db0 token=HistoryRecord{484dcad8 com.mozilla.SUTAgentAndroid/.SUTAgentAndroid}}
# or, on other devices:
# FocusedApplication: name='AppWindowToken{41a65340 token=ActivityRecord{418fbd68 org.mozilla.fennec_mozdev/.App}}', dispatchingTimeout=5000.000ms
# FocusedApplication: name='AppWindowToken{41a65340 token=ActivityRecord{418fbd68 org.mozilla.fennec_mozdev/org.mozilla.gecko.BrowserApp}}', dispatchingTimeout=5000.000ms
# Extract this line, ending in the forward slash:
m = re.search('mFocusedApp(.+)/', data)
if not m:

View File

@ -11,7 +11,7 @@ class LaunchTest(unittest.TestCase):
"10066 1198 com.twitter.android"),
("info sutuserinfo", ""),
("exec am start -W -n "
"org.mozilla.fennec/.App -a "
"org.mozilla.fennec/org.mozilla.gecko.BrowserApp -a "
"android.intent.action.VIEW",
"OK\nreturn code [0]")])
d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=logging.DEBUG)
@ -24,7 +24,7 @@ class LaunchTest(unittest.TestCase):
"10066 1198 com.twitter.android"),
("info sutuserinfo", "User Serial:0"),
("exec am start --user 0 -W -n "
"org.mozilla.fennec/.App -a "
"org.mozilla.fennec/org.mozilla.gecko.BrowserApp -a "
"android.intent.action.VIEW",
"OK\nreturn code [0]")])
d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=logging.DEBUG)

View File

@ -242,7 +242,7 @@ def run_firefox_for_android(build_obj, params):
#
# adb shell am start -a android.activity.MAIN -n org.mozilla.fennec_$USER -d <url param> --es args "<params>"
#
app = "%s/.App" % build_obj.substs['ANDROID_PACKAGE_NAME']
app = "%s/org.mozilla.gecko.BrowserApp" % build_obj.substs['ANDROID_PACKAGE_NAME']
cmd = ['am', 'start', '-a', 'android.activity.MAIN', '-n', app]
if params:
for p in params: