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

Commit 3eb2ad10 authored by Neil Fuller's avatar Neil Fuller Committed by android-build-merger
Browse files

Merge "Clear calling identity before doing any work"

am: 31686e95

Change-Id: I144fd2b5f46ce7d7a06195a2dd5207d44cd951f0
parents 49466587 31686e95
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