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

Commit 080f9454 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add removeCallback for System change callbacks"

parents 059bd635 e07b3e69
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -212,6 +212,21 @@ public class SystemProperties {
        }
    }

    /**
     * Remove the target callback.
     *
     * @param callback The {@link Runnable} that should be removed.
     * @hide
     */
    @UnsupportedAppUsage
    public static void removeChangeCallback(@NonNull Runnable callback) {
        synchronized (sChangeCallbacks) {
            if (sChangeCallbacks.contains(callback)) {
                sChangeCallbacks.remove(callback);
            }
        }
    }

    @SuppressWarnings("unused")  // Called from native code.
    private static void callChangeCallbacks() {
        synchronized (sChangeCallbacks) {