blob: fa7d3fca75b5be854ff229c52b8ed37ea57931a1 [file] [log] [blame]
Felipe Leme749b8892018-12-03 16:30:30 -08001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.server.contentcapture;
17
18import android.annotation.NonNull;
Felipe Leme326f15a2019-02-19 09:42:24 -080019import android.annotation.Nullable;
Felipe Leme749b8892018-12-03 16:30:30 -080020import android.annotation.UserIdInt;
Felipe Leme141864d2019-02-27 17:01:51 -080021import android.content.ComponentName;
Felipe Leme326f15a2019-02-19 09:42:24 -080022import android.content.ContentCaptureOptions;
Felipe Leme749b8892018-12-03 16:30:30 -080023import android.os.Bundle;
24import android.os.IBinder;
Felipe Leme141864d2019-02-27 17:01:51 -080025import android.service.contentcapture.ActivityEvent.ActivityEventType;
Felipe Leme749b8892018-12-03 16:30:30 -080026
27/**
28 * ContentCapture Manager local system service interface.
29 *
30 * @hide Only for use within the system server.
31 */
32public abstract class ContentCaptureManagerInternal {
33
34 /**
35 * Checks whether the given {@code uid} owns the
36 * {@link android.service.contentcapture.ContentCaptureService} implementation associated with
37 * the given {@code userId}.
38 */
39 public abstract boolean isContentCaptureServiceForUser(int uid, @UserIdInt int userId);
40
41 /**
42 * Notifies the intelligence service of new assist data for the given activity.
43 *
44 * @return {@code false} if there was no service set for the given user
45 */
46 public abstract boolean sendActivityAssistData(@UserIdInt int userId,
47 @NonNull IBinder activityToken, @NonNull Bundle data);
Felipe Leme326f15a2019-02-19 09:42:24 -080048
49 /**
50 * Gets the content capture options for the given user and package, or {@code null} if the
51 * package is not whitelisted by the service.
52 */
53 @Nullable
54 public abstract ContentCaptureOptions getOptionsForPackage(@UserIdInt int userId,
55 @NonNull String packageName);
Felipe Leme141864d2019-02-27 17:01:51 -080056
57 /**
58 * Notifies the intelligence service of a high-level activity event for the given user.
59 */
60 public abstract void notifyActivityEvent(@UserIdInt int userId,
61 @NonNull ComponentName activityComponent, @ActivityEventType int eventType);
Felipe Leme749b8892018-12-03 16:30:30 -080062}