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

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

release-request-66ee9889-2756-44aa-9b4c-91e7b5c1058c-for-git_oc-dr1-release-39...

release-request-66ee9889-2756-44aa-9b4c-91e7b5c1058c-for-git_oc-dr1-release-3988462 snap-temp-L14700000061937187

Change-Id: Ib9d02b95ff648e770ac8255453eb7d1acd9807fa
parents c3a53877 7021a02f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1100,11 +1100,14 @@ binder::Status InstalldNativeService::rmdex(const std::string& codePath,

    ALOGV("unlink %s\n", dex_path);
    if (unlink(dex_path) < 0) {
        // It's ok if we don't have a dalvik cache path. Report error only when the path exists
        // but could not be unlinked.
        if (errno != ENOENT) {
            return error(StringPrintf("Failed to unlink %s", dex_path));
    } else {
        return ok();
        }
    }
    return ok();
}

struct stats {
    int64_t codeSize;
+7 −9
Original line number Diff line number Diff line
@@ -38,23 +38,21 @@ constexpr size_t PKG_PATH_MAX = 256u; /* max size of any path we use */
 * frameworks/base/services/core/java/com/android/server/pm/Installer.java
 ***************************************************************************/
constexpr int DEXOPT_PUBLIC         = 1 << 1;
constexpr int DEXOPT_SAFEMODE       = 1 << 2;
constexpr int DEXOPT_DEBUGGABLE     = 1 << 3;
constexpr int DEXOPT_BOOTCOMPLETE   = 1 << 4;
constexpr int DEXOPT_PROFILE_GUIDED = 1 << 5;
constexpr int DEXOPT_SECONDARY_DEX  = 1 << 6;
constexpr int DEXOPT_DEBUGGABLE     = 1 << 2;
constexpr int DEXOPT_BOOTCOMPLETE   = 1 << 3;
constexpr int DEXOPT_PROFILE_GUIDED = 1 << 4;
constexpr int DEXOPT_SECONDARY_DEX  = 1 << 5;
// DEXOPT_FORCE, DEXOPT_STORAGE_CE, DEXOPT_STORAGE_DE are exposed for secondary
// dex files only. Primary apks are analyzed in PackageManager and installd
// does not need to know if the compilation is forced or on what kind of storage
// the dex files are.
constexpr int DEXOPT_FORCE          = 1 << 7;
constexpr int DEXOPT_STORAGE_CE     = 1 << 8;
constexpr int DEXOPT_STORAGE_DE     = 1 << 9;
constexpr int DEXOPT_FORCE          = 1 << 6;
constexpr int DEXOPT_STORAGE_CE     = 1 << 7;
constexpr int DEXOPT_STORAGE_DE     = 1 << 8;

/* all known values for dexopt flags */
constexpr int DEXOPT_MASK =
    DEXOPT_PUBLIC
    | DEXOPT_SAFEMODE
    | DEXOPT_DEBUGGABLE
    | DEXOPT_BOOTCOMPLETE
    | DEXOPT_PROFILE_GUIDED
+2 −2
Original line number Diff line number Diff line
@@ -472,7 +472,8 @@ private:
                case 6: {
                    // Version 1 had:
                    constexpr int OLD_DEXOPT_PUBLIC         = 1 << 1;
                    constexpr int OLD_DEXOPT_SAFEMODE       = 1 << 2;
                    // Note: DEXOPT_SAFEMODE has been removed.
                    // constexpr int OLD_DEXOPT_SAFEMODE       = 1 << 2;
                    constexpr int OLD_DEXOPT_DEBUGGABLE     = 1 << 3;
                    constexpr int OLD_DEXOPT_BOOTCOMPLETE   = 1 << 4;
                    constexpr int OLD_DEXOPT_PROFILE_GUIDED = 1 << 5;
@@ -480,7 +481,6 @@ private:
                    int input = atoi(param);
                    package_parameters_.dexopt_flags =
                            ReplaceMask(input, OLD_DEXOPT_PUBLIC, DEXOPT_PUBLIC) |
                            ReplaceMask(input, OLD_DEXOPT_SAFEMODE, DEXOPT_SAFEMODE) |
                            ReplaceMask(input, OLD_DEXOPT_DEBUGGABLE, DEXOPT_DEBUGGABLE) |
                            ReplaceMask(input, OLD_DEXOPT_BOOTCOMPLETE, DEXOPT_BOOTCOMPLETE) |
                            ReplaceMask(input, OLD_DEXOPT_PROFILE_GUIDED, DEXOPT_PROFILE_GUIDED) |
+14 −4
Original line number Diff line number Diff line
@@ -54,10 +54,12 @@ bool calculate_odex_file_path(char path[PKG_PATH_MAX] ATTRIBUTE_UNUSED,
    return false;
}

bool create_cache_path(char path[PKG_PATH_MAX] ATTRIBUTE_UNUSED,
        const char *src ATTRIBUTE_UNUSED,
        const char *instruction_set ATTRIBUTE_UNUSED) {
    return false;
bool create_cache_path(char path[PKG_PATH_MAX],
        const char *src,
        const char *instruction_set) {
    // Not really a valid path but it's good enough for testing.
    sprintf(path,"/data/dalvik-cache/%s/%s", instruction_set, src);
    return true;
}

static void mkdir(const char* path, uid_t owner, gid_t group, mode_t mode) {
@@ -151,5 +153,13 @@ TEST_F(ServiceTest, FixupAppData_Moved) {
    EXPECT_EQ(10000, stat_gid("com.example/bar/file"));
}

TEST_F(ServiceTest, RmDexNoDalvikCache) {
    LOG(INFO) << "RmDexNoDalvikCache";

    // Try to remove a non existing dalvik cache dex. The call should be
    // successful because there's nothing to remove.
    EXPECT_TRUE(service->rmdex("com.example", "arm").isOk());
}

}  // namespace installd
}  // namespace android
+2 −2
Original line number Diff line number Diff line
@@ -140,10 +140,10 @@ status_t BufferHubQueueProducer::dequeueBuffer(
    LocalHandle fence;
    auto buffer_status  =
        core_->producer_->Dequeue(core_->dequeue_timeout_ms_, &slot, &fence);
    if (!buffer_producer)
      return NO_MEMORY;

    buffer_producer = buffer_status.take();
    if (!buffer_producer)
      return NO_MEMORY;

    if (width == buffer_producer->width() &&
        height == buffer_producer->height() &&
Loading