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

Commit 761bb05a authored by Kathy Chen's avatar Kathy Chen Committed by Android (Google) Code Review
Browse files

Merge "Fix bugs found during cts test." into tm-dev

parents b2d49662 616d6100
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -217,9 +217,13 @@ final class AmbientContextManagerPerUserService extends
            RemoteCallback detectionResultCallback, RemoteCallback statusCallback) {
        Slog.d(TAG, "Requested detection of " + request.getEventTypes());
        synchronized (mLock) {
            if (setUpServiceIfNeeded()) {
                ensureRemoteServiceInitiated();
                mRemoteService.startDetection(request, callingPackage, detectionResultCallback,
                        statusCallback);
            } else {
                Slog.w(TAG, "No valid component found for AmbientContextDetectionService");
            }
        }
    }

@@ -371,10 +375,12 @@ final class AmbientContextManagerPerUserService extends
    void stopDetection(String packageName) {
        Slog.d(TAG, "Stop detection for " + packageName);
        synchronized (mLock) {
            if (mComponentName != null) {
                ensureRemoteServiceInitiated();
                mRemoteService.stopDetection(packageName);
            }
        }
    }

    @Nullable
    private PendingIntent findExistingRequestByPackage(String callingPackage) {
+2 −0
Original line number Diff line number Diff line
@@ -249,6 +249,8 @@ public class AmbientContextManagerService extends
            Objects.requireNonNull(eventTypes);
            Objects.requireNonNull(callingPackage);
            assertCalledByPackageOwner(callingPackage);
            mContext.enforceCallingOrSelfPermission(
                    Manifest.permission.ACCESS_AMBIENT_CONTEXT_EVENT, TAG);
            mService.onStartConsentActivity(eventTypes, callingPackage);
        }