summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaichi Hirono <hirono@google.com>2018-06-25 02:16:41 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-15 05:32:59 (GMT)
commite049f13eb4169492e826fd2b99f94d6969021b0f (patch)
treed3ef8e5f2a73a604d278fbc7d053d7339c9f2911
parentb37e7650b0951d1ee5cb97269c079557e2cf4626 (diff)
downloadframeworks_base-e049f13eb4169492e826fd2b99f94d6969021b0f.zip
frameworks_base-e049f13eb4169492e826fd2b99f94d6969021b0f.tar.gz
frameworks_base-e049f13eb4169492e826fd2b99f94d6969021b0f.tar.bz2
Stop invoke initAppOps in Camera default constructor.
Camera default constructor does not create the underlying native camera object. Thus calling _enableShutterSound after the default constuctor causes application crash. Bug: 132362603 Bug: 80498247 Test: ARC++ Eve/Kevin: Manually modify the code to return MODE_IGNORED for AppOpsService#checkAudioOperation() and to return false for CameraManager#supportsCamera2ApiLocked. Then start voice call in Hangouts. cf_x86_phone with camera HALv1 enabled: New CTS test Change-Id: Ia232dd71da15fda31c4dbe5568ba5083cbfaed9b Merged-In: Id738c4d46a8e3625bc3b1142b11acac9cfb0b603 (cherry picked from commit 97999565311a909a75b6214cb5076f2f7a067e16)
-rw-r--r--core/java/android/hardware/Camera.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 2f84636..d172236 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -571,9 +571,7 @@ public class Camera {
/**
* An empty Camera for testing purpose.
*/
- Camera() {
- initAppOps();
- }
+ Camera() {}
private void initAppOps() {
IBinder b = ServiceManager.getService(Context.APP_OPS_SERVICE);