Commit d3a891d55c1bcfc22c8422455da6b4fa382cd713

Authored by cuong
1 parent b2a817727b

change name checkOverlayAndroid -> checkOverlayPermission

Showing 6 changed files with 12 additions and 12 deletions Side-by-side Diff

android/src/main/java/com/reactnativecommunity/rnpermissions/RNPermissionsModule.java
... ... @@ -242,7 +242,7 @@ public class RNPermissionsModule extends ReactContextBaseJavaModule {
242 242 }
243 243  
244 244 @ReactMethod
245   - public void checkOverlayAndroid(final Promise promise) {
  245 + public void checkOverlayPermission(final Promise promise) {
246 246 // Check if Android M or higher
247 247 final ReactApplicationContext reactContext = getReactApplicationContext();
248 248 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M && !Settings.canDrawOverlays(reactContext)) {
... ... @@ -11,7 +11,7 @@ export interface Contract {
11 11  
12 12 check(permission: Permission): Promise<PermissionStatus>;
13 13  
14   - checkOverlayAndroid(): Promise<boolean>;
  14 + checkOverlayPermission(): Promise<boolean>;
15 15  
16 16 request(
17 17 permission: Permission,
... ... @@ -14,7 +14,7 @@ export * from &#39;./types&#39;;
14 14  
15 15 export const openSettings = module.openSettings;
16 16 export const check = module.check;
17   -export const checkOverlayAndroid = module.checkOverlayAndroid;
  17 +export const checkOverlayPermission = module.checkOverlayPermission;
18 18 export const request = module.request;
19 19 export const checkNotifications = module.checkNotifications;
20 20 export const requestNotifications = module.requestNotifications;
... ... @@ -26,7 +26,7 @@ export default {
26 26 RESULTS,
27 27 openSettings,
28 28 check,
29   - checkOverlayAndroid,
  29 + checkOverlayPermission,
30 30 request,
31 31 checkNotifications,
32 32 requestNotifications,
src/module.android.ts
... ... @@ -16,7 +16,7 @@ const RNP: {
16 16 checkNotifications: () => Promise<NotificationsResponse>;
17 17 openSettings: () => Promise<true>;
18 18 checkOrRequestOverlayPermission: () => Promise<true>;
19   - checkOverlayAndroid: () => Promise<boolean>;
  19 + checkOverlayPermission: () => Promise<boolean>;
20 20 getNonRequestables: () => Promise<Permission[]>;
21 21 isNonRequestable: (permission: Permission) => Promise<boolean>;
22 22 setNonRequestable: (permission: Permission) => Promise<true>;
... ... @@ -69,8 +69,8 @@ async function check(permission: Permission): Promise&lt;PermissionStatus&gt; {
69 69 }
70 70 }
71 71  
72   -async function checkOverlayAndroid(): Promise<boolean> {
73   - return await RNP.checkOverlayAndroid();
  72 +async function checkOverlayPermission(): Promise<boolean> {
  73 + return await RNP.checkOverlayPermission();
74 74 }
75 75  
76 76 async function request(
... ... @@ -168,7 +168,7 @@ async function requestMultiple&lt;P extends Permission[]&gt;(
168 168 export const module: Contract = {
169 169 openSettings,
170 170 check,
171   - checkOverlayAndroid,
  171 + checkOverlayPermission,
172 172 request,
173 173 checkNotifications,
174 174 requestNotifications: checkNotifications,
... ... @@ -42,7 +42,7 @@ export function checkNotifications(): Promise&lt;NotificationsResponse&gt; {
42 42 return RNP.checkNotifications();
43 43 }
44 44  
45   -async function checkOverlayAndroid(): Promise<boolean> {
  45 +async function checkOverlayPermission(): Promise<boolean> {
46 46 return true;
47 47 }
48 48  
... ... @@ -88,7 +88,7 @@ async function requestMultiple&lt;P extends Permission[]&gt;(
88 88 export const module: Contract = {
89 89 openSettings,
90 90 check,
91   - checkOverlayAndroid,
  91 + checkOverlayPermission,
92 92 request,
93 93 checkNotifications,
94 94 requestNotifications,
... ... @@ -6,7 +6,7 @@ async function check(): Promise&lt;PermissionStatus&gt; {
6 6 return RESULTS.UNAVAILABLE;
7 7 }
8 8  
9   -async function checkOverlayAndroid(): Promise<boolean> {
  9 +async function checkOverlayPermission(): Promise<boolean> {
10 10 return true;
11 11 }
12 12  
... ... @@ -26,7 +26,7 @@ async function checkMultiple&lt;P extends Permission[]&gt;(
26 26 export const module: Contract = {
27 27 openSettings: Promise.reject,
28 28 check,
29   - checkOverlayAndroid,
  29 + checkOverlayPermission,
30 30 request: check,
31 31 checkNotifications,
32 32 requestNotifications: checkNotifications,