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

Commit dd59966f authored by Jiakai Zhang's avatar Jiakai Zhang Committed by Automerger Merge Worker
Browse files

Merge "Add a method to installd to delete a reference profile." into tm-dev am: 91030925

parents c621ccd8 91030925
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -1176,6 +1176,25 @@ binder::Status InstalldNativeService::destroyAppProfiles(const std::string& pack
    return res;
    return res;
}
}


binder::Status InstalldNativeService::deleteReferenceProfile(const std::string& packageName,
                                                             const std::string& profileName) {
    ENFORCE_UID(AID_SYSTEM);
    CHECK_ARGUMENT_PACKAGE_NAME(packageName);
    LOCK_PACKAGE();

    // This function only supports primary dex'es.
    std::string path =
            create_reference_profile_path(packageName, profileName, /*is_secondary_dex=*/false);
    if (unlink(path.c_str()) != 0) {
        if (errno == ENOENT) {
            return ok();
        } else {
            return error("Failed to delete profile " + profileName + " for " + packageName);
        }
    }
    return ok();
}

binder::Status InstalldNativeService::destroyAppData(const std::optional<std::string>& uuid,
binder::Status InstalldNativeService::destroyAppData(const std::optional<std::string>& uuid,
        const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode) {
        const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode) {
    ENFORCE_UID(AID_SYSTEM);
    ENFORCE_UID(AID_SYSTEM);
+2 −0
Original line number Original line Diff line number Diff line
@@ -140,6 +140,8 @@ public:
            bool* _aidl_return);
            bool* _aidl_return);
    binder::Status clearAppProfiles(const std::string& packageName, const std::string& profileName);
    binder::Status clearAppProfiles(const std::string& packageName, const std::string& profileName);
    binder::Status destroyAppProfiles(const std::string& packageName);
    binder::Status destroyAppProfiles(const std::string& packageName);
    binder::Status deleteReferenceProfile(const std::string& packageName,
                                          const std::string& profileName);


    binder::Status createProfileSnapshot(int32_t appId, const std::string& packageName,
    binder::Status createProfileSnapshot(int32_t appId, const std::string& packageName,
            const std::string& profileName, const std::string& classpath, bool* _aidl_return);
            const std::string& profileName, const std::string& classpath, bool* _aidl_return);
+1 −0
Original line number Original line Diff line number Diff line
@@ -82,6 +82,7 @@ interface IInstalld {
            @utf8InCpp String packageName, @utf8InCpp String profileName);
            @utf8InCpp String packageName, @utf8InCpp String profileName);
    void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName);
    void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName);
    void destroyAppProfiles(@utf8InCpp String packageName);
    void destroyAppProfiles(@utf8InCpp String packageName);
    void deleteReferenceProfile(@utf8InCpp String packageName, @utf8InCpp String profileName);


    boolean createProfileSnapshot(int appId, @utf8InCpp String packageName,
    boolean createProfileSnapshot(int appId, @utf8InCpp String packageName,
            @utf8InCpp String profileName, @utf8InCpp String classpath);
            @utf8InCpp String profileName, @utf8InCpp String classpath);