[pm] fix acquireAndRegisterNewAppId after app removal
mFirstAvailableUid becomes (the last removed app ID + 1) after an app removal. acquireAndRegisterNewAppId should use the offset of mFirstAvailableUid as an index, not its actual value. Test: manual for now BUG: 216658672 Change-Id: Ie1b9ecafeb191129320243608c7f70eb2ea5c79e
This commit is contained in:
@@ -410,7 +410,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
int[] excludedUserIds;
|
||||
}
|
||||
|
||||
private static int mFirstAvailableUid = 0;
|
||||
private static int mFirstAvailableUid = Process.FIRST_APPLICATION_UID;
|
||||
|
||||
/** Map from volume UUID to {@link VersionInfo} */
|
||||
@Watched
|
||||
@@ -4271,7 +4271,7 @@ public final class Settings implements Watchable, Snappable {
|
||||
private int acquireAndRegisterNewAppIdLPw(SettingBase obj) {
|
||||
// Let's be stupidly inefficient for now...
|
||||
final int size = mAppIds.size();
|
||||
for (int i = mFirstAvailableUid; i < size; i++) {
|
||||
for (int i = mFirstAvailableUid - Process.FIRST_APPLICATION_UID; i < size; i++) {
|
||||
if (mAppIds.get(i) == null) {
|
||||
mAppIds.set(i, obj);
|
||||
return Process.FIRST_APPLICATION_UID + i;
|
||||
|
||||
Reference in New Issue
Block a user