• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Révisionbd8c5865c9991dd318c7ac47263b527ad7a4cd9b (tree)
l'heure2019-06-08 05:27:44
AuteurMartin Brabham <optedoblivion@goog...>
CommiterMartin Brabham

Message de Log

Confirm the presence of BT key when BT ON

After clearing Bluetooth data, the Bluetooth key will be cleared in the
same time. When turn on Bluetooth, NE happened at the step of checking
Bluetooth key.

Bug: 133214365
Test: ahost --host test net_test_bluetooth
Change-Id: I88f5dfae07352a794b304da60e09253c004fb3d4

Change Summary

Modification

--- a/btif/include/btif_keystore.h
+++ b/btif/include/btif_keystore.h
@@ -59,6 +59,14 @@ class BtifKeystore {
5959 */
6060 std::string Decrypt(const std::string& input_filename);
6161
62+ /**
63+ * Check for existence of keystore key.
64+ *
65+ * This key can be cleared if a user manually wipes bluetooth storage data
66+ * b/133214365
67+ */
68+ bool DoesKeyExist();
69+
6270 private:
6371 std::unique_ptr<keystore::KeystoreClient> keystore_client_;
6472 std::mutex api_mutex_;
--- a/btif/src/btif_config.cc
+++ b/btif/src/btif_config.cc
@@ -183,7 +183,9 @@ static BtifKeystore btif_keystore(new keystore::KeystoreClientImpl);
183183 static future_t* init(void) {
184184 std::unique_lock<std::recursive_mutex> lock(config_lock);
185185
186- if (is_factory_reset()) delete_config_files();
186+ if (is_factory_reset() ||
187+ (use_key_attestation() && !btif_keystore.DoesKeyExist()))
188+ delete_config_files();
187189
188190 std::string file_source;
189191
--- a/btif/src/btif_keystore.cc
+++ b/btif/src/btif_keystore.cc
@@ -98,4 +98,8 @@ KeyStoreNativeReturnCode BtifKeystore::GenerateKey(const std::string& name,
9898 &software_enforced_characteristics);
9999 }
100100
101+bool BtifKeystore::DoesKeyExist() {
102+ return keystore_client_->doesKeyExist(kKeyStore);
103+}
104+
101105 } // namespace bluetooth