Loading services/core/java/com/android/server/ambientcontext/AmbientContextManagerPerUserService.java +11 −5 Original line number Diff line number Diff line Loading @@ -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"); } } } Loading Loading @@ -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) { Loading services/core/java/com/android/server/ambientcontext/AmbientContextManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading
services/core/java/com/android/server/ambientcontext/AmbientContextManagerPerUserService.java +11 −5 Original line number Diff line number Diff line Loading @@ -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"); } } } Loading Loading @@ -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) { Loading
services/core/java/com/android/server/ambientcontext/AmbientContextManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading