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

Commit f17a1afc authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam
Browse files

Set FLAG_UPDATED_SYSTEM_APP properly for APEX packages

An APEX package is either located in a built-in directory, in which case
it is a factory package and should be considered a system app, or it has
been updated and no longer a factory package and should be considered as
an updated-system-app.

Bug: 175872729
Test: atest StagedInstallTest#testApexSetsUpdatedSystemAppFlag
Change-Id: I9f7d7faa3a7ed6402512dc83faa112dbe2438976
parent 818939cd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -284,8 +284,10 @@ public class PackageInfoWithoutStateUtils {
            pi.applicationInfo.publicSourceDir = apexFile.getPath();
            if (apexInfo.isFactory) {
                pi.applicationInfo.flags |= ApplicationInfo.FLAG_SYSTEM;
                pi.applicationInfo.flags &= ~ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
            } else {
                pi.applicationInfo.flags &= ~ApplicationInfo.FLAG_SYSTEM;
                pi.applicationInfo.flags |= ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
            }
            if (apexInfo.isActive) {
                pi.applicationInfo.flags |= ApplicationInfo.FLAG_INSTALLED;