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
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index e9fbf6e..e234ed0 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -7564,7 +7564,7 @@
     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;