/packages/inputmethods/LatinIME/native/jni/src/suggest/core/layout/ |
D | proximity_info_state_utils.h | 32 typedef std::unordered_map<int, float> NearKeysDistanceMap; 33 typedef std::bitset<MAX_KEY_COUNT_IN_A_KEYBOARD> NearKeycodesSet; 35 static int trimLastTwoTouchPoints(std::vector<int> *sampledInputXs, 36 std::vector<int> *sampledInputYs, std::vector<int> *sampledInputTimes, 37 std::vector<int> *sampledLengthCache, std::vector<int> *sampledInputIndice); 43 std::vector<int> *sampledInputXs, std::vector<int> *sampledInputYs, 44 std::vector<int> *sampledInputTimes, std::vector<int> *sampledLengthCache, 45 std::vector<int> *sampledInputIndice); 48 static void popInputData(std::vector<int> *sampledInputXs, std::vector<int> *sampledInputYs, 49 std::vector<int> *sampledInputTimes, std::vector<int> *sampledLengthCache, [all …]
|
D | proximity_info_state_utils.cpp | 34 /* static */ int ProximityInfoStateUtils::trimLastTwoTouchPoints(std::vector<int> *sampledInputXs, in trimLastTwoTouchPoints() 35 std::vector<int> *sampledInputYs, std::vector<int> *sampledInputTimes, in trimLastTwoTouchPoints() 36 std::vector<int> *sampledLengthCache, std::vector<int> *sampledInputIndice) { in trimLastTwoTouchPoints() 50 const int pushTouchPointStartIndex, std::vector<int> *sampledInputXs, in updateTouchPoints() 51 std::vector<int> *sampledInputYs, std::vector<int> *sampledInputTimes, in updateTouchPoints() 52 std::vector<int> *sampledLengthCache, std::vector<int> *sampledInputIndice) { in updateTouchPoints() 158 const ProximityInfo *const proximityInfo, const std::vector<int> *const sampledInputXs, in calculateSquaredDistanceFromSweetSpotCenter() 159 const std::vector<int> *const sampledInputYs, const int keyIndex, const int inputIndex) { in calculateSquaredDistanceFromSweetSpotCenter() 169 const ProximityInfo *const proximityInfo, const std::vector<int> *const sampledInputXs, in calculateNormalizedSquaredDistance() 170 const std::vector<int> *const sampledInputYs, const int keyIndex, const int inputIndex) { in calculateNormalizedSquaredDistance() [all …]
|
/packages/modules/DnsResolver/tests/dns_responder/ |
D | dns_responder_client_ndk.h | 31 inline const std::vector<std::string> kDefaultServers = {"127.0.0.3"}; 32 inline const std::vector<std::string> kDefaultSearchDomains = {"example.com"}; 33 inline const std::vector<int> kDefaultParams = { 44 std::cerr << " Skip test. Remote version is too old, required version: " << version \ 45 << std::endl; \ 55 std::string host; 56 std::string entry; 57 std::string ip4; 58 std::string ip6; 63 static void SetupMappings(unsigned num_hosts, const std::vector<std::string>& domains, [all …]
|
D | dns_responder.h | 44 std::string name; 58 std::string toString() const; 66 std::vector<char> rdata; 69 std::string toString() const; 95 std::vector<DNSQuestion> questions; 96 std::vector<DNSRecord> answers; 97 std::vector<DNSRecord> authorities; 98 std::vector<DNSRecord> additionals; 101 bool write(std::vector<uint8_t>* out) const; 102 std::string toString() const; [all …]
|
D | dns_responder_client_ndk.cpp | 40 void DnsResponderClient::SetupMappings(unsigned numHosts, const std::vector<std::string>& domains, in SetupMappings() 41 std::vector<Mapping>* mappings) { in SetupMappings() 58 int netId, const std::vector<int>& params, const std::vector<std::string>& servers, in makeResolverParamsParcel() 59 const std::vector<std::string>& domains, const std::string& tlsHostname, in makeResolverParamsParcel() 60 const std::vector<std::string>& tlsServers, const std::string& caCert) { in makeResolverParamsParcel() 94 unsigned netId, std::vector<std::string>* servers, in GetResolverInfo() 95 std::vector<std::string>* domains, in GetResolverInfo() 96 std::vector<std::string>* tlsServers, res_params* params, in GetResolverInfo() 97 std::vector<ResolverStats>* stats, in GetResolverInfo() 100 std::vector<int32_t> params32; in GetResolverInfo() [all …]
|
D | dns_responder.cpp | 49 std::string errno2str() { in errno2str() 56 std::string str2hex(const char* buffer, size_t len) { in str2hex() 57 std::string str(len * 2, '\0'); in str2hex() 67 std::string addr2str(const sockaddr* sa, socklen_t sa_len) { in addr2str() 70 if (rv == 0) return std::string(host_str); in addr2str() 71 return std::string(); in addr2str() 77 static std::unordered_map<unsigned, const char*> kTypeStrs = { in dnstype2str() 135 static std::unordered_map<unsigned, const char*> kClassStrs = { in dnsclass2str() 173 if (dot_pos == std::string::npos) { in write() 189 buffer_cur = std::copy(std::next(name.begin(), pos), std::next(name.begin(), dot_pos), in write() [all …]
|
/packages/modules/DnsResolver/ |
D | DnsQueryLogTest.cpp | 26 using namespace std::chrono_literals; 33 std::string captureDumpOutput(const DnsQueryLog& queryLog) { in captureDumpOutput() 41 void verifyDumpOutput(const std::string& dumpLog, const std::vector<int>& expectedNetIds) { in verifyDumpOutput() 43 static const std::regex pattern( in verifyDumpOutput() 46 std::string str(dumpLog); in verifyDumpOutput() 47 std::smatch sm; in verifyDumpOutput() 50 EXPECT_TRUE(std::regex_search(str, sm, pattern)); in verifyDumpOutput() 51 EXPECT_EQ(sm[1], std::to_string(netId)); in verifyDumpOutput() 56 EXPECT_FALSE(std::regex_search(str, sm, pattern)); in verifyDumpOutput() 63 const std::vector<std::string> serversV4 = {"127.0.0.1", "1.2.3.4"}; [all …]
|
D | res_cache.cpp | 882 static std::mutex cache_mutex; 883 static std::condition_variable cv; 893 std::unordered_map<int, uint32_t> resolv_get_dns_event_subsampling_map() { in resolv_get_dns_event_subsampling_map() 898 std::unordered_map<int, uint32_t> sampling_rate_map{}; in resolv_get_dns_event_subsampling_map() 899 std::vector<std::string> subsampling_vector = in resolv_get_dns_event_subsampling_map() 904 std::vector<std::string> rate_denom = Split(pair, ":"); in resolv_get_dns_event_subsampling_map() 976 std::vector<Entry> entries; 987 cache = std::make_unique<Cache>(); in NetConfig() 993 std::unique_ptr<Cache> cache; 994 std::vector<std::string> nameservers; [all …]
|
D | resolv_tls_unit_test.cpp | 45 typedef std::vector<uint8_t> bytevec; 65 std::string SERVERNAME1 = "dns.example.com"; 66 std::string SERVERNAME2 = "dns.example.org"; 110 std::unique_ptr<IDnsTlsSocket> createDnsTlsSocket( in createDnsTlsSocket() 115 return std::make_unique<T>(observer); in createDnsTlsSocket() 134 std::thread(&IDnsTlsSocketObserver::onResponse, mObserver, make_echo(id, query)).detach(); in query() 169 std::thread(&IDnsTlsSocketObserver::onResponse, mObserver, response).detach(); in query() 183 std::future<DnsTlsTransport::Result> f = transport.query(makeSlice(QUERY)); in TEST_F() 200 std::vector<std::future<DnsTlsTransport::Result>> results; in TEST_F() 219 ~FakeSocketDelay() { std::lock_guard guard(mLock); } in ~FakeSocketDelay() [all …]
|
D | resolv_cache_unit_test.cpp | 39 using namespace std::chrono_literals; 54 std::vector<char> query; 55 std::vector<char> answer; 59 std::vector<std::string> servers; 60 std::vector<std::string> domains; 63 std::vector<int32_t> transportTypes; 68 std::vector<res_stats> stats; 72 std::vector<char> makeQuery(int op, const char* qname, int qclass, int qtype) { in makeQuery() 77 return std::vector<char>(buf, buf + len); in makeQuery() 80 std::vector<char> makeAnswer(const std::vector<char>& query, const char* rdata_str, in makeAnswer() [all …]
|
/packages/apps/Bluetooth/jni/ |
D | com_android_bluetooth_avrcp_target.cpp | 38 static std::shared_timed_mutex interface_mutex; 39 static std::shared_timed_mutex callbacks_mutex; 43 static std::string getCurrentMediaId(); 46 static std::vector<SongInfo> getNowPlayingList(); 48 static std::vector<MediaPlayerInfo> getMediaPlayerList(); 52 static void getFolderItems(uint16_t player_id, std::string media_id, 55 std::string media_id); 69 using map_entry = std::pair<std::string, GetFolderItemsCb>; 70 std::map<std::string, GetFolderItemsCb> get_folder_items_cb_map; 71 std::map<RawAddress, ::bluetooth::avrcp::VolumeInterface::VolumeChangedCb> [all …]
|
D | com_android_bluetooth_hfp.cpp | 54 static std::shared_timed_mutex interface_mutex; 57 static std::shared_timed_mutex callbacks_mutex; 85 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in ConnectionStateCallback() 100 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in AudioStateCallback() 113 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in VoiceRecognitionCallback() 128 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in AnswerCallCallback() 143 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in HangupCallCallback() 159 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in VolumeControlCallback() 174 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in DialCallCallback() 198 std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex); in DtmfCmdCallback() [all …]
|
/packages/inputmethods/LatinIME/native/dicttoolkit/src/utils/ |
D | arguments_parser.h | 36 static OptionSpec keyValueOption(const std::string &valueName, const std::string &defaultValue, in keyValueOption() 37 const std::string &description) { in keyValueOption() 41 static OptionSpec switchOption(const std::string &description) { in switchOption() 47 const std::string &getValueName() const { return mValueName; } in getValueName() 48 const std::string &getDefaultValue() const { return mDefaultValue; } in getDefaultValue() 49 const std::string &getDescription() const { return mDescription; } in getDescription() 52 OptionSpec(const bool needsValue, const std::string &valueName, const std::string &defaultValue, in OptionSpec() 53 const std::string &description) in OptionSpec() 62 std::string mValueName; 63 std::string mDefaultValue; [all …]
|
D | arguments_and_options.h | 33 ArgumentsAndOptions(std::unordered_map<std::string, std::string> &&options, in ArgumentsAndOptions() 34 std::unordered_map<std::string, std::vector<std::string>> &&arguments) in ArgumentsAndOptions() 35 : mIsValid(true), mOptions(std::move(options)), mArguments(std::move(arguments)) {} in ArgumentsAndOptions() 41 bool hasOption(const std::string &optionName) const { in hasOption() 45 const std::string &getOptionValue(const std::string &optionName) const { in getOptionValue() 51 bool hasArgument(const std::string &name) const { in hasArgument() 56 const std::string &getSingleArgument(const std::string &name) const { in getSingleArgument() 62 const std::vector<std::string> &getVariableLengthArguments(const std::string &name) const { in getVariableLengthArguments() 72 const std::unordered_map<std::string, std::string> mOptions; 73 const std::unordered_map<std::string, std::vector<std::string>> mArguments;
|
/packages/modules/DnsResolver/tests/ |
D | resolv_integration_test.cpp | 84 using namespace std::chrono_literals; 117 std::pair<ScopedAddrinfo, int> safe_getaddrinfo_time_taken(const char* node, const char* service, in safe_getaddrinfo_time_taken() 121 return {std::move(result), s.timeTakenUs() / 1000}; in safe_getaddrinfo_time_taken() 126 NameserverStats(const std::string server) : server(server) {} in NameserverStats() 144 const std::string server; 153 ScopedSystemProperties(const std::string& key, const std::string& value) : mStoredKey(key) { in ScopedSystemProperties() 160 std::string mStoredKey; 161 std::string mStoredValue; 222 void StartDns(test::DNSResponder& dns, const std::vector<DnsRecord>& records) { in StartDns() 236 EXPECT_EQ(mDnsClient.resolvService()->dump(fd, querylogCmd, std::size(querylogCmd)), 0); in DumpResolverService() [all …]
|
D | dnsresolver_binder_test.cpp | 73 std::shared_ptr<aidl::android::net::IDnsResolver> mDnsResolver; 78 explicit TimedOperation(const std::string& name) : mName(name) {} in TimedOperation() 80 std::cerr << " " << mName << ": " << timeTakenUs() << "us" << std::endl; in ~TimedOperation() 84 std::string mName; 104 std::shared_ptr<DummyListener> dummyListener = ndk::SharedRefBase::make<DummyListener>(); in TEST_F() 119 std::string hostname; in TEST_F() 127 static const std::vector<TestOnDnsEvent::TestResult> expectedResults = { in TEST_F() 151 const std::vector<std::string> test_servers = {listen_addr}; in TEST_F() 152 std::vector<std::string> test_domains = {"example.com"}; in TEST_F() 153 std::vector<int> test_params = {300 /*sample_validity*/, 25 /*success_threshold*/, in TEST_F() [all …]
|
D | resolv_test_utils.h | 78 std::string host_name; // host name 80 std::string addr; // ipv4/v6 address 99 static const std::vector<uint8_t> kHelloExampleComQueryV4 = { 114 static const std::vector<uint8_t> kHelloExampleComResponseV4 = { 170 const std::string kCnameA = std::string(kMaxmiumLabelSize, 'a') + kExampleComDomain + "."; 171 const std::string kCnameB = std::string(kMaxmiumLabelSize, 'b') + kExampleComDomain + "."; 172 const std::string kCnameC = std::string(kMaxmiumLabelSize, 'c') + kExampleComDomain + "."; 173 const std::string kCnameD = std::string(kMaxmiumLabelSize, 'd') + kExampleComDomain + "."; 174 const std::vector<DnsRecord> kLargeCnameChainRecords = { 187 std::string ToString(const hostent* he); [all …]
|
D | resolv_stress_test.cpp | 44 std::vector<std::string> domains = {"example.com"}; in RunGetAddrInfoStressTest() 45 std::vector<std::unique_ptr<test::DNSResponder>> dns; in RunGetAddrInfoStressTest() 46 std::vector<std::string> servers; in RunGetAddrInfoStressTest() 47 std::vector<DnsResponderClient::DnsResponderClient::Mapping> mappings; in RunGetAddrInfoStressTest() 53 auto t0 = std::chrono::steady_clock::now(); in RunGetAddrInfoStressTest() 54 std::vector<std::thread> threads(num_threads); in RunGetAddrInfoStressTest() 55 for (std::thread& thread : threads) { in RunGetAddrInfoStressTest() 56 thread = std::thread([&mappings, num_queries]() { in RunGetAddrInfoStressTest() 64 std::string result_str = ToString(result); in RunGetAddrInfoStressTest() 77 for (std::thread& thread : threads) { in RunGetAddrInfoStressTest() [all …]
|
D | resolv_gold_test.cpp | 45 using std::chrono::milliseconds; 54 const std::string kTestDataPath = android::base::GetExecutableDirectory() + "/testdata/"; 55 const std::vector<std::string> kGoldFilesGetAddrInfo = { 61 const std::vector<std::string> kGoldFilesGetAddrInfoTls = {"getaddrinfo.tls.topsite.google.pb"}; 62 const std::vector<std::string> kGoldFilesGetHostByName = {"gethostbyname.topsite.youtube.pb"}; 63 const std::vector<std::string> kGoldFilesGetHostByNameTls = { 72 const std::string unzipCmd = "unzip -o " + kTestDataPath + "pb.zip -d " + kTestDataPath + in SetUpTestSuite() 93 void SetResolverConfiguration(const std::vector<std::string>& servers, in SetResolverConfiguration() 94 const std::vector<std::string>& domains, in SetResolverConfiguration() 95 const std::vector<std::string>& tlsServers = {}, in SetResolverConfiguration() [all …]
|
/packages/modules/DnsResolver/tests/dns_metrics_listener/ |
D | dns_metrics_listener.h | 46 std::string hostname; 47 std::vector<std::string> ipAddresses; 53 friend std::ostream& operator<<(std::ostream& os, const DnsEvent& data); 61 const std::string& prefixString, 64 ::ndk::ScopedAStatus onPrivateDnsValidationEvent(int32_t netId, const std::string& ipAddress, 65 const std::string& /*hostname*/, 69 int32_t /*latencyMs*/, const std::string& hostname, 70 const std::vector<std::string>& ipAddresses, 74 bool waitForNat64Prefix(ExpectNat64PrefixStatus status, std::chrono::milliseconds timeout) 79 std::lock_guard lock(mMutex); in getUnexpectedNat64PrefixUpdates() [all …]
|
D | dns_metrics_listener.cpp | 29 using std::chrono::milliseconds; 35 return std::tie(netId, eventType, returnCode, hostname, ipAddresses, ipAddressesCount) == in operator ==() 36 std::tie(o.netId, o.eventType, o.returnCode, o.hostname, o.ipAddresses, in operator ==() 40 std::ostream& operator<<(std::ostream& os, const DnsMetricsListener::DnsEvent& data) { in operator <<() 47 const std::string& prefixString, in onNat64PrefixEvent() 49 std::lock_guard lock(mMutex); in onNat64PrefixEvent() 56 int32_t netId, const std::string& ipAddress, const std::string& /*hostname*/, in onPrivateDnsValidationEvent() 59 std::lock_guard lock(mMutex); in onPrivateDnsValidationEvent() 69 const std::string& hostname, in onDnsEvent() 70 const std::vector<std::string>& ipAddresses, in onDnsEvent() [all …]
|
/packages/inputmethods/LatinIME/native/dicttoolkit/tests/utils/ |
D | arguments_parser_test.cpp | 27 std::unordered_map<std::string, OptionSpec> optionSpecs; in TEST() 28 std::vector<ArgumentSpec> argumentSpecs; in TEST() 30 ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)).validateSpecs()); in TEST() 33 std::unordered_map<std::string, OptionSpec> optionSpecs; in TEST() 35 const std::vector<ArgumentSpec> argumentSpecs = { in TEST() 41 ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)).validateSpecs()); in TEST() 44 const std::vector<ArgumentSpec> argumentSpecs = { in TEST() 48 EXPECT_FALSE(ArgumentsParser(std::unordered_map<std::string, OptionSpec>(), in TEST() 49 std::move(argumentSpecs)).validateSpecs()); in TEST() 52 const std::vector<ArgumentSpec> argumentSpecs = { in TEST() [all …]
|
/packages/apps/Test/connectivity/sl4n/facades/bluetooth/ |
D | bt_binder_facade.cpp | 48 std::atomic_bool ble_registering(false); 49 std::atomic_int ble_client_id(0); 51 std::string kServiceName = "bluetooth-service"; 67 std::tuple<bool, int> BtBinderFacade::BtBinderEnable() { in BtBinderEnable() 70 return std::make_tuple(false, sl4n_error_codes::kFailInt); in BtBinderEnable() 76 return std::make_tuple(false, sl4n_error_codes::kPassInt); in BtBinderEnable() 78 return std::make_tuple(true, sl4n_error_codes::kPassInt); in BtBinderEnable() 82 std::tuple<std::string, int> BtBinderFacade::BtBinderGetAddress() { in BtBinderGetAddress() 84 return std::make_tuple(sl4n::kFailStr, sl4n_error_codes::kFailInt); in BtBinderGetAddress() 88 return std::make_tuple(std::string(String8(address).string()), sl4n_error_codes::kPassInt); in BtBinderGetAddress() [all …]
|
/packages/inputmethods/LatinIME/native/jni/tests/dictionary/utils/ |
D | trie_map_test.cpp | 93 std::unordered_map<int, uint64_t> testKeyValuePairs; in TEST() 96 std::uniform_int_distribution<int> keyDistribution(S_INT_MIN, S_INT_MAX); in TEST() 97 auto keyRandomNumberGenerator = std::bind(keyDistribution, std::mt19937()); in TEST() 100 std::uniform_int_distribution<uint64_t> valueDistribution(0, TrieMap::MAX_VALUE); in TEST() 101 auto valueRandomNumberGenerator = std::bind(valueDistribution, std::mt19937()); in TEST() 120 std::vector<int> firstLevelKeys; in TEST() 121 std::map<int, uint64_t> firstLevelEntries; in TEST() 122 std::vector<std::pair<int, int>> secondLevelKeys; in TEST() 123 std::map<int, std::map<int, uint64_t>> twoLevelMap; in TEST() 124 std::map<int, std::map<int, std::map<int, uint64_t>>> threeLevelMap; in TEST() [all …]
|
/packages/apps/Test/connectivity/sl4n/facades/test/ |
D | test_facade.cpp | 27 std::tuple<bool, int> TestFacade::TestBoolTrueReturn() { in TestBoolTrueReturn() 28 return std::make_tuple(true, sl4n_error_codes::kPassInt); in TestBoolTrueReturn() 31 std::tuple<bool, int> TestFacade::TestBoolFalseReturn() { in TestBoolFalseReturn() 32 return std::make_tuple(false, sl4n_error_codes::kPassInt); in TestBoolFalseReturn() 35 std::tuple<bool, int> TestFacade::TestErrorCodeFail() { in TestErrorCodeFail() 36 return std::make_tuple(true, sl4n_error_codes::kFailInt); in TestErrorCodeFail() 39 std::tuple<int, int> TestFacade::TestNullReturn() { in TestNullReturn() 40 return std::make_tuple(NULL, sl4n_error_codes::kPassInt); in TestNullReturn() 43 std::tuple<std::string, int> TestFacade::TestStringEmptyReturn() { in TestStringEmptyReturn() 44 return std::make_tuple("", sl4n_error_codes::kPassInt); in TestStringEmptyReturn() [all …]
|