Skip to content

Commit

Permalink
Fixed #4: Added logging when request code can't be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
greysonp committed Dec 1, 2015
1 parent 716a71f commit a8cf886
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -21,6 +22,8 @@
*/
public class Permiso {

private static final String TAG = "Permiso";

/**
* A map to keep track of our outstanding permission requests. The key is the request code sent when we call
* {@link ActivityCompat#requestPermissions(Activity, String[], int)}. The value is the {@link Permiso.RequestData}
Expand Down Expand Up @@ -152,6 +155,8 @@ public void onRequestPermissionResult(int requestCode, String[] permissions, int
requestData.resultSet.parsePermissionResults(permissions, grantResults);
requestData.onResultListener.onPermissionResult(requestData.resultSet);
mCodesToRequests.remove(requestCode);
} else {
Log.w(TAG, "onRequestPermissionResult() was given an unrecognized request code.");
}
}

Expand Down

0 comments on commit a8cf886

Please sign in to comment.