[ProcessStas] fix index out of bounds when add duration.

Root Cause:
There is a defect in current ProcessStats design
and following is the scenario:
1. Process A is started due to activity with
name of A
2. Process A creates ProessState with application
uid of A
3. Process B is started due to isolated service
declared in application A with name of A
4. Process B uses ProcessState of Process A as
it uses same application uid of A
5. Process B is finished and it leads to
ProcessState marked as dead
6. Process A still keeps using the invalid
ProcessState in dead state
7. IndexOutOfBoundsException is triggered when
system tries to update process state of Process A

Resolution:
use process uid to replace application uid for
getProcessStatLocked.

Change-Id: I881ad9fc492c9e1a892c9e957180cebcfef8352d
Signed-off-by: Ronnie Leng <ronnie.leng@gmail.com>
1 file changed