Fix crash due to texture view callback threading invariants.

Allow the client of a SurfaceTexture to specify the Handler to
which the update callback should be directed to avoid unnecessary
scheduling ping-pong between threads.

Fixed an invalid assumption in TextureView that it is attached
to the main looper which could result in a crash under certain
circumstances.  In normal app processes, it is true that TextureViews
must be created on the main looper since hardware rendering is
currently only supported on the main looper.  However, in the
system server, UI components run a different thread.  Although
hardware rendering is normally disabled in the system server,
it may be enabled for certain developer features.

Bug: 14445309
Change-Id: I5ae17ad018b9ef05ba87ec2f972c7c82e2bca70a
4 files changed