(Wallet) Connect unlock action from WebUI to native unlock (#24992)
When Wallet is locked, show a new page that will open native unlock screen when double tapped.
This commit is contained in:
+15
-2
@@ -17,6 +17,9 @@ import org.chromium.chrome.browser.app.BraveActivity;
|
||||
import org.chromium.chrome.browser.settings.BraveWalletPreferences;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
@JNINamespace("brave_wallet")
|
||||
public class BraveWalletProviderDelegateImplHelper {
|
||||
private static final String TAG = "BraveWalletProvider";
|
||||
@@ -27,7 +30,17 @@ public class BraveWalletProviderDelegateImplHelper {
|
||||
BraveActivity activity = BraveActivity.getBraveActivity();
|
||||
activity.showWalletPanel(false);
|
||||
} catch (BraveActivity.BraveActivityNotFoundException e) {
|
||||
Log.e(TAG, "showPanel " + e);
|
||||
Log.e(TAG, "showPanel", e);
|
||||
}
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
public static void unlockWallet() {
|
||||
try {
|
||||
BraveActivity activity = BraveActivity.getBraveActivity();
|
||||
activity.openBraveWallet(false, false, false);
|
||||
} catch (BraveActivity.BraveActivityNotFoundException e) {
|
||||
Log.e(TAG, "unlockWallet", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +60,7 @@ public class BraveWalletProviderDelegateImplHelper {
|
||||
BraveActivity activity = BraveActivity.getBraveActivity();
|
||||
activity.showWalletOnboarding();
|
||||
} catch (BraveActivity.BraveActivityNotFoundException e) {
|
||||
Log.e(TAG, "showWalletOnboarding " + e);
|
||||
Log.e(TAG, "showWalletOnboarding", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -222,7 +222,9 @@ public abstract class BaseWalletNextPageFragment extends Fragment {
|
||||
super.onAuthenticationError(errorCode, errString);
|
||||
|
||||
final Context context = getContext();
|
||||
if (!TextUtils.isEmpty(errString) && context != null) {
|
||||
// Error code 10 is when the user taps back to dismiss the dialog,
|
||||
// there's no need to show a toast to log this action.
|
||||
if (!TextUtils.isEmpty(errString) && context != null && errorCode != 10) {
|
||||
Toast.makeText(context, errString, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
showBiometricAuthenticationButton(biometricUnlockButton);
|
||||
|
||||
Reference in New Issue
Block a user