1 // Copyright (C) 2022 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package com.android.ctssdkprovider; 16 17 import android.os.Bundle; 18 19 import com.android.ctssdkprovider.IActivityActionExecutor; 20 import com.android.ctssdkprovider.IActivityStarter; 21 22 interface ICtsSdkProviderApi { checkClassloaders()23 void checkClassloaders(); checkResourcesAndAssets()24 void checkResourcesAndAssets(); isPermissionGranted(String permissionName, boolean useApplicationContext)25 boolean isPermissionGranted (String permissionName, boolean useApplicationContext); getContextHashCode(boolean useApplicationContext)26 int getContextHashCode(boolean useApplicationContext); getContextUserId()27 int getContextUserId(); testStoragePaths()28 void testStoragePaths(); getProcessImportance()29 int getProcessImportance(); startSandboxActivityDirectlyByAction(String sandboxPackageName)30 void startSandboxActivityDirectlyByAction(String sandboxPackageName); startSandboxActivityDirectlyByComponent(String sandboxPackageName)31 void startSandboxActivityDirectlyByComponent(String sandboxPackageName); startActivity(IActivityStarter callback, in Bundle extras)32 IActivityActionExecutor startActivity(IActivityStarter callback, in Bundle extras); getPackageName()33 String getPackageName(); getOpPackageName()34 String getOpPackageName(); getClientPackageName()35 String getClientPackageName(); checkRoomDatabaseAccess()36 void checkRoomDatabaseAccess(); checkCanUseSharedPreferences()37 void checkCanUseSharedPreferences(); checkReadFileDescriptor(in ParcelFileDescriptor fd, String expectedValue)38 void checkReadFileDescriptor(in ParcelFileDescriptor fd, String expectedValue); createFileDescriptor(String valueToWrite)39 ParcelFileDescriptor createFileDescriptor(String valueToWrite); createAndRegisterSdkSandboxClientImportanceListener()40 void createAndRegisterSdkSandboxClientImportanceListener(); waitForStateChangeDetection(int expectedForegroundValue, int expectedBackgroundValue)41 void waitForStateChangeDetection(int expectedForegroundValue, int expectedBackgroundValue); unregisterSdkSandboxClientImportanceListener()42 void unregisterSdkSandboxClientImportanceListener(); getLauncherActivityCount()43 int getLauncherActivityCount(); requestAudioFocus()44 int requestAudioFocus(); 45 } 46