diff options
author | Rheygine Medel <quic_rmedel@quicinc.com> | 2022-09-22 10:13:56 -0700 |
---|---|---|
committer | Haamed Gheibi <haamed@google.com> | 2022-10-18 10:37:31 -0700 |
commit | 9e9281efceaf69de40dc44c1aa755c3fbd00f80e (patch) | |
tree | dec59b749b6bc245826694013a4b3e023dd78065 | |
parent | 866e5471742add0442ca03c269b4c269b2c4ab92 (diff) | |
download | native-9e9281efceaf69de40dc44c1aa755c3fbd00f80e.tar.gz |
sf: Allow SystemServer to set the display brightness
As part of the boot up sequence, SystemServer initializes the
DisplayManagerService to manage the global lifecycle of all displays.
Currently, the DisplayManagerService is not permitted to adjust the
display brightness settings and this is causing boot up failures.
This change allows SystemServer or AID to set the display brightness
to avoid such issues.
Bug: 248249039
Change-Id: Ia57c5fc8f3875da4f5ab31ab68d24571a5599fe4
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index e9fbf6ea7b..e234ed0ed4 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -7564,7 +7564,7 @@ status_t SurfaceComposerAIDL::checkControlDisplayBrightnessPermission() { IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); - if ((uid != AID_GRAPHICS) && + if ((uid != AID_GRAPHICS) && (uid != AID_SYSTEM) && !PermissionCache::checkPermission(sControlDisplayBrightness, pid, uid)) { ALOGE("Permission Denial: can't control brightness pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; |