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 com.android.bedstead.nene; 18 19 import com.android.bedstead.nene.activities.Activities; 20 import com.android.bedstead.nene.annotations.Experimental; 21 import com.android.bedstead.nene.context.Context; 22 import com.android.bedstead.nene.devicepolicy.DevicePolicy; 23 import com.android.bedstead.nene.packages.Packages; 24 import com.android.bedstead.nene.permissions.Permissions; 25 import com.android.bedstead.nene.users.Users; 26 27 /** 28 * Entry point to Nene Test APIs. 29 */ 30 public final class TestApis { 31 private final Context mContext = new Context(this); 32 private final Users mUsers = new Users(this); 33 private final Packages mPackages = new Packages(this); 34 private final DevicePolicy mDevicePolicy = new DevicePolicy(this); 35 private final Activities mActivities = new Activities(this); 36 37 /** Access Test APIs related to Users. */ users()38 public Users users() { 39 return mUsers; 40 } 41 42 /** Access Test APIs related to Packages. */ packages()43 public Packages packages() { 44 return mPackages; 45 } 46 47 /** Access Test APIs related to device policy. */ devicePolicy()48 public DevicePolicy devicePolicy() { 49 return mDevicePolicy; 50 } 51 52 /** Access Test APIs related to permissions. */ permissions()53 public Permissions permissions() { 54 return Permissions.sInstance; 55 } 56 57 /** Access Test APIs related to context. */ context()58 public Context context() { 59 return mContext; 60 } 61 62 /** Access Test APIs related to activities. */ 63 // TODO(scottjonathan): Consider if Activities requires a top-level nene API or if it can go 64 // inside packages 65 @Experimental activities()66 public Activities activities() { 67 return mActivities; 68 } 69 } 70