[pm] consolidate clearPackageStateForUser
Mostly a refactoring to consolidate duplicated code. The old code had duplicated logic for clearing state for a single user vs for UserHandle.USER_ALL. In the old code, there are inconsistencies regarding whether certain states should be cleared based whether DELETE_KEEP_DATA is set. This CL makes the following changes: * destroyAppProfilesLIF. Old behavior: for single user, it is called regardless of DELETE_KEEP_DATA. For ALL_USER, it is called only if DELETE_KEEP_DATA is not set. New behavior: it is always called regardless of DELETE_KEEP_DATA. * mDomainVerificationManager.clearPackageForUser. Old behavior: for single user, it is called regardless of DELETE_KEEP_DATA. For ALL_USER, it is called only if DELETE_KEEP_DATA is not set. New behavior: it is called only if DELETE_KEEP_DATA is not set. * clearPackagePreferredActivities and clearKeystoreData. Same as above. All the states will be preserved if DELETE_KEEP_DATA is set, except for ART profiles. Delete for a single `--user` will be consistent with delete for all users. BUG: 314207341 Test: atest CtsPackageManagerTest Change-Id: Iba3c3b6ba77e85122707683592f18f67054f9f31
Loading
Please register or sign in to comment