Shell user needs UPDATE_APP_OPS_STATS

 * CTS fail with "bmgr run"

Change-Id: Ic950cda4363f8f2a4edfcb330a4d5b506a6c3685
Avoid IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within for loop may delete
the elements from History stack.

Change-Id: Iad9bdc6521b25b12d4c67e6b89f375a99b17748b
CRs-Fixed: 535900
Merge remote-tracking branch 'cm/cm-10.2' into cm-10.2