Multiple fixes to CMAS app.

* Allow screen to turn off after 30 seconds for emergency alerts.
* When multiple alerts are received, show them in reverse order.
* After showing the first CMAS alert received on device (other than
  Presidential Alert), show opt-out dialog to allow user to
  opt-in or out of the various levels of CMAS alert.
* Start/stop animating warning icon in activity pause/resume.
* When multiple non-emergency alerts are received, show them all
  (most recent displayed first) when user selects the notification.
* For emergency alerts, start the dialog activity directly instead
  of creating a PendingIntent and full screen notification.
* Correctly save/restore the list of alerts in the alert dialog
  in onSaveInstanceState() when recreated after screen rotation.
* Fix test app to increment the message ID and to send the correct
  alerts when multiple alerts are selected with 5 second delay.

Bug: 6993660
Bug: 7041847
Bug: 7045506
Change-Id: Ic3ec08f0ebd693244891a4bf3a29479b832c2a3e
19 files changed