nicolas2k / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
1 stars 0 forks source link

My GDK Glassware can crash Home #341

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Glassware project using the GDK add-on, with a starting Service 
(let's call it "GlasswareService").
2. Create a class that implements SurfaceHolder.Callback (let's call it 
"LiveCardDrawer").
3. Introduce a fatal bug into LiveCardDrawer, such as a NullPointerException in 
surfaceCreated (just do something stupid like surfaceHolder = null; 
surfaceHolder.getSurface();).
4. In GlasswareService's onStartCommand(), call something like the following:
liveCard = timelineManager.createLiveCard(LIVE_CARD_TAG);
liveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(liveCard
Drawer);
(timelineManager is an instance of TimelineInstance and liveCardDrawer is an 
instance of LiveCardDrawer.)
5. Install and run the Glassware ("ok glass, <voice-trigger>").
6. When the bug in LiveCardDrawer is reached, read the "Home has stopped" 
message like the one attached.

What is the expected output? What do you see instead?
I would expect to see "<Name of my Glassware> has stopped" instead of "Home has 
stopped" because the latter renders my Glass useless for a few seconds as the 
entire system attempts to recover; the former just closes my app.

What version of the product are you using? On what operating system?
Glass Version 2 XE12 (developing Glassware using the GDK)

Please provide any additional information below.
Here are the logs from when the NullPointerException was encountered in 
LiveCardDrawer:
01-06 18:20:02.724  21342-21342/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NullPointerException
            at android.os.Parcel.readException(Parcel.java:1333)
            at android.os.Parcel.readException(Parcel.java:1281)
            at com.google.android.glass.timeline.ITimelineManager$Stub$Proxy.performDirectRenderingOperation(ITimelineManager.java:253)
            at com.google.android.glass.timeline.HostedCard.reportSurface(HostedCard.java:200)
            at com.google.android.glass.timeline.HostedCard.access$000(HostedCard.java:36)
            at com.google.android.glass.timeline.HostedCard$1.onSurfaceTextureAvailable(HostedCard.java:150)
            at android.view.TextureView.getHardwareLayer(TextureView.java:343)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2863)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.getDisplayList(View.java:10416)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.draw(View.java:10982)
            at com.google.glass.home.timeline.TimelineView.draw(TimelineView.java:121)
            at android.view.View.getDisplayList(View.java:10418)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.draw(View.java:10982)
            at android.widget.FrameLayout.draw(FrameLayout.java:450)
            at android.view.View.getDisplayList(View.java:10418)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.getDisplayList(View.java:10416)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.getDisplayList(View.java:10416)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.getDisplayList(View.java:10416)
            at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
            at android.view.View.draw(View.java:10982)
            at android.widget.FrameLayout.draw(FrameLayout.java:450)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2143)
            at android.view.View.getDisplayList(View.java:10418)
            at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:842)
            at android.view.ViewRootImpl.draw(ViewRootImpl.java:1919)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1643)
            at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2451)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4424)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
01-06 18:20:02.740      195-608/? W/ActivityManager﹕ Force finishing activity 
com.google.glass.home/.timeline.MainTimelineActivity
01-06 18:20:03.279      195-208/? W/ActivityManager﹕ Activity pause timeout 
for ActivityRecord{41880948 
com.google.glass.home/.timeline.MainTimelineActivity}
01-06 18:20:03.287      195-208/? I/ActivityManager﹕ START 
{act=android.intent.action.MAIN cat=[android.intent.category.HOME] 
flg=0x10000000 cmp=com.google.glass.home/.timeline.MainTimelineActivity} from 
pid 0

Original issue reported on code.google.com by warlock....@gmail.com on 7 Jan 2014 at 12:23

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,

This is working as intended as the process managing the life cycle of the 
LiveCard is "Home" which is why it crashes when trying to call your 
SurfaceHolder.Callback.

Best,
Alain

Original comment by ala...@google.com on 7 Jan 2014 at 12:30