Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 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 | package com.android.server.contentcapture; |
| 17 | |
| 18 | import android.annotation.NonNull; |
Felipe Leme | 326f15a | 2019-02-19 09:42:24 -0800 | [diff] [blame] | 19 | import android.annotation.Nullable; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 20 | import android.annotation.UserIdInt; |
Felipe Leme | 326f15a | 2019-02-19 09:42:24 -0800 | [diff] [blame] | 21 | import android.content.ContentCaptureOptions; |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 22 | import android.os.Bundle; |
| 23 | import android.os.IBinder; |
| 24 | |
| 25 | /** |
| 26 | * ContentCapture Manager local system service interface. |
| 27 | * |
| 28 | * @hide Only for use within the system server. |
| 29 | */ |
| 30 | public abstract class ContentCaptureManagerInternal { |
| 31 | |
| 32 | /** |
| 33 | * Checks whether the given {@code uid} owns the |
| 34 | * {@link android.service.contentcapture.ContentCaptureService} implementation associated with |
| 35 | * the given {@code userId}. |
| 36 | */ |
| 37 | public abstract boolean isContentCaptureServiceForUser(int uid, @UserIdInt int userId); |
| 38 | |
| 39 | /** |
| 40 | * Notifies the intelligence service of new assist data for the given activity. |
| 41 | * |
| 42 | * @return {@code false} if there was no service set for the given user |
| 43 | */ |
| 44 | public abstract boolean sendActivityAssistData(@UserIdInt int userId, |
| 45 | @NonNull IBinder activityToken, @NonNull Bundle data); |
Felipe Leme | 326f15a | 2019-02-19 09:42:24 -0800 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * Gets the content capture options for the given user and package, or {@code null} if the |
| 49 | * package is not whitelisted by the service. |
| 50 | */ |
| 51 | @Nullable |
| 52 | public abstract ContentCaptureOptions getOptionsForPackage(@UserIdInt int userId, |
| 53 | @NonNull String packageName); |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 54 | } |