Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Fixing typos (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ken5scal authored and samtstern committed Jul 14, 2017
1 parent c74ff0d commit 5d81840
Showing 1 changed file with 10 additions and 11 deletions.
Expand Up @@ -59,7 +59,7 @@ public class PhoneNumberVerifier extends Service {
private NotificationCompat.Builder notification;
private PrefsHelper prefs;
private ApiHelper api;
private SmsBrReceiver smsReciever;
private SmsBrReceiver smsReceiver;

private static boolean isRunning;

Expand Down Expand Up @@ -88,17 +88,16 @@ public static void stopActionVerify(Context context) {
@Override
public void onCreate() {
super.onCreate();
if (smsReciever == null) {
smsReciever = new SmsBrReceiver();
if (smsReceiver == null) {
smsReceiver = new SmsBrReceiver();
}

prefs = new PrefsHelper(this);
smsRetrieverClient = SmsRetriever.getClient(this);
Task<Void> task = smsRetrieverClient.startSmsRetriever();

IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
getApplicationContext().registerReceiver(smsReciever, intentFilter);
getApplicationContext().registerReceiver(smsReceiver, intentFilter);
api = new ApiHelper(this);
}

Expand All @@ -107,10 +106,10 @@ public void onDestroy() {
super.onDestroy();
isRunning = false;
isVerifying = false;
if (smsReciever != null) {
getApplicationContext().unregisterReceiver(smsReciever);
smsReciever.cancelTimeout();
smsReciever = null;
if (smsReceiver != null) {
getApplicationContext().unregisterReceiver(smsReceiver);
smsReceiver.cancelTimeout();
smsReceiver = null;
}
if (!prefs.getVerified(false)) {
// We're not verifying anything if this is stopped
Expand Down Expand Up @@ -181,7 +180,7 @@ private void startVerify(String phoneNo) {
task.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
smsReciever.setTimeout();
smsReceiver.setTimeout();
notifyStatus(STATUS_REQUEST_SENT, null);
Log.d(TAG, "SmsRetrievalResult status: Success");
Toast.makeText(PhoneNumberVerifier.this, getString(R.string.verifier_registered),
Expand Down Expand Up @@ -315,7 +314,7 @@ public void onReceive(Context context, Intent intent) {

String action = intent.getAction();
if (SmsRetriever.SMS_RETRIEVED_ACTION.equals(action)) {
smsReciever.cancelTimeout();
cancelTimeout();
notifyStatus(STATUS_RESPONSE_RECEIVED, null);
Bundle extras = intent.getExtras();
Status status = (Status) extras.get(SmsRetriever.EXTRA_STATUS);
Expand Down

0 comments on commit 5d81840

Please sign in to comment.