diff options
| -rw-r--r-- | cmds/installd/Android.bp | 5 | ||||
| -rw-r--r-- | cmds/installd/dexopt.cpp | 1 | ||||
| -rw-r--r-- | cmds/installd/dexopt_return_codes.h | 43 | ||||
| -rw-r--r-- | cmds/installd/otapreopt.cpp | 1 | ||||
| -rw-r--r-- | cmds/installd/tests/installd_dexopt_test.cpp | 2 |
5 files changed, 8 insertions, 44 deletions
diff --git a/cmds/installd/Android.bp b/cmds/installd/Android.bp index c91e449d89..5fa59a5f40 100644 --- a/cmds/installd/Android.bp +++ b/cmds/installd/Android.bp @@ -24,9 +24,6 @@ cc_defaults { "view_compiler.cpp", ":installd_aidl", ], - header_libs: [ - "dex2oat_headers", - ], shared_libs: [ "libbase", "libbinder", @@ -239,8 +236,6 @@ cc_binary { "view_compiler.cpp", ], - header_libs: ["dex2oat_headers"], - static_libs: [ "libdiskusage", "libotapreoptparameters", diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp index 2b36067983..82ea746475 100644 --- a/cmds/installd/dexopt.cpp +++ b/cmds/installd/dexopt.cpp @@ -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> diff --git a/cmds/installd/dexopt_return_codes.h b/cmds/installd/dexopt_return_codes.h index bbecfa4223..e5198ad70f 100644 --- a/cmds/installd/dexopt_return_codes.h +++ b/cmds/installd/dexopt_return_codes.h @@ -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: - return "dex2oat success"; - case art::dex2oat::ReturnCode::kOther: - return "unspecified dex2oat error"; - case art::dex2oat::ReturnCode::kCreateRuntime: - return "dex2oat failed to create a runtime"; +inline const char* get_dex2oat_return_code_name(int code) { + if (code == 0) { + return "dex2oat success"; + } 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; } diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp index 5981014500..443821c3b9 100644 --- a/cmds/installd/otapreopt.cpp +++ b/cmds/installd/otapreopt.cpp @@ -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> diff --git a/cmds/installd/tests/installd_dexopt_test.cpp b/cmds/installd/tests/installd_dexopt_test.cpp index 96f5e44030..fbf1e0c4b6 100644 --- a/cmds/installd/tests/installd_dexopt_test.cpp +++ b/cmds/installd/tests/installd_dexopt_test.cpp @@ -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) { |