Merge "DO NOT MERGE - Merge Android 13"
This commit is contained in:
commit
3f658163ee
4 changed files with 14 additions and 25 deletions
|
@ -390,28 +390,6 @@ static void runDevGcOnHal(Service service, GcCallbackImpl cb, GetDescription get
|
|||
}
|
||||
|
||||
static void runDevGc(void) {
|
||||
auto aidl_service_name = AStorage::descriptor + "/default"s;
|
||||
if (AServiceManager_isDeclared(aidl_service_name.c_str())) {
|
||||
ndk::SpAIBinder binder(AServiceManager_waitForService(aidl_service_name.c_str()));
|
||||
if (binder.get() != nullptr) {
|
||||
std::shared_ptr<AStorage> aidl_service = AStorage::fromBinder(binder);
|
||||
if (aidl_service != nullptr) {
|
||||
runDevGcOnHal<IDL::AIDL>(aidl_service, ndk::SharedRefBase::make<AGcCallbackImpl>(),
|
||||
&ndk::ScopedAStatus::getDescription);
|
||||
return;
|
||||
}
|
||||
}
|
||||
LOG(WARNING) << "Device declares " << aidl_service_name
|
||||
<< " but it is not running, skip dev GC on AIDL HAL";
|
||||
return;
|
||||
}
|
||||
auto hidl_service = HStorage::getService();
|
||||
if (hidl_service != nullptr) {
|
||||
runDevGcOnHal<IDL::HIDL>(hidl_service, sp<HGcCallbackImpl>(new HGcCallbackImpl()),
|
||||
&Return<void>::description);
|
||||
return;
|
||||
}
|
||||
// fallback to legacy code path
|
||||
runDevGcFstab();
|
||||
}
|
||||
|
||||
|
|
10
Utils.cpp
10
Utils.cpp
|
@ -1763,5 +1763,15 @@ std::pair<android::base::unique_fd, std::string> OpenDirInProcfs(std::string_vie
|
|||
return {std::move(fd), std::move(linkPath)};
|
||||
}
|
||||
|
||||
bool IsFuseBpfEnabled() {
|
||||
std::string bpf_override = android::base::GetProperty("persist.sys.fuse.bpf.override", "");
|
||||
if (bpf_override == "true") {
|
||||
return true;
|
||||
} else if (bpf_override == "false") {
|
||||
return false;
|
||||
}
|
||||
return base::GetBoolProperty("ro.fuse.bpf.enabled", false);
|
||||
}
|
||||
|
||||
} // namespace vold
|
||||
} // namespace android
|
||||
|
|
3
Utils.h
3
Utils.h
|
@ -37,7 +37,6 @@ namespace vold {
|
|||
|
||||
static const char* kVoldAppDataIsolationEnabled = "persist.sys.vold_app_data_isolation_enabled";
|
||||
static const char* kExternalStorageSdcardfs = "external_storage.sdcardfs.enabled";
|
||||
static const char* kFuseBpfEnabled = "persist.sys.fuse.bpf.override";
|
||||
|
||||
static constexpr std::chrono::seconds kUntrustedFsckSleepTime(45);
|
||||
|
||||
|
@ -208,6 +207,8 @@ status_t UnmountUserFuse(userid_t userId, const std::string& absolute_lower_path
|
|||
|
||||
status_t PrepareAndroidDirs(const std::string& volumeRoot);
|
||||
|
||||
bool IsFuseBpfEnabled();
|
||||
|
||||
// Open a given directory as an FD, and return that and the corresponding procfs virtual
|
||||
// symlink path that can be used in any API that accepts a path string. Path stays valid until
|
||||
// the directory FD is closed.
|
||||
|
|
|
@ -49,7 +49,7 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, int userId)
|
|||
mRawPath = rawPath;
|
||||
mLabel = "emulated";
|
||||
mFuseMounted = false;
|
||||
mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
|
||||
mFuseBpfEnabled = IsFuseBpfEnabled();
|
||||
mUseSdcardFs = IsSdcardfsUsed();
|
||||
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, dev_t device, const s
|
|||
mRawPath = rawPath;
|
||||
mLabel = fsUuid;
|
||||
mFuseMounted = false;
|
||||
mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
|
||||
mFuseBpfEnabled = IsFuseBpfEnabled();
|
||||
mUseSdcardFs = IsSdcardfsUsed();
|
||||
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue