Fix a outer loop iterates on item that is removed by inner loop problem.
updateForegroundApps() has the outer loop that iterate on mActiveForegroundApps, but inside the loop stopAllForegroundServicesLocked() calls setServiceForegroundInnerLocked() which calls decActiveForegroundAppLocked() to remove item from mActiveForegroundApps, the end result is an ArrayIndexOutOfBoundsException. Bug: 243841000 Test: build and run Change-Id: Ia64816799fb7d36c481f382496c035e2ab85c2a3 (cherry picked from commit 7cfc1c2d)
Loading
Please register or sign in to comment