Merge changes from topic 'camera-hardening'
* changes: Add cameraserver process Camera: update connect call
This commit is contained in:
committed by
Android (Google) Code Review
commit
bd098d4ed3
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 @@
|
||||
<assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="audioserver" />
|
||||
<assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="audioserver" />
|
||||
|
||||
<assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="cameraserver" />
|
||||
<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="cameraserver" />
|
||||
<assign-permission name="android.permission.WAKE_LOCK" uid="cameraserver" />
|
||||
<assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="cameraserver" />
|
||||
<assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="cameraserver" />
|
||||
|
||||
<assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" />
|
||||
|
||||
<!-- This is a list of all the libraries available for application
|
||||
|
||||
@@ -1181,6 +1181,9 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
} else if ("audioserver".equals(packageName)) {
|
||||
pkgUid = Process.AUDIOSERVER_UID;
|
||||
isPrivileged = false;
|
||||
} else if ("cameraserver".equals(packageName)) {
|
||||
pkgUid = Process.CAMERASERVER_UID;
|
||||
isPrivileged = false;
|
||||
}
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
|
||||
Reference in New Issue
Block a user