summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-09-03 12:24:24 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-09-03 12:24:24 -0700
commit52aad85627f5216e7a3d9db425d2cc409f998a01 (patch)
tree8733629f149e3bd00e56d99afc55a28bf441f004 /services/camera/libcameraservice/CameraService.cpp
parent3ca51aa9c8eb670b3b93ab37350fa4e0a0397bd6 (diff)
downloadframeworks_av-52aad85627f5216e7a3d9db425d2cc409f998a01.zip
frameworks_av-52aad85627f5216e7a3d9db425d2cc409f998a01.tar.gz
frameworks_av-52aad85627f5216e7a3d9db425d2cc409f998a01.tar.bz2
CameraService: Treat TOP_SLEEPING same as TOP for priority.
When arbitrating between camera clients, treat processes in the TOP_SLEEPING state with the same high priority as processes in the TOP state. This resolves race conditions during lock screen handoffs between clients such as face unlock (a bound foreground process) and a secure camera app (the topmost activity, but transitioning from TOP_SLEEPING to TOP asynchronously from the activity lifecycle callbacks). Bug: 23731720 Change-Id: I92c3f8f561c7725627826c0ba3dc926e99af746c
Diffstat (limited to 'services/camera/libcameraservice/CameraService.cpp')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index d289704..f5a0887 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -602,6 +602,11 @@ int CameraService::getCameraPriorityFromProcState(int procState) {
procState);
return -1;
}
+ // Treat sleeping TOP processes the same as regular TOP processes, for
+ // access priority. This is important for lock-screen camera launch scenarios
+ if (procState == PROCESS_STATE_TOP_SLEEPING) {
+ procState = PROCESS_STATE_TOP;
+ }
return INT_MAX - procState;
}