[ActivityManager] Reset ActivityRecord's waitingVisible

Symptom:
The ActivityRecord's waitingVisible is not set to false for
all cases when the ActivityRecord is removed from
mStackSupervisor.mWaitingVisibleActivities.

Solution:
Set the waitingVisible to false when it is removed from
mStackSupervisor.mWaitingVisibleActivities

Change-Id: If0f0683971d70a6866b0167e91dd95feebaac178
Correct a mistyped word "MSG_SET_CLEINT" to "MSG_SET_CLIENT"

"MSG_SET_CLEINT" is mistyped, so correct it.

Change-Id: Ib5eeaf7071e95db8b2375ca09d10420a5a445543
Fix "pm list permissions" crash if resource string missing

The "pm list permissions" command lists detailed information about
each permission on the system, including its label and description,
both of which can be stored as translatable resource strings in APK
files.  However, it is possible that the resource identifiers for
these strings point to non-existent resources.  When this happens, the
loadText() method throws Resources.NotFoundException, causing the "pm"
command to abort prematurely, simply printing "Killed" to stdout and
a stack trace to logcat.

This commit fixes the crash by explicitly catching the
Resources.NotFoundException exception in loadText() and returning null
if it is thrown.  The loadText() method already has the potential to
return null so none of its callers need be modified.  This fixes the
crash and simply shows "label:null" and/or "description:null" in the
output if the string resource is missing.

Change-Id: I92273399e1dac6029163750d004940ee1da67428
Fixed grammar in the comment that introduces the Debug.MemoryInfo class.

Change-Id: Ic021e689b7a8c55367277875b321358535c04e6a
Signed-off-by: justinmuller <justin.muller@acm.org>
Missing break in switch statement

Change-Id: I1b7e7a94df8d39e162050911e31e510d2ce5447e
Prevent duplicated registration of OnComputeInternalInsetsListener

OnComputeInternalInsetsListener is added when initViews is called,
and initViews is called by onCreate and onConfigurationChanged.
But it is removed only by onDestroy.
Therefore listeners are accumulated and it results performance issue.
So before adding, remove mInsetListener that was previously added.

Change-Id: I494d3f1875613d73d3f9b8e2af286b5800f03196