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

Commit 31686e95 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Clear calling identity before doing any work"

parents bfa58946 185a29a5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.app.timedetector.ITimeDetectorService;
import android.app.timedetector.TimeSignal;
import android.content.Context;
import android.os.Binder;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DumpUtils;
@@ -69,7 +70,13 @@ public final class TimeDetectorService extends ITimeDetectorService.Stub {
    @Override
    public void suggestTime(@NonNull TimeSignal timeSignal) {
        enforceSetTimePermission();

        long callerIdToken = Binder.clearCallingIdentity();
        try {
            mTimeDetectorStrategy.suggestTime(timeSignal);
        } finally {
            Binder.restoreCallingIdentity(callerIdToken);
        }
    }

    @Override