summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-06-24 15:58:31 -0700
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-08-21 23:23:19 +0300
commit92009be8ae40f83d4afde2a2f5cc43169696c531 (patch)
tree8f9824be6e7fdd3a6cb0bbd6b45f536f872db1a8 /src
parent7ed0766cd48447711205713976aad4ddbb443739 (diff)
downloadandroid_packages_apps_Snap-92009be8ae40f83d4afde2a2f5cc43169696c531.zip
android_packages_apps_Snap-92009be8ae40f83d4afde2a2f5cc43169696c531.tar.gz
android_packages_apps_Snap-92009be8ae40f83d4afde2a2f5cc43169696c531.tar.bz2
SnapdragonCamera: Fix first-time crash and cleanup permissions
As onCreate skips the creation of setting manager when the critical permissions are not granted, this causes the onDestroy to call setting manager destroy function with null pointer. Fix the issue with null check. In addition, remove unused permissions from manifest file Change-Id: I99b5f09449aacfb7eb9a5771e446df75956a9827 CRs-Fixed: 1034202
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CameraActivity.java2
-rw-r--r--src/com/android/camera/PermissionsActivity.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 288cdc0..405acfe 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1719,7 +1719,7 @@ public class CameraActivity extends Activity
PackageManager.PERMISSION_GRANTED &&
checkSelfPermission(Manifest.permission.RECORD_AUDIO) ==
PackageManager.PERMISSION_GRANTED &&
- checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) ==
+ checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) ==
PackageManager.PERMISSION_GRANTED) {
mHasCriticalPermissions = true;
} else {
diff --git a/src/com/android/camera/PermissionsActivity.java b/src/com/android/camera/PermissionsActivity.java
index f47d826..c720d21 100644
--- a/src/com/android/camera/PermissionsActivity.java
+++ b/src/com/android/camera/PermissionsActivity.java
@@ -67,7 +67,7 @@ public class PermissionsActivity extends Activity {
mFlagHasMicrophonePermission = true;
}
- if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
+ if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
mNumPermissionsToRequest++;
mShouldRequestStoragePermission = true;
@@ -103,7 +103,7 @@ public class PermissionsActivity extends Activity {
permissionsRequestIndex++;
}
if (mShouldRequestStoragePermission) {
- permissionsToRequest[permissionsRequestIndex] = Manifest.permission.READ_EXTERNAL_STORAGE;
+ permissionsToRequest[permissionsRequestIndex] = Manifest.permission.WRITE_EXTERNAL_STORAGE;
mIndexPermissionRequestStorage = permissionsRequestIndex;
permissionsRequestIndex++;
}