summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormingwax <mingwax@codeaurora.org>2016-09-22 09:45:35 +0800
committerArne Coucheron <arco68@gmail.com>2017-06-13 07:16:33 +0200
commit367758c24f18ea83a17a5ce600a043876b7af11d (patch)
tree4b93c04e1e92cf4a1963381958050000e19ea4da
parentc8a45a3d56310342356e5fe02f2d3ba8978e5dfa (diff)
downloadandroid_packages_apps_Snap-367758c24f18ea83a17a5ce600a043876b7af11d.zip
android_packages_apps_Snap-367758c24f18ea83a17a5ce600a043876b7af11d.tar.gz
android_packages_apps_Snap-367758c24f18ea83a17a5ce600a043876b7af11d.tar.bz2
SnapdragonCamera: Fix FC for NullPointerException
Permission without the case of granted, through the mms to add attachments to enter the Camera, it will lead to call two times PermissionActivity, which led to FC and the wrong interface. Add a logical judgment to call one time PermissionActivity Change-Id: I8b3f287eecb1dfc8f8c5a26a9f0b9dbe187d8ce6 CRs-Fixed: 1069373
-rw-r--r--src/com/android/camera/PermissionsActivity.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/camera/PermissionsActivity.java b/src/com/android/camera/PermissionsActivity.java
index 2bb5f0f..e8df5c5 100644
--- a/src/com/android/camera/PermissionsActivity.java
+++ b/src/com/android/camera/PermissionsActivity.java
@@ -11,6 +11,8 @@ import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import org.codeaurora.snapcam.R;
+import android.preference.PreferenceManager;
+import android.content.SharedPreferences;
/**
* Activity that shows permissions request dialogs and handles lack of critical permissions.
@@ -182,6 +184,7 @@ public class PermissionsActivity extends Activity {
private void handlePermissionsSuccess() {
if (mIntent != null) {
+ setRequestPermissionShow();
mIsReturnResult = true;
mIntent.setClass(this, CameraActivity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
@@ -216,4 +219,14 @@ public class PermissionsActivity extends Activity {
})
.show();
}
+
+ private void setRequestPermissionShow() {
+ final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean isRequestShown = prefs.getBoolean(CameraSettings.KEY_REQUEST_PERMISSION, false);
+ if (!isRequestShown) {
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putBoolean(CameraSettings.KEY_REQUEST_PERMISSION, true);
+ editor.apply();
+ }
+ }
}