Skip to content

Commit dff9009

Browse files
committed
[Android] Handle isStrongBoxSupported without creating instance of storage
1 parent 1805df7 commit dff9009

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/FlutterSecureStoragePlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public void run() {
128128
Map<String, Object> options = (Map<String, Object>) ((Map<String, Object>) call.arguments).get("options");
129129
FlutterSecureStorageConfig config = new FlutterSecureStorageConfig(options);
130130

131+
if (call.method.equals("isStrongBoxSupported")) {
132+
result.success(isStrongBoxAvailable);
133+
return;
134+
}
135+
131136
FlutterSecureStorage secureStorage = initInstance(binding.getApplicationContext());
132137
if (secureStorage == null) {
133138
result.error("Could not initialize FlutterSecureStorage", null, null);
@@ -190,10 +195,6 @@ public void onSuccess(Void unused) {
190195
result.success(available);
191196
break;
192197
}
193-
case "isStrongBoxSupported": {
194-
result.success(isStrongBoxAvailable);
195-
break;
196-
}
197198
case "isDeviceSecure": {
198199
boolean secure = secureStorage.isDeviceSecure();
199200
result.success(secure);

0 commit comments

Comments
 (0)