コード例 #1
0
ファイル: engine_null.cpp プロジェクト: sabel83/metashell
 engine_entry get_engine_null_entry()
 {
   return engine_entry(
       [](const data::config& config_, const boost::filesystem::path&,
          const boost::filesystem::path&, const boost::filesystem::path&,
          iface::environment_detector&, iface::displayer&, logger*) {
         return make_engine(config_.active_shell_config().engine,
                            not_supported(), not_supported(), not_supported(),
                            not_supported(), not_supported(), not_supported(),
                            not_supported(), not_supported(),
                            supported_features());
       },
       "", data::markdown_string("An engine which does not support anything. "
                                 "Mainly for testing purposes."),
       supported_features());
 }
コード例 #2
0
std::string get_connection_string() {
    std::vector<std::string> connection_properties;

#if !ADB_HOST
    static const char* cnxn_props[] = {
        "ro.product.name",
        "ro.product.model",
        "ro.product.device",
    };

    for (const auto& prop_name : cnxn_props) {
        char value[PROPERTY_VALUE_MAX];
        property_get(prop_name, value, "");
        connection_properties.push_back(
            android::base::StringPrintf("%s=%s", prop_name, value));
    }
#endif

    connection_properties.push_back(android::base::StringPrintf(
        "features=%s", android::base::Join(supported_features(), ',').c_str()));

    return android::base::StringPrintf(
        "%s::%s", adb_device_banner,
        android::base::Join(connection_properties, ';').c_str());
}
コード例 #3
0
ファイル: adb.cpp プロジェクト: mnemonyc/platform_system_core
std::string get_connection_string() {
    std::vector<std::string> connection_properties;

#if !ADB_HOST
    static const char* cnxn_props[] = {
        "ro.product.name",
        "ro.product.model",
        "ro.product.device",
    };

    for (const auto& prop : cnxn_props) {
        std::string value = std::string(prop) + "=" + android::base::GetProperty(prop, "");
        connection_properties.push_back(value);
    }
#endif

    connection_properties.push_back(android::base::StringPrintf(
        "features=%s", FeatureSetToString(supported_features()).c_str()));

    return android::base::StringPrintf(
        "%s::%s", adb_device_banner,
        android::base::Join(connection_properties, ';').c_str());
}
コード例 #4
0
bool CanUseFeature(const FeatureSet& feature_set, const std::string& feature) {
    return feature_set.count(feature) > 0 &&
            supported_features().count(feature) > 0;
}