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

Commit 8b381c8e 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:...

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

Change-Id: I8789f54a2fe59ca7f8e09c83316c13ecce8e13f3
parents 5ca0a6d0 43c89fa8
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();