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

Commit 6e861740 authored by Songchun Fan's avatar Songchun Fan Committed by Gerrit Code Review
Browse files

Merge "[adb] Cache features set inside the client process"

parents 82834f12 e800af5c
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();