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

Commit 2dab9d97 authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] fix nullable data dir in ApplicationInfo

After b/314207341 is fixed, the code path for generating ApplicationInfo after
"uninstall -k --user 0" and then "uninstall --user 10" has changed. The
reason is that we no longer keep the AndroidPackage object around for
this scenario. Update the nullableDataDir logic to reflect that.

Test: atest
android.content.pm.cts.PackageManagerShellCommandMultiUserTest#testNullableDataDirEnabled
BUG: 319383840

Change-Id: I2ca5b05f8e3c0776188b1b167bac56092aeb189d
parent f687e4ee
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -421,6 +421,11 @@ public class PackageInfoUtils {
        if (ai.isArchived) {
            ai.nonLocalizedLabel = state.getArchiveState().getActivityInfos().get(0).getTitle();
        }
        if (!state.isInstalled() && !state.dataExists()
                && android.content.pm.Flags.nullableDataDir()) {
            // The data dir has been deleted
            ai.dataDir = null;
        }
    }

    @Nullable