Skip to content

Commit

Permalink
Remove SDK version check since we are on minimum 24 already
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Ippisch committed Oct 18, 2019
1 parent ad99afa commit 8f79f56
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,12 @@ public void decode() {
* Call from Activity#onResume().
*/
public void onResume() {
if(Build.VERSION.SDK_INT >= 23) {
openCameraWithPermission();
} else {
barcodeView.resume();
}
openCameraWithPermission();
inactivityTimer.start();
}

private boolean askedPermission = false;

@TargetApi(23)
private void openCameraWithPermission() {
if (ContextCompat.checkSelfPermission(this.activity, Manifest.permission.CAMERA)
== PackageManager.PERMISSION_GRANTED) {
Expand All @@ -260,7 +255,7 @@ private void openCameraWithPermission() {
* which is either {@link android.content.pm.PackageManager#PERMISSION_GRANTED}
* or {@link android.content.pm.PackageManager#PERMISSION_DENIED}. Never null.
*/
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if(requestCode == cameraPermissionReqCode) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission was granted
Expand Down

0 comments on commit 8f79f56

Please sign in to comment.