squashed: revert DocumentsUI changes

Revert "Fix DocumentsUI FC"

This reverts commit cd48d8b3d713eff1e1f986228b55b79f51be2487.

Revert "DocumentsUI: Handle NPE gracefully"

This reverts commit 8ba53655cf460690a80c6988baced9ad9bcd6322.

Revert "DocumentsUI: Remove catch-all statements"

This reverts commit 13a67f83ae8db62575461956a5507f1a33d7391d.

Change-Id: I1365d1be4c017b2b65e31b8dba46ce6ee6b1226d
(cherry picked from commit 950c79652335b6f8c3698c22bfb6895459814e71)
[View] Clear Hardware-Layers before system destroys HardwareRenderer​.

Symptom: Sometimes HardwareLayer display is corrupted.

Root Cause: In some cases, ViewRootImpl destroys HardwareRenderer​ without
clearing HardwareLayers in the view hirarchy. If the system trims memory fully
and kill the glContext at the same time, HardwareLayer may corrupt.

Solution: Clear Hardware-Layers before system destroys HardwareRenderer​.

Reproduce steps: Modify the cache's trim memory mechanism to make it easier to
trim fully, HardwareLayers implemented in app will easily be corrupted.
Modification of the cache is not required but make it easier to reproduce.

Change-Id: If57c802cdacf8dc37cbbcc199e74f9482834f981
(cherry picked from commit af52834898f45c62d83e4310c67907990d707543)
Skip broadcasting to a receiver if the receiver seems to be dead

If an application that has a broadcast receiver is killed
during broadcasting, thread variable of ProcessRecord becomes null
so that IIntentReceiver#performReceive() is called
in BroadcastQueue#performReceiveLocked(). But if binder driver has not
noticed the death of the application yet, it can't throw
DeadObjectException. After that, binder driver notices. But it can't
notify DeadObjectException to the caller because performReceive() is
async call. So broadcasting keeps on waiting for finishing
performReceive() until timeout.

This change checks the death of the application before calling
performReceive() and skips broadcasting to the receiver
if the application has already died.

Change-Id: Ifa02b8b1a7e7b6fd314de90fedff5b7a5326825d
(cherry picked from commit b3d8356d342b951374535346c1d939406720bcb2)