Closed Bug 1021443 Opened 10 years ago Closed 10 years ago

java.lang.IllegalStateException: Already registered Webapps:Postinstall under a different type

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect)

All
Android
defect
Not set
normal

Tracking

(firefox31 unaffected, firefox32 fixed)

RESOLVED FIXED
Firefox 32
Tracking Status
firefox31 --- unaffected
firefox32 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(1 file, 1 obsolete file)

I get this during installation.

I/GeckoWebappInstallListener(27136): Downloaded APK file deleted
D/GeckoProfile(27136): Created new profile dir.
E/GeckoAppShell(27136): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 3762 ("GeckoBackgroundThread")
E/GeckoAppShell(27136): java.lang.IllegalStateException: Already registered Webapps:Postinstall under a different type
E/GeckoAppShell(27136): 	at org.mozilla.gecko.EventDispatcher.checkNotRegistered(EventDispatcher.java:86)
E/GeckoAppShell(27136): 	at org.mozilla.gecko.EventDispatcher.registerGeckoThreadListener(EventDispatcher.java:125)
E/GeckoAppShell(27136): 	at org.mozilla.gecko.webapp.InstallHelper.registerGeckoListener(InstallHelper.java:153)
E/GeckoAppShell(27136): 	at org.mozilla.gecko.webapp.InstallHelper.access$000(InstallHelper.java:30)
E/GeckoAppShell(27136): 	at org.mozilla.gecko.webapp.InstallHelper$1.run(InstallHelper.java:60)
E/GeckoAppShell(27136): 	at android.os.Handler.handleCallback(Handler.java:733)
E/GeckoAppShell(27136): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/GeckoAppShell(27136): 	at android.os.Looper.loop(Looper.java:136)
E/GeckoAppShell(27136): 	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:32)
And then it happens on launch, too:

E/GeckoAppShell(27290): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 1 ("main")
E/GeckoAppShell(27290): java.lang.IllegalStateException: Already registered Webapps:Postinstall under a different type
E/GeckoAppShell(27290): 	at org.mozilla.gecko.EventDispatcher.checkNotRegistered(EventDispatcher.java:86)
E/GeckoAppShell(27290): 	at org.mozilla.gecko.EventDispatcher.registerGeckoThreadListener(EventDispatcher.java:110)
E/GeckoAppShell(27290): 	at org.mozilla.gecko.webapp.EventListener.registerEvents(EventListener.java:49)
E/GeckoAppShell(27290): 	at org.mozilla.gecko.GeckoApp.onWindowFocusChanged(GeckoApp.java:1997)
E/GeckoAppShell(27290): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2647)
E/GeckoAppShell(27290): 	at android.view.View.dispatchWindowFocusChanged(View.java:7900)
E/GeckoAppShell(27290): 	at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:968)
E/GeckoAppShell(27290): 	at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3140)
E/GeckoAppShell(27290): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/GeckoAppShell(27290): 	at android.os.Looper.loop(Looper.java:136)
E/GeckoAppShell(27290): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
E/GeckoAppShell(27290): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoAppShell(27290): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/GeckoAppShell(27290): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/GeckoAppShell(27290): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/GeckoAppShell(27290): 	at dalvik.system.NativeStart.main(Native Method)
This makes the problem go away.
Attachment #8435465 - Flags: review?(nchen)
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Comment on attachment 8435465 [details] [diff] [review]
Use NativeEventListener in webapps. v1

Review of attachment 8435465 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM. Thanks!
Attachment #8435465 - Flags: review?(nchen) → review+
https://hg.mozilla.org/integration/fx-team/rev/1c4cdf7294f4

Bug 989046 landed in 31, so my guess is that this needs to be uplifted.
Blocks: 989046
Backed out 'cos it depends on the refactoring in Bug 1021342.

https://hg.mozilla.org/integration/fx-team/rev/d54d7a3105b6
Isn't this a duplicate of bug 1020926 which has patches on it already?
Huh, good job Bugzilla for not suggesting that bug :)

I think this is the correct fix. Parts of the work on that bug might apply too, but this is (a) necessary (the old approach is deprecated), (b) fixes the problem, so...
Changed my mind on waiting for the refactor.

https://hg.mozilla.org/integration/fx-team/rev/7331dd991a5c
No longer depends on: 1021342
Note to self: request uplift for bug 985614 after we request uplift for this bug.
Blocks: 985614
https://hg.mozilla.org/mozilla-central/rev/7331dd991a5c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 32
Comment on attachment 8435465 [details] [diff] [review]
Use NativeEventListener in webapps. v1

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
  Bug 989046.

User impact if declined: 
  Unable to use installed webapps. Blocks landing of Bug 985614.

Testing completed (on m-c, etc.): 
  Baked in Nightly, verified by hand, now rolled into Aurora.

Risk to taking this patch (and alternatives if risky): 
  Theoretical risk of different behavior between NativeJSObject and JSONObject (small). No real alternative.

String or IDL/UUID changes made by this patch:
  None.
Attachment #8435465 - Flags: approval-mozilla-beta?
Attachment #8435465 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Off the bat, this has a dependency on Bug 1004073, and all of its dependencies -- NativeEventListener made it into 31, but the EventDispatcher changes that came with it only got into 32.

I'll take a look at the patch, see if it can easily be reworked.
Attached patch Beta patch. v1 (obsolete) — Splinter Review
I attempted to manually translate the event listener calls as they apply on Beta.

Jim, did I get this right?

It builds, but I haven't tested yet. (I'm on PTO but I'm not very good at it.)
Attachment #8438125 - Flags: review?(nchen)
Are we using NativeEventListener for "Webapps:Postinstall" on Beta? Seems like we still use GeckoEventListener [1]. If so, we don't need to make the switch here.

[1] http://hg.mozilla.org/releases/mozilla-beta/file/tip/mobile/android/base/webapp/EventListener.java#l41
Flags: needinfo?(rnewman)
I can't reproduce this bug from my mozilla-beta tree. I can repro Bug 985614.
Flags: needinfo?(rnewman)
Attachment #8438125 - Attachment is obsolete: true
Attachment #8438125 - Flags: review?(nchen)
Attachment #8435465 - Flags: approval-mozilla-beta+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: