Skip to content

Commit 7d3b0f2

Browse files
authored
Merge pull request #194 from NativeScript/hristova/update-currentContext-to-context
chore: update deprecated currentContext to context
2 parents b8b74d8 + 6a662f7 commit 7d3b0f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/camera.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export let takePicture = function (options?): Promise<any> {
1212
return new Promise((resolve, reject) => {
1313
try {
1414
if ((<any>android.support.v4.content.ContextCompat).checkSelfPermission(
15-
applicationModule.android.currentContext,
15+
applicationModule.android.context,
1616
(<any>android).Manifest.permission.CAMERA) !== android.content.pm.PackageManager.PERMISSION_GRANTED) {
1717

1818
reject(new Error("Application does not have permissions to use Camera"));
@@ -37,7 +37,7 @@ export let takePicture = function (options?): Promise<any> {
3737
}
3838

3939
if ((<any>android.support.v4.content.ContextCompat).checkSelfPermission(
40-
applicationModule.android.currentContext,
40+
applicationModule.android.context,
4141
(<any>android).Manifest.permission.WRITE_EXTERNAL_STORAGE) !== android.content.pm.PackageManager.PERMISSION_GRANTED) {
4242

4343
saveToGallery = false;
@@ -63,7 +63,7 @@ export let takePicture = function (options?): Promise<any> {
6363
let sdkVersionInt = parseInt(platform.device.sdkVersion);
6464
if (sdkVersionInt >= 21) {
6565
tempPictureUri = (<any>android.support.v4.content).FileProvider.getUriForFile(
66-
applicationModule.android.currentContext,
66+
applicationModule.android.context,
6767
applicationModule.android.nativeApp.getPackageName() + ".provider", nativeFile);
6868
} else {
6969
tempPictureUri = android.net.Uri.fromFile(nativeFile);

0 commit comments

Comments
 (0)