Change ActivityView startActivity state sequence

Problems arise if an activity is started in an ActivityView when the
parent activity is not resumed. In particular the ActivityView can
be brought to the front in front of other activities that have been
started by the parent.

This change checks the state of the parent when the ActivityView is
starting and if it is not resumed, throws an Exception.

This change also removes the queueing up of Intents if the surface
does not exist when startActivity is called. Now, the owner of the
ActivityView is notified when the surface becomes available. If
startActivity is called before that notification an Exception will be
thrown.

Fixes bug 19147472.

Change-Id: I6712cf1929fe65c4238ce7f3feb4e8511ed97244
4 files changed