Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2cbfdc4 authored by Song Chun Fan's avatar Song Chun Fan
Browse files

[pm] don't call onChanged at the end of commitPackageStateMutation

onChanged() is the trigger of snapshot building. During commitPackageStateMutation, it should already be called when the set* methods of PackageSetting or PackageUserStateImpl are called as part of the mutation. One exception is setLastPackageUsageTimeInMills, we intentionally don't want to call onChanged() because of its frequent updates. Having another onChanged in commitPackageStateMutation is unnecessary and can cause unwanted snapshotting, as shown in b/298096460. Removing it to avoid future misuses.

Change-Id: Iaf201c43c394059f71181308a2b89dd65ba68e8e
BUG: 298409017
Test: presubmit
parent 86da59b4
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -7791,7 +7791,6 @@ public class PackageManagerService implements PackageSender, TestUtilityService


            consumer.accept(mPackageStateMutator);
            consumer.accept(mPackageStateMutator);
            mPackageStateMutator.onFinished();
            mPackageStateMutator.onFinished();
            onChanged();
        }
        }


        return PackageStateMutator.Result.SUCCESS;
        return PackageStateMutator.Result.SUCCESS;