1 /* 2 * Copyright (C) 2021 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.app.sdksandbox; 18 19 import android.os.Bundle; 20 import android.os.IBinder; 21 22 import android.app.sdksandbox.ILoadSdkCallback; 23 import android.app.sdksandbox.IRequestSurfacePackageCallback; 24 import android.app.sdksandbox.ISdkSandboxProcessDeathCallback; 25 import android.app.sdksandbox.ISharedPreferencesSyncCallback; 26 import android.app.sdksandbox.SandboxedSdk; 27 import android.app.sdksandbox.SharedPreferencesUpdate; 28 29 /** @hide */ 30 interface ISdkSandboxManager { 31 /** 32 * TODO(b/267994332): Add enum for method calls from SDK for latency metrics 33 * List of methods for which latencies are logged with logLatencyFromSystemServerToApp 34 */ 35 const String LOAD_SDK = "LOAD_SDK"; 36 const String REQUEST_SURFACE_PACKAGE = "REQUEST_SURFACE_PACKAGE"; 37 addSdkSandboxProcessDeathCallback(in String callingPackageName, long timeAppCalledSystemServer, in ISdkSandboxProcessDeathCallback callback)38 void addSdkSandboxProcessDeathCallback(in String callingPackageName, long timeAppCalledSystemServer, in ISdkSandboxProcessDeathCallback callback); removeSdkSandboxProcessDeathCallback(in String callingPackageName, long timeAppCalledSystemServer, in ISdkSandboxProcessDeathCallback callback)39 void removeSdkSandboxProcessDeathCallback(in String callingPackageName, long timeAppCalledSystemServer, in ISdkSandboxProcessDeathCallback callback); loadSdk(in String callingPackageName, in IBinder appProcessToken, in String sdkName, long timeAppCalledSystemServer, in Bundle params, in ILoadSdkCallback callback)40 oneway void loadSdk(in String callingPackageName, in IBinder appProcessToken, in String sdkName, long timeAppCalledSystemServer, in Bundle params, in ILoadSdkCallback callback); unloadSdk(in String callingPackageName, in String sdkName, long timeAppCalledSystemServer)41 void unloadSdk(in String callingPackageName, in String sdkName, long timeAppCalledSystemServer); 42 // TODO(b/242031240): wrap the many input params in one parcelable object requestSurfacePackage(in String callingPackageName, in String sdkName, in IBinder hostToken, int displayId, int width, int height, long timeAppCalledSystemServer, in Bundle params, IRequestSurfacePackageCallback callback)43 oneway void requestSurfacePackage(in String callingPackageName, in String sdkName, in IBinder hostToken, int displayId, int width, int height, long timeAppCalledSystemServer, in Bundle params, IRequestSurfacePackageCallback callback); getSandboxedSdks(in String callingPackageName, long timeAppCalledSystemServer)44 List<SandboxedSdk> getSandboxedSdks(in String callingPackageName, long timeAppCalledSystemServer); syncDataFromClient(in String callingPackageName, long timeAppCalledSystemServer, in SharedPreferencesUpdate update, in ISharedPreferencesSyncCallback callback)45 oneway void syncDataFromClient(in String callingPackageName, long timeAppCalledSystemServer, in SharedPreferencesUpdate update, in ISharedPreferencesSyncCallback callback); stopSdkSandbox(in String callingPackageName)46 void stopSdkSandbox(in String callingPackageName); logLatencyFromSystemServerToApp(in String method, int latency)47 void logLatencyFromSystemServerToApp(in String method, int latency); 48 49 // TODO(b/282239822): Remove this workaround on Android VIC getAdServicesManager()50 IBinder getAdServicesManager(); 51 } 52