aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java
diff options
context:
space:
mode:
authorwongma7 <wongma7@users.noreply.github.com>2015-08-25 13:31:07 -0400
committerwongma7 <wongma7@users.noreply.github.com>2015-08-25 13:31:07 -0400
commit327945f3b8aa56f77559a25bc9160dae0a0cc6d2 (patch)
treec92d1450ee4930cf2b91a7b34efa5c97cee826b7 /app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java
parenteced1dd314ba651f862396c340492c6f2d9da926 (diff)
parenta73e8625f55e869ba0d74bfa370178c54be3662d (diff)
downloadHardenedPass-327945f3b8aa56f77559a25bc9160dae0a0cc6d2.tar.gz
HardenedPass-327945f3b8aa56f77559a25bc9160dae0a0cc6d2.zip
Merge pull request #117 from zeapo/autofill
Autofill
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java
new file mode 100644
index 00000000..d8e50ebd
--- /dev/null
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.java
@@ -0,0 +1,40 @@
+package com.zeapo.pwdstore.autofill;
+
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.content.IntentSender;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+
+// blank activity started by service for calling startIntentSenderForResult
+public class AutofillActivity extends AppCompatActivity {
+ public static final int REQUEST_CODE_DECRYPT_AND_VERIFY = 9913;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ Bundle extras = getIntent().getExtras();
+
+ if (extras != null) {
+ try {
+ PendingIntent pi = extras.getParcelable("pending_intent");
+ if (pi == null) {
+ return;
+ }
+ startIntentSenderForResult(pi.getIntentSender()
+ , REQUEST_CODE_DECRYPT_AND_VERIFY, null, 0, 0, 0);
+ } catch (IntentSender.SendIntentException e) {
+ Log.e(AutofillService.Constants.TAG, "SendIntentException", e);
+ }
+ }
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ finish(); // go back to the password field app
+ if (resultCode == RESULT_OK) {
+ AutofillService.setUnlockOK(); // report the result to service
+ }
+ }
+}