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

Commit 90b60565 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 am: 3eb2ad10

am: ed66a8b2

Change-Id: I412d623de4ae2c32e0070bcb105010c234fe56b7
parents 2f2daf57 ed66a8b2
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