From f0fc0efe4a44b41a5d0e6703fea15c54051b0f11 Mon Sep 17 00:00:00 2001 From: prajwal27 Date: Fri, 20 Mar 2020 23:53:43 +0530 Subject: [PATCH] fix: Change permission from CAMERA to WRITE EXTERNAL STORAGE --- .../cn/ui/mifos/customerProfile/CustomerProfileActivity.kt | 6 +++--- .../cn/ui/mifos/customerProfile/CustomerProfileContract.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt index 27cf1165..b9cf039a 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt @@ -43,7 +43,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == R.id.menu_customer_profile_share) { - checkCameraPermission() + checkWriteExternalStoragePermission() return true } else return super.onOptionsItemSelected(item) @@ -79,7 +79,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View return returnedBitmap } - override fun checkCameraPermission() { + override fun checkWriteExternalStoragePermission() { if (CheckSelfPermissionAndRequest.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)){ shareImage() @@ -110,7 +110,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { when (requestCode) { - ConstantKeys.PERMISSIONS_REQUEST_CAMERA -> { + ConstantKeys.PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE -> { if (grantResults.size > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { shareImage() } else { diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt index e316a643..9765ea71 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt @@ -5,7 +5,7 @@ import org.mifos.mobile.cn.ui.base.MvpView interface CustomerProfileContract { interface View: MvpView{ - fun checkCameraPermission(); + fun checkWriteExternalStoragePermission(); fun requestPermission();