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

Commit f0cc59d6 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Clear calling identity before calling SysProp callbacks

Test: boot, run any "setprop" on adb shell
Change-Id: I4aa16b60bfad9dfe3a64fa5a629caf83dce1c8bd
Fixes: 117105159
parent 23961c8a
Loading
Loading
Loading
Loading
+11 −6
Original line number Original line Diff line number Diff line
@@ -208,6 +208,8 @@ public class SystemProperties {
                return;
                return;
            }
            }
            ArrayList<Runnable> callbacks = new ArrayList<Runnable>(sChangeCallbacks);
            ArrayList<Runnable> callbacks = new ArrayList<Runnable>(sChangeCallbacks);
            final long token = Binder.clearCallingIdentity();
            try {
                for (int i = 0; i < callbacks.size(); i++) {
                for (int i = 0; i < callbacks.size(); i++) {
                    try {
                    try {
                        callbacks.get(i).run();
                        callbacks.get(i).run();
@@ -216,6 +218,9 @@ public class SystemProperties {
                        // Ignore and try to go on.
                        // Ignore and try to go on.
                    }
                    }
                }
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }
        }
    }
    }