title: ANR in Canvas.native_drawBitmap
body: <p>I've been receiving the same ANR reports recently.
  The ANR happens when app tries to draw some bitmaps (when rendering a GridView with ImageViews as elements).
  I've did a lot of debugging and can now surely say that hangs don't depend neither on bitmap, nor on position where it's being drawn.</p>
  
  <p>The heap is 50% free, images are no bigger than 400px^2<br>
  Grid elements doesn't have any custom layout - just simple ImageView.<br>
  Tested on HTC Desire (1 GHz CPU), Hero, emulators, etc.<br>
  The ANR continues <strong>forever</strong> so it's like some infinite loop is running while drawing bitmap.  </p>
  
  <p>What else can cause such a hang?</p>
  
  <p>The report follows:</p>
  
  <pre><code>DALVIK THREADS:
  "main" prio=5 tid=1 NATIVE
    | group="main" sCount=1 dsCount=0 s=N obj=0x40020ba0 self=0xddd0
    | sysTid=32366 nice=0 sched=0/0 cgrp=unknown handle=-1345025972
    at android.graphics.Canvas.native_drawBitmap(Native Method)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1045)
    at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:323)
    at android.widget.ImageView.onDraw(ImageView.java:860)
    at android.view.View.draw(View.java:6740)
    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
    at android.view.View.draw(View.java:6743)
    at android.widget.FrameLayout.draw(FrameLayout.java:352)
    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
    at android.view.View.draw(View.java:6743)
    at android.widget.FrameLayout.draw(FrameLayout.java:352)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847)
    at android.view.ViewRoot.draw(ViewRoot.java:1407)
    at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4627)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>