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

Commit 187a46bc authored by Martin Brabham's avatar Martin Brabham Committed by android-build-merger
Browse files

Confirm the presence of BT key when BT ON

am: 6fb3d95a

Change-Id: If3b988395c9b09d4b8809edb944a5d5830a3821c
parents 3538c86b 6fb3d95a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -59,6 +59,14 @@ class BtifKeystore {
   */
  std::string Decrypt(const std::string& input_filename);

  /**
   * Check for existence of keystore key.
   *
   * This key can be cleared if a user manually wipes bluetooth storage data
   * b/133214365
   */
  bool DoesKeyExist();

 private:
  std::unique_ptr<keystore::KeystoreClient> keystore_client_;
  std::mutex api_mutex_;
+3 −1
Original line number Diff line number Diff line
@@ -183,7 +183,9 @@ static BtifKeystore btif_keystore(new keystore::KeystoreClientImpl);
static future_t* init(void) {
  std::unique_lock<std::recursive_mutex> lock(config_lock);

  if (is_factory_reset()) delete_config_files();
  if (is_factory_reset() ||
      (use_key_attestation() && !btif_keystore.DoesKeyExist()))
    delete_config_files();

  std::string file_source;

+4 −0
Original line number Diff line number Diff line
@@ -98,4 +98,8 @@ KeyStoreNativeReturnCode BtifKeystore::GenerateKey(const std::string& name,
                                       &software_enforced_characteristics);
}

bool BtifKeystore::DoesKeyExist() {
  return keystore_client_->doesKeyExist(kKeyStore);
}

}  // namespace bluetooth