Add isConfirmationPromptSupported() method.
This will be used by the android.security.ConfirmationDialog.isSupported() and
is intended so that apps can know ahead of time whether the device implements
the ConfirmationUI HAL.
Bug: 63928580
Test: Manually tested.
Change-Id: I6347824b4e2330a93b7a7ffd7cf5b206009a564e
diff --git a/keystore/confirmation_manager.cpp b/keystore/confirmation_manager.cpp
index d8c5378..acca304 100644
--- a/keystore/confirmation_manager.cpp
+++ b/keystore/confirmation_manager.cpp
@@ -115,6 +115,19 @@
return Status::ok();
}
+// Called by keystore main thread.
+Status ConfirmationManager::isConfirmationPromptSupported(bool* aidl_return) {
+ sp<IConfirmationUI> confirmationUI = IConfirmationUI::tryGetService();
+ if (confirmationUI == nullptr) {
+ ALOGW("Error getting confirmationUI service\n");
+ *aidl_return = false;
+ return Status::ok();
+ }
+
+ *aidl_return = true;
+ return Status::ok();
+}
+
void ConfirmationManager::finalizeTransaction(ConfirmationResponseCode responseCode,
hidl_vec<uint8_t> dataThatWasConfirmed,
bool callAbortOnHal) {