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

Commit 7a69b619 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Automerger Merge Worker
Browse files

Merge "Remove dex2oat_headers." am: 0fd8d797 am: ee49a5a3 am: 361c9892 am: 57453886

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1408233

Change-Id: I6e14b27b13ce5b7d239e8ad871547988f7599313
parents 83fd9563 57453886
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -25,9 +25,6 @@ cc_defaults {
        "view_compiler.cpp",
        ":installd_aidl",
    ],
    header_libs: [
        "dex2oat_headers",
    ],
    shared_libs: [
        "libbase",
        "libbinder",
@@ -241,8 +238,6 @@ cc_binary {
        "view_compiler.cpp",
    ],

    header_libs: ["dex2oat_headers"],

    static_libs: [
        "libdiskusage",
        "libotapreoptparameters",
+0 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include <cutils/fs.h>
#include <cutils/properties.h>
#include <cutils/sched_policy.h>
#include <dex2oat_return_codes.h>
#include <log/log.h>               // TODO: Move everything to base/logging.
#include <openssl/sha.h>
#include <private/android_filesystem_config.h>
+7 −36
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@
 * limitations under the License.
 */

#include <dex2oat_return_codes.h>

namespace android {
namespace installd {

@@ -70,48 +68,21 @@ inline const char* get_installd_return_code_name(DexoptReturnCodes code) {
    return nullptr;
}

inline const char* get_dex2oat_return_code_name(art::dex2oat::ReturnCode code) {
    switch (code) {
        case art::dex2oat::ReturnCode::kNoFailure:
inline const char* get_dex2oat_return_code_name(int code) {
    if (code == 0) {
        return "dex2oat success";
        case art::dex2oat::ReturnCode::kOther:
            return "unspecified dex2oat error";
        case art::dex2oat::ReturnCode::kCreateRuntime:
            return "dex2oat failed to create a runtime";
    } else {
        return "dex2oat error";
    }
    return nullptr;
}

// Get some slightly descriptive string for the return code. Handles both DexoptReturnCodes (local
// exit codes) as well as art::dex2oat::ReturnCode.
// Get some slightly descriptive string for the return code.
inline const char* get_return_code_name(int code) {
    // Try to enforce non-overlap (see comment on DexoptReturnCodes)
    // TODO: How could switch-case checks be used to enforce completeness?
    switch (code) {
        case kSetGid:
        case kSetUid:
        case kCapSet:
        case kFlock:
        case kProfmanExec:
        case kSetSchedPolicy:
        case kSetPriority:
        case kDex2oatExec:
        case kInstructionSetLength:
        case kHashValidatePath:
        case kHashOpenPath:
        case kHashReadDex:
        case kHashWrite:
            break;
        case static_cast<int>(art::dex2oat::ReturnCode::kNoFailure):
        case static_cast<int>(art::dex2oat::ReturnCode::kOther):
        case static_cast<int>(art::dex2oat::ReturnCode::kCreateRuntime):
            break;
    }
    const char* value = get_installd_return_code_name(static_cast<DexoptReturnCodes>(code));
    if (value != nullptr) {
        return value;
    }
    value = get_dex2oat_return_code_name(static_cast<art::dex2oat::ReturnCode>(code));
    value = get_dex2oat_return_code_name(code);
    return value;
}

+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@
#include <android-base/strings.h>
#include <cutils/fs.h>
#include <cutils/properties.h>
#include <dex2oat_return_codes.h>
#include <log/log.h>
#include <private/android_filesystem_config.h>

+1 −1
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ TEST_F(DexoptTest, DexoptPrimaryFailedInvalidFilter) {
                          &status);
    EXPECT_STREQ(status.toString8().c_str(),
                 "Status(-8, EX_SERVICE_SPECIFIC): \'256: Dex2oat invocation for "
                 "/data/app/com.installd.test.dexopt/base.jar failed: unspecified dex2oat error'");
                 "/data/app/com.installd.test.dexopt/base.jar failed: dex2oat error'");
}

TEST_F(DexoptTest, DexoptPrimaryProfileNonPublic) {