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.testapp; 18 19 import android.app.admin.DeviceAdminReceiver; 20 import android.content.Context; 21 import android.content.Intent; 22 import android.net.Uri; 23 import android.os.PersistableBundle; 24 import android.os.UserHandle; 25 26 import com.android.eventlib.premade.EventLibDeviceAdminReceiver; 27 28 /** 29 * Implementation of {@link DeviceAdminReceiver} which logs events in response to callbacks and 30 * supports TestApp Features. 31 */ 32 public class BaseTestAppDeviceAdminReceiver extends EventLibDeviceAdminReceiver { 33 34 @Override onEnabled(Context context, Intent intent)35 public void onEnabled(Context context, Intent intent) { 36 super.onEnabled(context, intent); 37 } 38 39 @Override onDisableRequested(Context context, Intent intent)40 public CharSequence onDisableRequested(Context context, Intent intent) { 41 return super.onDisableRequested(context, intent); 42 } 43 44 @Override onDisabled(Context context, Intent intent)45 public void onDisabled(Context context, Intent intent) { 46 super.onDisabled(context, intent); 47 } 48 49 @Override onPasswordChanged(Context context, Intent intent)50 public void onPasswordChanged(Context context, Intent intent) { 51 super.onPasswordChanged(context, intent); 52 } 53 54 @Override onPasswordChanged(Context context, Intent intent, UserHandle user)55 public void onPasswordChanged(Context context, Intent intent, UserHandle user) { 56 super.onPasswordChanged(context, intent, user); 57 } 58 59 @Override onPasswordFailed(Context context, Intent intent)60 public void onPasswordFailed(Context context, Intent intent) { 61 super.onPasswordFailed(context, intent); 62 } 63 64 @Override onPasswordFailed(Context context, Intent intent, UserHandle user)65 public void onPasswordFailed(Context context, Intent intent, UserHandle user) { 66 super.onPasswordFailed(context, intent, user); 67 } 68 69 @Override onPasswordSucceeded(Context context, Intent intent)70 public void onPasswordSucceeded(Context context, Intent intent) { 71 super.onPasswordSucceeded(context, intent); 72 } 73 74 @Override onPasswordSucceeded(Context context, Intent intent, UserHandle user)75 public void onPasswordSucceeded(Context context, Intent intent, UserHandle user) { 76 super.onPasswordSucceeded(context, intent, user); 77 } 78 79 @Override onPasswordExpiring(Context context, Intent intent)80 public void onPasswordExpiring(Context context, Intent intent) { 81 super.onPasswordExpiring(context, intent); 82 } 83 84 @Override onPasswordExpiring(Context context, Intent intent, UserHandle user)85 public void onPasswordExpiring(Context context, Intent intent, UserHandle user) { 86 super.onPasswordExpiring(context, intent, user); 87 } 88 89 @Override onProfileProvisioningComplete(Context context, Intent intent)90 public void onProfileProvisioningComplete(Context context, Intent intent) { 91 super.onProfileProvisioningComplete(context, intent); 92 } 93 94 @Override onReadyForUserInitialization(Context context, Intent intent)95 public void onReadyForUserInitialization(Context context, Intent intent) { 96 super.onReadyForUserInitialization(context, intent); 97 } 98 99 @Override onLockTaskModeEntering(Context context, Intent intent, String pkg)100 public void onLockTaskModeEntering(Context context, Intent intent, String pkg) { 101 super.onLockTaskModeEntering(context, intent, pkg); 102 } 103 104 @Override onLockTaskModeExiting(Context context, Intent intent)105 public void onLockTaskModeExiting(Context context, Intent intent) { 106 super.onLockTaskModeExiting(context, intent); 107 } 108 109 @Override onChoosePrivateKeyAlias(Context context, Intent intent, int uid, Uri uri, String alias)110 public String onChoosePrivateKeyAlias(Context context, Intent intent, int uid, Uri uri, 111 String alias) { 112 return super.onChoosePrivateKeyAlias(context, intent, uid, uri, alias); 113 } 114 115 @Override onSystemUpdatePending(Context context, Intent intent, long receivedTime)116 public void onSystemUpdatePending(Context context, Intent intent, long receivedTime) { 117 super.onSystemUpdatePending(context, intent, receivedTime); 118 } 119 120 @Override onBugreportSharingDeclined(Context context, Intent intent)121 public void onBugreportSharingDeclined(Context context, Intent intent) { 122 super.onBugreportSharingDeclined(context, intent); 123 } 124 125 @Override onBugreportShared(Context context, Intent intent, String bugreportHash)126 public void onBugreportShared(Context context, Intent intent, String bugreportHash) { 127 super.onBugreportShared(context, intent, bugreportHash); 128 } 129 130 @Override onBugreportFailed(Context context, Intent intent, int failureCode)131 public void onBugreportFailed(Context context, Intent intent, int failureCode) { 132 super.onBugreportFailed(context, intent, failureCode); 133 } 134 135 @Override onSecurityLogsAvailable(Context context, Intent intent)136 public void onSecurityLogsAvailable(Context context, Intent intent) { 137 super.onSecurityLogsAvailable(context, intent); 138 } 139 140 @Override onNetworkLogsAvailable(Context context, Intent intent, long batchToken, int networkLogsCount)141 public void onNetworkLogsAvailable(Context context, Intent intent, long batchToken, 142 int networkLogsCount) { 143 super.onNetworkLogsAvailable(context, intent, batchToken, networkLogsCount); 144 } 145 146 @Override onUserAdded(Context context, Intent intent, UserHandle addedUser)147 public void onUserAdded(Context context, Intent intent, UserHandle addedUser) { 148 super.onUserAdded(context, intent, addedUser); 149 } 150 151 @Override onUserRemoved(Context context, Intent intent, UserHandle removedUser)152 public void onUserRemoved(Context context, Intent intent, UserHandle removedUser) { 153 super.onUserRemoved(context, intent, removedUser); 154 } 155 156 @Override onUserStarted(Context context, Intent intent, UserHandle startedUser)157 public void onUserStarted(Context context, Intent intent, UserHandle startedUser) { 158 super.onUserStarted(context, intent, startedUser); 159 } 160 161 @Override onUserStopped(Context context, Intent intent, UserHandle stoppedUser)162 public void onUserStopped(Context context, Intent intent, UserHandle stoppedUser) { 163 super.onUserStopped(context, intent, stoppedUser); 164 } 165 166 @Override onUserSwitched(Context context, Intent intent, UserHandle switchedUser)167 public void onUserSwitched(Context context, Intent intent, UserHandle switchedUser) { 168 super.onUserSwitched(context, intent, switchedUser); 169 } 170 171 @Override onTransferOwnershipComplete(Context context, PersistableBundle bundle)172 public void onTransferOwnershipComplete(Context context, PersistableBundle bundle) { 173 super.onTransferOwnershipComplete(context, bundle); 174 } 175 176 @Override onTransferAffiliatedProfileOwnershipComplete(Context context, UserHandle user)177 public void onTransferAffiliatedProfileOwnershipComplete(Context context, UserHandle user) { 178 super.onTransferAffiliatedProfileOwnershipComplete(context, user); 179 } 180 181 @Override onOperationSafetyStateChanged(Context context, int reason, boolean isSafe)182 public void onOperationSafetyStateChanged(Context context, int reason, boolean isSafe) { 183 super.onOperationSafetyStateChanged(context, reason, isSafe); 184 } 185 186 @Override onReceive(Context context, Intent intent)187 public void onReceive(Context context, Intent intent) { 188 super.onReceive(context, intent); 189 } 190 } 191