From 225257abec534ac25275c4101ae1633f062b04b5 Mon Sep 17 00:00:00 2001 From: Chien-Yu Chen Date: Fri, 18 Dec 2015 14:20:46 -0800 Subject: [PATCH 1/2] Camera: update connect call Update connect call to include client PID. Bug: 24511454 Change-Id: I20ddd5ea7419b786c70a901029e7677d62f0b708 --- core/jni/android_hardware_Camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp index 414eba79f22d4..806fcc3619a1c 100644 --- a/core/jni/android_hardware_Camera.cpp +++ b/core/jni/android_hardware_Camera.cpp @@ -534,7 +534,7 @@ static jint android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz, if (halVersion == CAMERA_HAL_API_VERSION_NORMAL_CONNECT) { // Default path: hal version is don't care, do normal camera connect. camera = Camera::connect(cameraId, clientName, - Camera::USE_CALLING_UID); + Camera::USE_CALLING_UID, Camera::USE_CALLING_PID); } else { jint status = Camera::connectLegacy(cameraId, halVersion, clientName, Camera::USE_CALLING_UID, camera); From 75cade0a5fd5ec432870de9977f81091ab389423 Mon Sep 17 00:00:00 2001 From: Chien-Yu Chen Date: Mon, 11 Jan 2016 10:56:21 -0800 Subject: [PATCH 2/2] Add cameraserver process Add UID and permissions for cameraserver process. Bug: 24511454 Change-Id: Iccbda4b42e5584a1f56f9afe5e15a16f40dd2922 --- core/java/android/os/Process.java | 6 ++++++ data/etc/platform.xml | 10 ++++++++-- .../core/java/com/android/server/AppOpsService.java | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index eca2c3b0579d3..1552a3c583443 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -149,6 +149,12 @@ public class Process { */ public static final int AUDIOSERVER_UID = 1041; + /** + * Defines the UID/GID for the cameraserver process + * @hide + */ + public static final int CAMERASERVER_UID = 1046; + /** * Defines the start of a range of UIDs (and GIDs), going from this * number to {@link #LAST_APPLICATION_UID} that are reserved for assigning diff --git a/data/etc/platform.xml b/data/etc/platform.xml index 999d47bea6967..d412d7c5aa33b 100644 --- a/data/etc/platform.xml +++ b/data/etc/platform.xml @@ -4,9 +4,9 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -136,6 +136,12 @@ + + + + + +