summaryrefslogtreecommitdiff
path: root/services/java/com
diff options
context:
space:
mode:
author Kathy Xiaoming Chen <kxchen@google.com> 2021-11-18 16:46:32 -0800
committer Kathy Chen <kxchen@google.com> 2022-01-22 22:07:22 +0000
commit5d568eda6211220ddecd1e9bbcf476bfad2ec9e9 (patch)
tree5f43fe52509209a8e1523f74512c3250721965c0 /services/java/com
parentb56820d3d33510ae127a9a324154a7c660850131 (diff)
AmbientContext (aka Ambient PCC) Framework API, with a client API for apps to subscribe for AmbientContextEvents, and a provider API for AiAi to implement and provide the detected events.
Client apps need the ACCESS_AMBIENT_CONTEXT_EVENT permission to use the service. The permission protection level is internal|role. API overview: http://go/ambient-framework-api PRD: http://go/ambient-attribution-prd Design doc: http://go/ambient-service-api Test: CTS test Bug: 192476579 Change-Id: I9daede83af34f215c278cb0530238faba1be5c70 Ignore-AOSP-First: to prevent new feature leak.
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/SystemServer.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 233f2ff574df..e750ce00c8b2 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -103,6 +103,7 @@ import com.android.internal.util.EmergencyAffordanceManager;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.widget.ILockSettings;
import com.android.server.am.ActivityManagerService;
+import com.android.server.ambientcontext.AmbientContextManagerService;
import com.android.server.appbinding.AppBindingService;
import com.android.server.art.ArtManagerLocal;
import com.android.server.attention.AttentionManagerService;
@@ -1809,6 +1810,7 @@ public final class SystemServer implements Dumpable {
startRotationResolverService(context, t);
startSystemCaptionsManagerService(context, t);
startTextToSpeechManagerService(context, t);
+ startAmbientContextService(t);
// System Speech Recognition Service
t.traceBegin("StartSpeechRecognitionManagerService");
@@ -3160,6 +3162,17 @@ public final class SystemServer implements Dumpable {
}
+ private void startAmbientContextService(@NonNull TimingsTraceAndSlog t) {
+ if (!AmbientContextManagerService.isDetectionServiceConfigured()) {
+ Slog.d(TAG, "AmbientContextDetectionService is not configured on this device");
+ return;
+ }
+
+ t.traceBegin("StartAmbientContextService");
+ mSystemServiceManager.startService(AmbientContextManagerService.class);
+ t.traceEnd();
+ }
+
private static void startSystemUi(Context context, WindowManagerService windowManager) {
PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class);
Intent intent = new Intent();