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 package com.android.eventlib.events.deviceadminreceivers 17 18 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminBugreportFailedEvent.DeviceAdminBugreportFailedEventQuery 19 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminBugreportSharedEvent.DeviceAdminBugreportSharedEventQuery 20 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminBugreportSharingDeclinedEvent.DeviceAdminBugreportSharingDeclinedEventQuery 21 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminChoosePrivateKeyAliasEvent.DeviceAdminChoosePrivateKeyAliasEventQuery 22 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminDisableRequestedEvent.DeviceAdminDisableRequestedEventQuery 23 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminDisabledEvent.DeviceAdminDisabledEventQuery 24 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminEnabledEvent.DeviceAdminEnabledEventQuery 25 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminLockTaskModeEnteringEvent.DeviceAdminLockTaskModeEnteringEventQuery 26 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminLockTaskModeExitingEvent.DeviceAdminLockTaskModeExitingEventQuery 27 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminNetworkLogsAvailableEvent.DeviceAdminNetworkLogsAvailableEventQuery 28 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminOperationSafetyStateChangedEvent.DeviceAdminOperationSafetyStateChangedEventQuery 29 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminPasswordChangedEvent.DeviceAdminPasswordChangedEventQuery 30 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminPasswordExpiringEvent.DeviceAdminPasswordExpiringEventQuery 31 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminPasswordFailedEvent.DeviceAdminPasswordFailedEventQuery 32 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminPasswordSucceededEvent.DeviceAdminPasswordSucceededEventQuery 33 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminProfileProvisioningCompleteEvent.DeviceAdminProfileProvisioningCompleteEventQuery 34 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminReadyForUserInitializationEvent.DeviceAdminReadyForUserInitializationEventQuery 35 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminSecurityLogsAvailableEvent.DeviceAdminSecurityLogsAvailableEventQuery 36 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminSystemUpdatePendingEvent.DeviceAdminSystemUpdatePendingEventQuery 37 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminTransferAffiliatedProfileOwnershipCompleteEvent.DeviceAdminTransferAffiliatedProfileOwnershipCompleteEventQuery 38 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminTransferOwnershipCompleteEvent.DeviceAdminTransferOwnershipCompleteEventQuery 39 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminUserAddedEvent.DeviceAdminUserAddedEventQuery 40 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminUserRemovedEvent.DeviceAdminUserRemovedEventQuery 41 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminUserStartedEvent.DeviceAdminUserStartedEventQuery 42 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminUserStoppedEvent.DeviceAdminUserStoppedEventQuery 43 import com.android.eventlib.events.deviceadminreceivers.DeviceAdminUserSwitchedEvent.DeviceAdminUserSwitchedEventQuery 44 45 /** 46 * Quick access to event queries about device admin receivers. 47 */ 48 interface DeviceAdminReceiverEvents { 49 /** 50 * Query for when [DeviceAdminReceiver.onBugreportFailed] is called 51 * on a device admin receiver. 52 * 53 * 54 * Additional filters can be added to the returned object. 55 * 56 * 57 * `#poll` can be used to fetch results, and the result can be asserted on. 58 */ bugReportFailednull59 fun bugReportFailed(): DeviceAdminBugreportFailedEventQuery 60 61 /** 62 * Query for when [DeviceAdminReceiver.onBugreportShared] is 63 * called on a device admin receiver. 64 * 65 * 66 * Additional filters can be added to the returned object. 67 * 68 * 69 * `#poll` can be used to fetch results, and the result can be asserted on. 70 */ 71 fun bugReportShared(): DeviceAdminBugreportSharedEventQuery 72 73 /** 74 * Query for when [DeviceAdminReceiver.onBugreportSharingDeclined] is 75 * called on a device admin receiver. 76 * 77 * 78 * Additional filters can be added to the returned object. 79 * 80 * 81 * `#poll` can be used to fetch results, and the result can be asserted on. 82 */ 83 fun bugReportSharingDeclined(): DeviceAdminBugreportSharingDeclinedEventQuery 84 85 /** 86 * Query for when [DeviceAdminReceiver.onChoosePrivateKeyAlias] 87 * is called on a device admin receiver. 88 * 89 * 90 * Additional filters can be added to the returned object. 91 * 92 * 93 * `#poll` can be used to fetch results, and the result can be asserted on. 94 */ 95 fun choosePrivateKeyAlias(): DeviceAdminChoosePrivateKeyAliasEventQuery 96 97 /** 98 * Query for when [DeviceAdminReceiver.onDisabled] is called on a 99 * device admin receiver. 100 * 101 * 102 * Additional filters can be added to the returned object. 103 * 104 * 105 * `#poll` can be used to fetch results, and the result can be asserted on. 106 */ 107 fun deviceAdminDisabled(): DeviceAdminDisabledEventQuery 108 109 /** 110 * Query for when [DeviceAdminReceiver.onDisableRequested] is called on 111 * a device admin receiver. 112 * 113 * 114 * Additional filters can be added to the returned object. 115 * 116 * 117 * `#poll` can be used to fetch results, and the result can be asserted on. 118 */ 119 fun deviceAdminDisableRequested(): DeviceAdminDisableRequestedEventQuery 120 121 /** 122 * Query for when [DeviceAdminReceiver.onEnabled] is called on a device 123 * admin receiver. 124 * 125 * 126 * Additional filters can be added to the returned object. 127 * 128 * 129 * `#poll` can be used to fetch results, and the result can be asserted on. 130 */ 131 fun deviceAdminEnabled(): DeviceAdminEnabledEventQuery 132 133 /** 134 * Query for when [DeviceAdminReceiver.onLockTaskModeEntering] 135 * is called on a device admin receiver. 136 * 137 * 138 * Additional filters can be added to the returned object. 139 * 140 * 141 * `#poll` can be used to fetch results, and the result can be asserted on. 142 */ 143 fun lockTaskModeEntering(): DeviceAdminLockTaskModeEnteringEventQuery 144 145 /** 146 * Query for when [DeviceAdminReceiver.onLockTaskModeExiting] is called 147 * on a device admin receiver. 148 * 149 * 150 * Additional filters can be added to the returned object. 151 * 152 * 153 * `#poll` can be used to fetch results, and the result can be asserted on. 154 */ 155 fun lockTaskModeExiting(): DeviceAdminLockTaskModeExitingEventQuery 156 157 /** 158 * Query for when [DeviceAdminReceiver.onNetworkLogsAvailable] 159 * is called on a device admin receiver. 160 * 161 * 162 * Additional filters can be added to the returned object. 163 * 164 * 165 * `#poll` can be used to fetch results, and the result can be asserted on. 166 */ 167 fun networkLogsAvailable(): DeviceAdminNetworkLogsAvailableEventQuery 168 169 /** 170 * Query for when [DeviceAdminReceiver.onOperationSafetyStateChanged] is 171 * called on a device admin receiver. 172 * 173 * 174 * Additional filters can be added to the returned object. 175 * 176 * 177 * `#poll` can be used to fetch results, and the result can be asserted on. 178 */ 179 fun operationSafetyStateChanged(): DeviceAdminOperationSafetyStateChangedEventQuery 180 181 /** 182 * Query for when [DeviceAdminReceiver.onPasswordChanged] is 183 * called on a device admin receiver. 184 * 185 * 186 * Additional filters can be added to the returned object. 187 * 188 * 189 * `#poll` can be used to fetch results, and the result can be asserted on. 190 */ 191 fun passwordChanged(): DeviceAdminPasswordChangedEventQuery 192 193 /** 194 * Query for when [DeviceAdminReceiver.onPasswordExpiring] 195 * is called on a device admin receiver. 196 * 197 * 198 * Additional filters can be added to the returned object. 199 * 200 * 201 * `#poll` can be used to fetch results, and the result can be asserted on. 202 */ 203 fun passwordExpiring(): DeviceAdminPasswordExpiringEventQuery 204 205 /** 206 * Query for when [DeviceAdminReceiver.onPasswordFailed] is 207 * called on a device admin receiver. 208 * 209 * 210 * Additional filters can be added to the returned object. 211 * 212 * 213 * `#poll` can be used to fetch results, and the result can be asserted on. 214 */ 215 fun passwordFailed(): DeviceAdminPasswordFailedEventQuery 216 217 /** 218 * Query for when [DeviceAdminReceiver.onPasswordSucceeded] 219 * is called on a device admin receiver. 220 * 221 * 222 * Additional filters can be added to the returned object. 223 * 224 * 225 * `#poll` can be used to fetch results, and the result can be asserted on. 226 */ 227 fun passwordSucceeded(): DeviceAdminPasswordSucceededEventQuery 228 229 /** 230 * Query for when [DeviceAdminReceiver.onProfileProvisioningComplete] is 231 * called on a device admin receiver. 232 * 233 * 234 * Additional filters can be added to the returned object. 235 * 236 * 237 * `#poll` can be used to fetch results, and the result can be asserted on. 238 */ 239 fun profileProvisioningComplete(): DeviceAdminProfileProvisioningCompleteEventQuery 240 241 /** 242 * Query for when [DeviceAdminReceiver.onReadyForUserInitialization] is 243 * called on a device admin receiver. 244 * 245 * 246 * Additional filters can be added to the returned object. 247 * 248 * 249 * `#poll` can be used to fetch results, and the result can be asserted on. 250 */ 251 fun readyForUserInitialization(): DeviceAdminReadyForUserInitializationEventQuery 252 253 /** 254 * Query for when [DeviceAdminReceiver.onSecurityLogsAvailable] is called 255 * on a device admin receiver. 256 * 257 * 258 * Additional filters can be added to the returned object. 259 * 260 * 261 * `#poll` can be used to fetch results, and the result can be asserted on. 262 */ 263 fun securityLogsAvailable(): DeviceAdminSecurityLogsAvailableEventQuery 264 265 /** 266 * Query for when [DeviceAdminReceiver.onSystemUpdatePending] is 267 * called on a device admin receiver. 268 * 269 * 270 * Additional filters can be added to the returned object. 271 * 272 * 273 * `#poll` can be used to fetch results, and the result can be asserted on. 274 */ 275 fun systemUpdatePending(): DeviceAdminSystemUpdatePendingEventQuery 276 277 /** 278 * Query for when [DeviceAdminReceiver.onTransferAffiliatedProfileOwnershipComplete] 279 * is called on a device admin receiver. 280 * 281 * 282 * Additional filters can be added to the returned object. 283 * 284 * 285 * `#poll` can be used to fetch results, and the result can be asserted on. 286 */ 287 fun transferAffiliatedProfileOwnershipComplete(): DeviceAdminTransferAffiliatedProfileOwnershipCompleteEventQuery 288 289 /** 290 * Query for when [DeviceAdminReceiver.onTransferOwnershipComplete] 291 * is called on a device admin receiver. 292 * 293 * 294 * Additional filters can be added to the returned object. 295 * 296 * 297 * `#poll` can be used to fetch results, and the result can be asserted on. 298 */ 299 fun transferOwnershipComplete(): DeviceAdminTransferOwnershipCompleteEventQuery 300 301 /** 302 * Query for when [DeviceAdminReceiver.onUserAdded] is called 303 * on a device admin receiver. 304 * 305 * 306 * Additional filters can be added to the returned object. 307 * 308 * 309 * `#poll` can be used to fetch results, and the result can be asserted on. 310 */ 311 fun userAdded(): DeviceAdminUserAddedEventQuery 312 313 /** 314 * Query for when [DeviceAdminReceiver.onUserRemoved] is 315 * called on a device admin receiver. 316 * 317 * 318 * Additional filters can be added to the returned object. 319 * 320 * 321 * `#poll` can be used to fetch results, and the result can be asserted on. 322 */ 323 fun userRemoved(): DeviceAdminUserRemovedEventQuery 324 325 /** 326 * Query for when [DeviceAdminReceiver.onUserStarted] is 327 * called on a device admin receiver. 328 * 329 * 330 * Additional filters can be added to the returned object. 331 * 332 * 333 * `#poll` can be used to fetch results, and the result can be asserted on. 334 */ 335 fun userStarted(): DeviceAdminUserStartedEventQuery 336 337 /** 338 * Query for when [DeviceAdminReceiver.onUserStopped] is 339 * called on a device admin receiver. 340 * 341 * 342 * Additional filters can be added to the returned object. 343 * 344 * 345 * `#poll` can be used to fetch results, and the result can be asserted on. 346 */ 347 fun userStopped(): DeviceAdminUserStoppedEventQuery 348 349 /** 350 * Query for when [DeviceAdminReceiver.onUserSwitched] is 351 * called on a device admin receiver. 352 * 353 * 354 * Additional filters can be added to the returned object. 355 * 356 * 357 * `#poll` can be used to fetch results, and the result can be asserted on. 358 */ 359 fun userSwitched(): DeviceAdminUserSwitchedEventQuery 360 } 361