question

captainpenny avatar image
captainpenny asked

Fire TV Game Controller stop working on second run, leaks an IntentReceiver

Hello, We've encountered a bug with our game while porting it from Kindle Fires to the new Fire TV. We started by integrating the Amazon Game Controller's SDK, and things work perfectly on first run. But if we quit the game from the main menu (pressing back and confirming quit), when relaunching the game, the controller will not work at all. No input will be detected at all. If we quit the game by pressing the home button, or by going to Settings > Applications and force quitting the app, this problem does not occur. Unfortunately we're having a really hard time debugging the issue, so I was wondering if anyone had encountered this before and managed to fix it. My best hunch so far is this leaking IntentReceiver, which you can see in the adb logcat output below. Since the receiver is being registered inside Amazon's code for GameController.init(), I have no idea how we could possibly debug further because we don't have access to the JAR. Thanks for any help you can provide. ---------------------- Relevant adb logcat output: E/ActivityThread(16469): Activity com.company.testgame.Main has leaked IntentReceiver com.amazon.device.gamecontroller.GameController$1@4152e400 that was originally registered here. Are you missing a call to unregisterReceiver()? E/ActivityThread(16469): android.app.IntentReceiverLeaked: Activity com.company.testgame.Main has leaked IntentReceiver com.amazon.device.gamecontroller.GameController$1@4152e400 that was originally registered here. Are you missing a call to unregisterReceiver()? E/ActivityThread(16469): at android.app.LoadedApk$ReceiverDispatcher. (LoadedApk.java:805) E/ActivityThread(16469): at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:606) E/ActivityThread(16469): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1623) E/ActivityThread(16469): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1603) E/ActivityThread(16469): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1597) E/ActivityThread(16469): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:450) E/ActivityThread(16469): at com.amazon.device.gamecontroller.GameController.init(GameController.java:211) E/ActivityThread(16469): at com.s3eFireTV.s3eFireTVActivity.onCreate(s3eFireTVActivity.java:35) E/ActivityThread(16469): at android.app.Activity.performCreate(Activity.java:5158) E/ActivityThread(16469): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1085) E/ActivityThread(16469): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169) E/ActivityThread(16469): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255) E/ActivityThread(16469): at android.app.ActivityThread.access$600(ActivityThread.java:146) E/ActivityThread(16469): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243) E/ActivityThread(16469): at android.os.Handler.dispatchMessage(Handler.java:99) E/ActivityThread(16469): at android.os.Looper.loop(Looper.java:137) E/ActivityThread(16469): at android.app.ActivityThread.main(ActivityThread.java:5104) E/ActivityThread(16469): at java.lang.reflect.Method.invokeNative(Native Method) E/ActivityThread(16469): at java.lang.reflect.Method.invoke(Method.java:511) E/ActivityThread(16469): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) E/ActivityThread(16469): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) E/ActivityThread(16469): at dalvik.system.NativeStart.main(Native Method)
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Captainpenny, Can you share your apk with me? To protect the personal information of developers, we do not discuss the details of specific applications on these discussion forums, but request that you reach out to us via the ContactUs form. This allows us to validate your identity and discuss app specific information in a context that will not expose personal and proprietary information. Please put a reference of this thread url in the case you are going to raise for this issue. With out looking at the behavior and probably the code, I would not able to help you out.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

captainpenny avatar image
captainpenny answered
Hi Sujoy, Okay, I've sent you guys a request via the Contact Us form, with a link back to this thread. Please let me know if I can provide anything else. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Thanks. We will answer it shortly.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.