diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java index af6d28b396a7a7..db0d0941bb0f7e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java @@ -10,8 +10,6 @@ import android.app.Activity; import android.content.Context; import android.content.pm.PackageManager; -import android.os.Build; -import android.os.Process; import android.util.SparseArray; import com.facebook.common.logging.FLog; import com.facebook.fbreact.specs.NativePermissionsAndroidSpec; @@ -49,12 +47,6 @@ public PermissionsModule(ReactApplicationContext reactContext) { @Override public void checkPermission(final String permission, final Promise promise) { Context context = getReactApplicationContext().getBaseContext(); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - promise.resolve( - context.checkPermission(permission, Process.myPid(), Process.myUid()) - == PackageManager.PERMISSION_GRANTED); - return; - } promise.resolve(context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED); } @@ -68,10 +60,6 @@ public void checkPermission(final String permission, final Promise promise) { */ @Override public void shouldShowRequestPermissionRationale(final String permission, final Promise promise) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - promise.resolve(false); - return; - } try { promise.resolve( getPermissionAwareActivity().shouldShowRequestPermissionRationale(permission)); @@ -89,14 +77,6 @@ public void shouldShowRequestPermissionRationale(final String permission, final @Override public void requestPermission(final String permission, final Promise promise) { Context context = getReactApplicationContext().getBaseContext(); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - promise.resolve( - context.checkPermission(permission, Process.myPid(), Process.myUid()) - == PackageManager.PERMISSION_GRANTED - ? GRANTED - : DENIED); - return; - } if (context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) { promise.resolve(GRANTED); return; @@ -142,15 +122,7 @@ public void requestMultiplePermissions(final ReadableArray permissions, final Pr for (int i = 0; i < permissions.size(); i++) { String perm = permissions.getString(i); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - grantedPermissions.putString( - perm, - context.checkPermission(perm, Process.myPid(), Process.myUid()) - == PackageManager.PERMISSION_GRANTED - ? GRANTED - : DENIED); - checkedPermissionsCount++; - } else if (context.checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) { + if (context.checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) { grantedPermissions.putString(perm, GRANTED); checkedPermissionsCount++; } else {