gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-android] 01/02: allow starting the app via NFC


From: gnunet
Subject: [taler-wallet-android] 01/02: allow starting the app via NFC
Date: Mon, 09 Dec 2019 19:59:35 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-android.

commit b39914ed445bdde1a0204b2cbf883f23a5132832
Author: Florian Dold <address@hidden>
AuthorDate: Sat Dec 7 22:39:11 2019 +0100

    allow starting the app via NFC
---
 app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt | 11 +++++++----
 app/src/main/res/xml/apduservice.xml                          |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt 
b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
index b099b74..9134df4 100644
--- a/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
+++ b/app/src/main/java/net/taler/wallet/HostCardEmulatorService.kt
@@ -1,11 +1,13 @@
 package net.taler.wallet
 
 import android.content.*
+import android.net.Uri
 import android.nfc.cardemulation.HostApduService
 import android.os.Bundle
 import android.util.Log
 import java.io.ByteArrayInputStream
 import java.io.ByteArrayOutputStream
+import java.net.URI
 import java.util.concurrent.ConcurrentLinkedDeque
 
 fun makeApduSuccessResponse(payload: ByteArray): ByteArray {
@@ -123,10 +125,11 @@ class HostCardEmulatorService: HostApduService() {
                     val url = String(bodyBytes, Charsets.UTF_8)
                     Log.v(TAG, "got URL: '$url'")
 
-                    Intent().also { intent ->
-                        intent.action = TRIGGER_PAYMENT_ACTION
-                        intent.putExtra("contractUrl", url)
-                        sendBroadcast(intent)
+                    Intent(this, MainActivity::class.java).also { intent ->
+                        intent.data = Uri.parse(url)
+                        intent.action = Intent.ACTION_VIEW
+                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                        startActivity(intent)
                     }
                 }
                 2 -> {
diff --git a/app/src/main/res/xml/apduservice.xml 
b/app/src/main/res/xml/apduservice.xml
index ac2aa32..4a48065 100644
--- a/app/src/main/res/xml/apduservice.xml
+++ b/app/src/main/res/xml/apduservice.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android";
         android:description="@string/servicedesc"
-        android:requireDeviceUnlock="false">
+        android:requireDeviceUnlock="true">
     <aid-group android:description="@string/aiddescription"
             android:category="other">
         <aid-filter android:name="F00054414C4552"/>

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]