Enforce permission in notifyPictureProfileHandleSelection

The `IMediaQualityManager.notifyPictureProfileHandleSelection` method lacked an authorization check against the global picture quality service permission. This vulnerability allowed any unprivileged app to bypass permission checks, send arbitrary picture profile parameters to the vendor display HAL, and alter the device-global picture pipeline state.

This commit fixes the issue by validating the caller's UID and PID via `hasGlobalPictureQualityServicePermission()`. If validation fails, an error is reported and the method terminates. Additionally, the database query, HAL tracking modification, and IPC notification are now wrapped in a `synchronized (mPictureProfileLock)` block to ensure thread safety and maintain state consistency in `MediaQualityService`.

Bug: 514738229
Flag: EXEMPT BUGFIX
Test: atest

This was autogenerated by MendIt (go/androidmendit)

(cherry picked from commit f4f0ab21d45103fc84af4486238418fb95be0544)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:94775038e3b1d235b65a7c00bb72d94fc20daa64
Merged-In: Idf6389f4725027dfe8583abcca5b5338a92fd77e
Change-Id: Idf6389f4725027dfe8583abcca5b5338a92fd77e
1 file changed