Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e83086a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add implementation for unregister AB callback" into main

parents 91fcb1d4 5e488afe
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -765,6 +765,26 @@ public class MediaQualityService extends SystemService {
            }
        }

        public void unregisterAmbientBacklightCallback(IAmbientBacklightCallback callback) {
            if (DEBUG) {
                Slogf.d(TAG, "unregisterAmbientBacklightCallback");
            }

            if (!hasReadColorZonesPermission()) {
                //TODO: error handling
            }

            synchronized (mCallbackRecords) {
                for (AmbientBacklightCallbackRecord record : mCallbackRecords.values()) {
                    if (record.mCallback.asBinder().equals(callback.asBinder())) {
                        record.release();
                        mCallbackRecords.remove(record.mPackageName);
                        return;
                    }
                }
            }
        }

        @GuardedBy("mAmbientBacklightLock")
        @Override
        public void setAmbientBacklightSettings(