Merge "Fix bugs found during cts test." into tm-dev am: 761bb05aaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17489934 Change-Id: I9174f1c45bd26f576294b4190ef36e3d1f93fb06 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -217,9 +217,13 @@ final class AmbientContextManagerPerUserService extends
|
||||
RemoteCallback detectionResultCallback, RemoteCallback statusCallback) {
|
||||
Slog.d(TAG, "Requested detection of " + request.getEventTypes());
|
||||
synchronized (mLock) {
|
||||
ensureRemoteServiceInitiated();
|
||||
mRemoteService.startDetection(request, callingPackage, detectionResultCallback,
|
||||
statusCallback);
|
||||
if (setUpServiceIfNeeded()) {
|
||||
ensureRemoteServiceInitiated();
|
||||
mRemoteService.startDetection(request, callingPackage, detectionResultCallback,
|
||||
statusCallback);
|
||||
} else {
|
||||
Slog.w(TAG, "No valid component found for AmbientContextDetectionService");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,8 +375,10 @@ final class AmbientContextManagerPerUserService extends
|
||||
void stopDetection(String packageName) {
|
||||
Slog.d(TAG, "Stop detection for " + packageName);
|
||||
synchronized (mLock) {
|
||||
ensureRemoteServiceInitiated();
|
||||
mRemoteService.stopDetection(packageName);
|
||||
if (mComponentName != null) {
|
||||
ensureRemoteServiceInitiated();
|
||||
mRemoteService.stopDetection(packageName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user