• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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  */
16 
17 package android.view.contentcapture;
18 
19 import android.content.ComponentName;
20 import android.view.contentcapture.ContentCaptureContext;
21 import android.view.contentcapture.ContentCaptureEvent;
22 import android.view.contentcapture.DataRemovalRequest;
23 import android.view.contentcapture.DataShareRequest;
24 import android.view.contentcapture.IDataShareWriteAdapter;
25 import android.view.contentcapture.IContentCaptureOptionsCallback;
26 import android.os.IBinder;
27 import android.os.ICancellationSignal;
28 
29 import com.android.internal.os.IResultReceiver;
30 
31 import java.util.List;
32 
33 /**
34   * Interface between an app (ContentCaptureManager / ContentCaptureSession) and the system-server
35   * implementation service (ContentCaptureManagerService).
36   *
37   * @hide
38   */
39 oneway interface IContentCaptureManager {
40     /**
41      * Starts a new session for the calling user running as part of the
42      * app's activity identified by {@code activityToken}/{@code componentName}.
43      *
44      * @param sessionId Unique session id as provided by the app.
45      * @param flags Meta flags that enable or disable content capture (see
46      *     {@link IContentCaptureContext#flags}).
47      */
startSession(IBinder activityToken, IBinder shareableActivityToken, in ComponentName componentName, int sessionId, int flags, in IResultReceiver result)48     void startSession(IBinder activityToken, IBinder shareableActivityToken,
49                       in ComponentName componentName, int sessionId, int flags,
50                       in IResultReceiver result);
51 
52     /**
53      * Marks the end of a session for the calling user identified by
54      * the corresponding {@code startSession}'s {@code sessionId}.
55      */
finishSession(int sessionId)56     void finishSession(int sessionId);
57 
58     /**
59      * Returns the content capture service's component name (if enabled and
60      * connected).
61      * @param Receiver of the content capture service's @{code ComponentName}
62      *     provided {@code Bundle} with key "{@code EXTRA}".
63      */
getServiceComponentName(in IResultReceiver result)64     void getServiceComponentName(in IResultReceiver result);
65 
66     /**
67      * Requests the removal of content catpure data for the calling user.
68      */
removeData(in DataRemovalRequest request)69     void removeData(in DataRemovalRequest request);
70 
71     /**
72     * Requests sharing of a binary data with the content capture service.
73     */
shareData(in DataShareRequest request, in IDataShareWriteAdapter adapter)74     void shareData(in DataShareRequest request, in IDataShareWriteAdapter adapter);
75 
76     /**
77      * Returns whether the content capture feature is enabled for the calling user.
78      */
isContentCaptureFeatureEnabled(in IResultReceiver result)79     void isContentCaptureFeatureEnabled(in IResultReceiver result);
80 
81     /**
82      * Returns a ComponentName with the name of custom service activity, if defined.
83      */
getServiceSettingsActivity(in IResultReceiver result)84     void getServiceSettingsActivity(in IResultReceiver result);
85 
86     /**
87      * Returns a list with the ContentCaptureConditions for the package (or null if not defined).
88      */
getContentCaptureConditions(String packageName, in IResultReceiver result)89     void getContentCaptureConditions(String packageName, in IResultReceiver result);
90 
91     /**
92      * Resets the temporary service implementation to the default component.
93      */
resetTemporaryService(int userId)94     void resetTemporaryService(int userId);
95 
96     /**
97      * Temporarily sets the service implementation.
98      */
setTemporaryService(int userId, in String serviceName, int duration)99     void setTemporaryService(int userId, in String serviceName, int duration);
100 
101     /**
102      * Sets whether the default service should be used.
103      */
setDefaultServiceEnabled(int userId, boolean enabled)104     void setDefaultServiceEnabled(int userId, boolean enabled);
105 
106     /**
107      * Registers a listener to handle updates ContentCaptureOptions from server.
108      */
registerContentCaptureOptionsCallback(String packageName, in IContentCaptureOptionsCallback callback)109     void registerContentCaptureOptionsCallback(String packageName,
110                                                in IContentCaptureOptionsCallback callback);
111 }
112