Closed
Bug 1208605
Opened 9 years ago
Closed 9 years ago
Don't use static ANDROID_PACKAGE_NAME in toolkit/crashreporter
Categories
(Toolkit :: Crash Reporting, defect)
Toolkit
Crash Reporting
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: nalexander, Unassigned)
Details
Attachments
(1 file)
Right now, we use a static ANDROID_PACKAGE_NAME reference at https://dxr.mozilla.org/mozilla-central/source/toolkit/crashreporter/nsExceptionHandler.cpp#1113. This is a totally reasonable approach for the apps we build in automation. Unfortunately, |mach artifact| based builds -- which are similar to the mooted "Go Faster" style builds -- use binaries built in automation (with package name 'org.mozilla.fennec') in locally produced binaries with package names like 'org.mozilla.fennec_$USER'. We could re-use these binaries more easily if we extracted the appropriate package dynamically, at run-time. This ticket tracks using the JNI to extract the package dynamically.
Reporter | ||
Comment 1•9 years ago
|
||
snorp: jchen: it's straightforward to use the JNI to extract the package name: something like: static jstring getpkg(JNIEnv* env, jobject thiz, jobject activity) { jclass android_content_Context =env->GetObjectClass(activity); jmethodID midGetPackageName = env->GetMethodID(android_content_Context,"getPackageName", "()Ljava/lang/String;"); jstring packageName= (jstring)env->CallObjectMethod(activity, midGetPackageName); return packageName; } (from https://gist.github.com/douzifly/11086408) should work. Is there a reason not to do this? Is it forbidden to use JNI in this location?
Flags: needinfo?(snorp)
Flags: needinfo?(nchen)
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #1) > snorp: jchen: it's straightforward to use the JNI to extract the package > name: something like: Hurgh, perhaps not so straight-forward: one needs an Android context somewhere, and it's not obvious where. Presumably we can't get a GeckoAppShell or whatever at this point?
Reporter | ||
Comment 3•9 years ago
|
||
Would it be reasonable to fish the package name from an environment variable (set early in the process life, by the Java side) and perhaps fall back to the ANDROID_PACKAGE_NAME?
Reporter | ||
Comment 4•9 years ago
|
||
Bug 1208605 - Try MOZ_ANDROID_PACKAGE_NAME env var before static ANDROID_PACKAGE_NAME. r?snorp
Attachment #8666236 -
Flags: review?(snorp)
Comment on attachment 8666236 [details] MozReview Request: Bug 1208605 - Try MOZ_ANDROID_PACKAGE_NAME env var before static ANDROID_PACKAGE_NAME. r?snorp https://reviewboard.mozilla.org/r/20473/#review18461 looks good
Attachment #8666236 -
Flags: review?(snorp) → review+
Updated•9 years ago
|
Flags: needinfo?(nchen)
Flags: needinfo?(snorp)
Jim did this get committed?
Flags: needinfo?(nchen)
Indeed.
Reporter | ||
Comment 9•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=150bd0ae202f
Reporter | ||
Comment 10•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=bc1c7acfba18
Reporter | ||
Comment 11•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=279f247ab624
Reporter | ||
Comment 12•9 years ago
|
||
Try is green (the failures are a known, recently spiked, intermittent). This is blocked on me verifying that the crash reporter still works, although it's hard to imagine it doesn't and we'd find out if it didn't quite quickly.
Flags: needinfo?(nalexander)
Reporter | ||
Comment 13•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/8a3e98127ebc28fcc01d27bdedb4c959a456c47d Bug 1208605 - Try MOZ_ANDROID_PACKAGE_NAME env var before static ANDROID_PACKAGE_NAME. r=snorp
Comment 14•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8a3e98127ebc
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•