summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-06-24 22:58:31 (GMT)
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-08-21 20:23:19 (GMT)
commit92009be8ae40f83d4afde2a2f5cc43169696c531 (patch)
tree8f9824be6e7fdd3a6cb0bbd6b45f536f872db1a8
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
-rw-r--r--AndroidManifest.xml10
-rw-r--r--src/com/android/camera/CameraActivity.java2
-rw-r--r--src/com/android/camera/PermissionsActivity.java4
3 files changed, 3 insertions, 13 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7952527..57aedb1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -14,20 +14,10 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
- <uses-permission android:name="android.permission.BIND_WALLPAPER" />
<uses-permission android:name="android.permission.CAMERA" />
- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
- <uses-permission android:name="android.permission.GET_ACCOUNTS" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
- <uses-permission android:name="android.permission.SET_WALLPAPER" />
- <uses-permission android:name="android.permission.SUBSCRIBED_FEEDS_READ" />
- <uses-permission android:name="android.permission.SUBSCRIBED_FEEDS_WRITE" />
- <uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
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++;
}