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

Commit 25fc8635 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

Change-Id: I150ca16badd7eb07e2706d3832504adebad68005
parents 3487d983 6e861740
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line 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) {
bool adb_get_feature_set(FeatureSet* feature_set, std::string* error) {
    static FeatureSet* features = nullptr;
    if (!features) {
        std::string result;
        std::string result;
        if (adb_query(format_host_command("features"), &result, error)) {
        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;
        return true;
    }
    }
    feature_set->clear();
    feature_set->clear();