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

Commit bdb3f87e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-bd6aa7dd-7b02-4794-942c-14599bf61208-for-git_oc-mr1-release-41...

release-request-bd6aa7dd-7b02-4794-942c-14599bf61208-for-git_oc-mr1-release-4193791 snap-temp-L98700000083613807

Change-Id: I5d40b5c055274f082826bc1b128092a22ffc9769
parents f597b7b4 7e542319
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1826,7 +1826,7 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t
        int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags,
        int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags,
        const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid,
        const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid,
        const std::unique_ptr<std::string>& sharedLibraries,
        const std::unique_ptr<std::string>& sharedLibraries,
        const std::unique_ptr<std::string>& seInfo) {
        const std::unique_ptr<std::string>& seInfo, bool downgrade) {
    ENFORCE_UID(AID_SYSTEM);
    ENFORCE_UID(AID_SYSTEM);
    CHECK_ARGUMENT_UUID(uuid);
    CHECK_ARGUMENT_UUID(uuid);
    if (packageName && *packageName != "*") {
    if (packageName && *packageName != "*") {
@@ -1843,7 +1843,8 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t
    const char* shared_libraries = sharedLibraries ? sharedLibraries->c_str() : nullptr;
    const char* shared_libraries = sharedLibraries ? sharedLibraries->c_str() : nullptr;
    const char* se_info = seInfo ? seInfo->c_str() : nullptr;
    const char* se_info = seInfo ? seInfo->c_str() : nullptr;
    int res = android::installd::dexopt(apk_path, uid, pkgname, instruction_set, dexoptNeeded,
    int res = android::installd::dexopt(apk_path, uid, pkgname, instruction_set, dexoptNeeded,
            oat_dir, dexFlags, compiler_filter, volume_uuid, shared_libraries, se_info);
            oat_dir, dexFlags, compiler_filter, volume_uuid, shared_libraries, se_info,
            downgrade);
    return res ? error(res, "Failed to dexopt") : ok();
    return res ? error(res, "Failed to dexopt") : ok();
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ public:
            int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags,
            int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags,
            const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid,
            const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid,
            const std::unique_ptr<std::string>& sharedLibraries,
            const std::unique_ptr<std::string>& sharedLibraries,
            const std::unique_ptr<std::string>& seInfo);
            const std::unique_ptr<std::string>& seInfo, bool downgrade);


    binder::Status rmdex(const std::string& codePath, const std::string& instructionSet);
    binder::Status rmdex(const std::string& codePath, const std::string& instructionSet);


+1 −1
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ interface IInstalld {
            @nullable @utf8InCpp String outputPath, int dexFlags,
            @nullable @utf8InCpp String outputPath, int dexFlags,
            @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid,
            @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid,
            @nullable @utf8InCpp String sharedLibraries,
            @nullable @utf8InCpp String sharedLibraries,
            @nullable @utf8InCpp String seInfo);
            @nullable @utf8InCpp String seInfo, boolean downgrade);


    void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet);
    void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet);


+16 −6
Original line number Original line Diff line number Diff line
@@ -1359,7 +1359,7 @@ void update_out_oat_access_times(const char* apk_path, const char* out_oat_path)
// If this is for a profile guided compilation, profile_was_updated will tell whether or not
// If this is for a profile guided compilation, profile_was_updated will tell whether or not
// the profile has changed.
// the profile has changed.
static void exec_dexoptanalyzer(const std::string& dex_file, const std::string& instruction_set,
static void exec_dexoptanalyzer(const std::string& dex_file, const std::string& instruction_set,
        const std::string& compiler_filter, bool profile_was_updated) {
        const std::string& compiler_filter, bool profile_was_updated, bool downgrade) {
    static const char* DEXOPTANALYZER_BIN = "/system/bin/dexoptanalyzer";
    static const char* DEXOPTANALYZER_BIN = "/system/bin/dexoptanalyzer";
    static const unsigned int MAX_INSTRUCTION_SET_LEN = 7;
    static const unsigned int MAX_INSTRUCTION_SET_LEN = 7;


@@ -1373,9 +1373,13 @@ static void exec_dexoptanalyzer(const std::string& dex_file, const std::string&
    std::string isa_arg = "--isa=" + instruction_set;
    std::string isa_arg = "--isa=" + instruction_set;
    std::string compiler_filter_arg = "--compiler-filter=" + compiler_filter;
    std::string compiler_filter_arg = "--compiler-filter=" + compiler_filter;
    const char* assume_profile_changed = "--assume-profile-changed";
    const char* assume_profile_changed = "--assume-profile-changed";
    const char* downgrade_flag = "--downgrade";


    // program name, dex file, isa, filter, the final NULL
    // program name, dex file, isa, filter, the final NULL
    const char* argv[5 + (profile_was_updated ? 1 : 0)];
    const int argc = 5 +
        (profile_was_updated ? 1 : 0) +
        (downgrade ? 1 : 0);
    const char* argv[argc];
    int i = 0;
    int i = 0;
    argv[i++] = DEXOPTANALYZER_BIN;
    argv[i++] = DEXOPTANALYZER_BIN;
    argv[i++] = dex_file_arg.c_str();
    argv[i++] = dex_file_arg.c_str();
@@ -1384,6 +1388,9 @@ static void exec_dexoptanalyzer(const std::string& dex_file, const std::string&
    if (profile_was_updated) {
    if (profile_was_updated) {
        argv[i++] = assume_profile_changed;
        argv[i++] = assume_profile_changed;
    }
    }
    if (downgrade) {
        argv[i++] = downgrade_flag;
    }
    argv[i] = NULL;
    argv[i] = NULL;


    execv(DEXOPTANALYZER_BIN, (char * const *)argv);
    execv(DEXOPTANALYZER_BIN, (char * const *)argv);
@@ -1464,7 +1471,7 @@ static bool process_dexoptanalyzer_result(const std::string& dex_path, int resul
static bool process_secondary_dex_dexopt(const char* original_dex_path, const char* pkgname,
static bool process_secondary_dex_dexopt(const char* original_dex_path, const char* pkgname,
        int dexopt_flags, const char* volume_uuid, int uid, const char* instruction_set,
        int dexopt_flags, const char* volume_uuid, int uid, const char* instruction_set,
        const char* compiler_filter, bool* is_public_out, int* dexopt_needed_out,
        const char* compiler_filter, bool* is_public_out, int* dexopt_needed_out,
        std::string* oat_dir_out, std::string* dex_path_out) {
        std::string* oat_dir_out, std::string* dex_path_out, bool downgrade) {
    int storage_flag;
    int storage_flag;


    if ((dexopt_flags & DEXOPT_STORAGE_CE) != 0) {
    if ((dexopt_flags & DEXOPT_STORAGE_CE) != 0) {
@@ -1533,7 +1540,8 @@ static bool process_secondary_dex_dexopt(const char* original_dex_path, const ch
        // child -- drop privileges before continuing.
        // child -- drop privileges before continuing.
        drop_capabilities(uid);
        drop_capabilities(uid);
        // Run dexoptanalyzer to get dexopt_needed code.
        // Run dexoptanalyzer to get dexopt_needed code.
        exec_dexoptanalyzer(dex_path, instruction_set, compiler_filter, profile_was_updated);
        exec_dexoptanalyzer(dex_path, instruction_set, compiler_filter, profile_was_updated,
                            downgrade);
        exit(DEXOPTANALYZER_BIN_EXEC_ERROR);
        exit(DEXOPTANALYZER_BIN_EXEC_ERROR);
    }
    }


@@ -1560,7 +1568,8 @@ static bool process_secondary_dex_dexopt(const char* original_dex_path, const ch


int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set,
int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set,
        int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
        int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
        const char* volume_uuid, const char* shared_libraries, const char* se_info) {
        const char* volume_uuid, const char* shared_libraries, const char* se_info,
        bool downgrade) {
    CHECK(pkgname != nullptr);
    CHECK(pkgname != nullptr);
    CHECK(pkgname[0] != 0);
    CHECK(pkgname[0] != 0);
    if ((dexopt_flags & ~DEXOPT_MASK) != 0) {
    if ((dexopt_flags & ~DEXOPT_MASK) != 0) {
@@ -1583,7 +1592,8 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins
    if (is_secondary_dex) {
    if (is_secondary_dex) {
        if (process_secondary_dex_dexopt(dex_path, pkgname, dexopt_flags, volume_uuid, uid,
        if (process_secondary_dex_dexopt(dex_path, pkgname, dexopt_flags, volume_uuid, uid,
                instruction_set, compiler_filter, &is_public, &dexopt_needed, &oat_dir_str,
                instruction_set, compiler_filter, &is_public, &dexopt_needed, &oat_dir_str,
                &dex_real_path)) {
                &dex_real_path,
                downgrade)) {
            oat_dir = oat_dir_str.c_str();
            oat_dir = oat_dir_str.c_str();
            dex_path = dex_real_path.c_str();
            dex_path = dex_real_path.c_str();
            if (dexopt_needed == NO_DEXOPT_NEEDED) {
            if (dexopt_needed == NO_DEXOPT_NEEDED) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,8 @@ bool reconcile_secondary_dex_file(const std::string& dex_path,


int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
        int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
        int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
        const char* volume_uuid, const char* shared_libraries, const char* se_info);
        const char* volume_uuid, const char* shared_libraries, const char* se_info,
        bool downgrade);


}  // namespace installd
}  // namespace installd
}  // namespace android
}  // namespace android
Loading