X-Git-Url: http://www.average.org/gitweb/?p=YkNeoCR.git;a=blobdiff_plain;f=src%2Forg%2Faverage%2Fnfcauthcr%2FEnroll.java;h=96fa3147b7ac79c8c8e44d0386a2c925959bd3fc;hp=8d90488dbc41e34e665aea4e9c84a76b71b93211;hb=0c96e6ff75abc6adfa713c00963fd14f5de2f34c;hpb=bb4b51c880cf9a1942151bf1dd8977e3a8e0ccf6 diff --git a/src/org/average/nfcauthcr/Enroll.java b/src/org/average/nfcauthcr/Enroll.java index 8d90488..96fa314 100644 --- a/src/org/average/nfcauthcr/Enroll.java +++ b/src/org/average/nfcauthcr/Enroll.java @@ -12,10 +12,9 @@ import android.content.SharedPreferences.Editor; import android.content.DialogInterface; import android.util.Log; import android.view.View; -import android.widget.TextView; import android.widget.RadioButton; -import org.average.nfcauthcr.Check; +import org.average.nfcauthcr.QueryCrToken; public class Enroll extends Activity { @@ -24,7 +23,6 @@ public class Enroll extends Activity { private static boolean waitingForResult = false; private static SharedPreferences prefs; private static int slot; - private AlertDialog swipeDialog; @Override protected void onCreate(Bundle savedInstanceState) @@ -50,19 +48,6 @@ public class Enroll extends Activity { if (btn != null) btn.setChecked(true); } - @Override - protected void onPause() { - super.onPause(); - Log.v(TAG, "Going inactive, try to stop"); - if (!waitingForResult) { finish(); } - } - - @Override - protected void onStop() { - super.onStop(); - Log.v(TAG, "Stop requested"); - } - public void onSlotSelectionClicked(View view) { Log.v(TAG, "Radio Button selected"); if (! ((RadioButton) view).isChecked()) return; @@ -89,10 +74,6 @@ public class Enroll extends Activity { Intent intent) { Log.v(TAG, "Got activity result"); waitingForResult = false; - if(swipeDialog != null) { - swipeDialog.dismiss(); - swipeDialog = null; - } if (resultCode != RESULT_OK) { Log.v(TAG, "Error result code " + resultCode); @@ -130,27 +111,10 @@ public class Enroll extends Activity { byte[] challenge = new byte[63]; rng.nextBytes(challenge); Log.v(TAG, "Random challenge: " + hex(challenge)); - Intent crIntent = new Intent(this, Check.class); - crIntent.putExtra("slot", slot); + Intent crIntent = new Intent(this, QueryCrToken.class); crIntent.putExtra("challenge", challenge); - this.startActivityForResult(crIntent, 0); waitingForResult = true; - if (swipeDialog != null) swipeDialog.dismiss(); - swipeDialog = makeDialog(); - swipeDialog.show(); - } - - private AlertDialog makeDialog() { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.challenging); - builder.setMessage(R.string.swipe); - builder.setOnCancelListener( - new DialogInterface.OnCancelListener() { - public void onCancel(DialogInterface dialog) { - Log.v(TAG, "unbind service FIXME"); - } - }); - return builder.create(); + this.startActivityForResult(crIntent, 0); } private String hex(byte[] a) {