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

Commit 5d41a0aa 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

Change-Id: Iddda000b218e08c2e335a06716c6cf0993e61165
parents 17bf5610 25fc8635
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();