• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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.service.ondeviceintelligence;
18 
19 import android.app.ondeviceintelligence.IStreamingResponseCallback;
20 import android.app.ondeviceintelligence.IResponseCallback;
21 import android.app.ondeviceintelligence.ITokenInfoCallback;
22 import android.app.ondeviceintelligence.IProcessingSignal;
23 import android.app.ondeviceintelligence.Feature;
24 import android.os.IRemoteCallback;
25 import android.os.ICancellationSignal;
26 import android.os.PersistableBundle;
27 import android.os.Bundle;
28 import com.android.internal.infra.AndroidFuture;
29 import android.service.ondeviceintelligence.IRemoteStorageService;
30 import android.service.ondeviceintelligence.IProcessingUpdateStatusCallback;
31 
32 /**
33  * Interface for a concrete implementation to provide on-device sandboxed inference.
34  *
35  * @hide
36  */
37 oneway interface IOnDeviceSandboxedInferenceService {
registerRemoteStorageService(in IRemoteStorageService storageService, in IRemoteCallback remoteCallback)38     void registerRemoteStorageService(in IRemoteStorageService storageService,
39                                         in IRemoteCallback remoteCallback) = 0;
requestTokenInfo(int callerUid, in Feature feature, in Bundle request, in AndroidFuture cancellationSignal, in ITokenInfoCallback tokenInfoCallback)40     void requestTokenInfo(int callerUid, in Feature feature, in Bundle request,
41                             in AndroidFuture cancellationSignal,
42                             in ITokenInfoCallback tokenInfoCallback) = 1;
processRequest(int callerUid, in Feature feature, in Bundle request, in int requestType, in AndroidFuture cancellationSignal, in AndroidFuture processingSignal, in IResponseCallback callback)43     void processRequest(int callerUid, in Feature feature, in Bundle request, in int requestType,
44                         in AndroidFuture cancellationSignal,
45                         in AndroidFuture processingSignal,
46                         in IResponseCallback callback) = 2;
processRequestStreaming(int callerUid, in Feature feature, in Bundle request, in int requestType, in AndroidFuture cancellationSignal, in AndroidFuture processingSignal, in IStreamingResponseCallback callback)47     void processRequestStreaming(int callerUid, in Feature feature, in Bundle request, in int requestType,
48                                 in AndroidFuture cancellationSignal,
49                                 in AndroidFuture processingSignal,
50                                 in IStreamingResponseCallback callback) = 3;
updateProcessingState(in Bundle processingState, in IProcessingUpdateStatusCallback callback)51     void updateProcessingState(in Bundle processingState,
52                                      in IProcessingUpdateStatusCallback callback) = 4;
53 }