Snap for 4620899 from e283f998c6 to pi-release

Change-Id: I608dbf55e50bc2e2c3bf3342904f8e8a5ef38a07
gugelfrei
android-build-team Robot 6 years ago
commit f53cb1f378

@ -134,6 +134,7 @@ cc_library_static {
"model/ObbVolume.cpp",
],
static_libs: [
"arc_services_aidl",
"libarcobbvolume",
],
shared_libs: [
@ -155,6 +156,7 @@ cc_binary {
product_variables: {
arc: {
static_libs: [
"arc_services_aidl",
"libarcobbvolume",
],
shared_libs: [

@ -225,6 +225,9 @@ static bool waitForGc(const std::list<std::string>& paths) {
static int startGc(const std::list<std::string>& paths) {
for (const auto& path : paths) {
LOG(DEBUG) << "Start GC on " << path;
if (!WriteStringToFile("1", path + "/discard_granularity")) {
PLOG(WARNING) << "Set discard gralunarity failed on" << path;
}
if (!WriteStringToFile("1", path + "/gc_urgent")) {
PLOG(WARNING) << "Start GC failed on " << path;
}
@ -238,6 +241,9 @@ static int stopGc(const std::list<std::string>& paths) {
if (!WriteStringToFile("0", path + "/gc_urgent")) {
PLOG(WARNING) << "Stop GC failed on " << path;
}
if (!WriteStringToFile("16", path + "/discard_granularity")) {
PLOG(WARNING) << "Set discard gralunarity failed on" << path;
}
}
return android::OK;
}

@ -110,17 +110,16 @@ int Loop::destroyByDevice(const char *loopDevice) {
int Loop::destroyAll() {
ATRACE_NAME("Loop::destroyAll");
DIR* dir;
struct dirent* de;
std::string root = "/dev/block/";
if (!(dir = opendir(root.c_str()))) {
auto dirp = std::unique_ptr<DIR, int (*)(DIR*)>(opendir(root.c_str()), closedir);
if (!dirp) {
PLOG(ERROR) << "Failed to opendir";
return -1;
}
// Poke through all devices looking for loops
while ((de = readdir(dir))) {
struct dirent* de;
while ((de = readdir(dirp.get()))) {
auto test = std::string(de->d_name);
if (!android::base::StartsWith(test, "loop")) continue;
@ -151,7 +150,6 @@ int Loop::destroyAll() {
}
}
closedir(dir);
return 0;
}

@ -257,6 +257,7 @@ status_t Disk::readMetadata() {
PLOG(WARNING) << "Failed to read vendor from " << path;
return -errno;
}
tmp = android::base::Trim(tmp);
mLabel = tmp;
break;
}
@ -267,6 +268,7 @@ status_t Disk::readMetadata() {
PLOG(WARNING) << "Failed to read manufacturer from " << path;
return -errno;
}
tmp = android::base::Trim(tmp);
int64_t manfid;
if (!android::base::ParseInt(tmp, &manfid)) {
PLOG(WARNING) << "Failed to parse manufacturer " << tmp;

Loading…
Cancel
Save