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

Commit 43c89fa8 authored by Songchun Fan's avatar Songchun Fan Committed by android-build-merger
Browse files

Merge "[adb] Cache features set inside the client process" am: 6e861740 am: 25fc8635

am: 5d41a0aa

Change-Id: Ia54ea464c0aaf9f2e38b9f72b7d256d68ca60a81
parents 6bcb866f 5d41a0aa
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -400,9 +400,15 @@ std::string format_host_command(const char* command) {
}

bool adb_get_feature_set(FeatureSet* feature_set, std::string* error) {
    static FeatureSet* features = nullptr;
    if (!features) {
        std::string result;
        if (adb_query(format_host_command("features"), &result, error)) {
        *feature_set = StringToFeatureSet(result);
            features = new FeatureSet(StringToFeatureSet(result));
        }
    }
    if (features) {
        *feature_set = *features;
        return true;
    }
    feature_set->clear();