Add UserCompletedEventType#newUserCompletedEventType static method for testing.
Bug: 222358822 Test: atest com.android.internal.car.CarServiceHelperServiceTest Change-Id: I95d226e5e2c0a1547a385e6bfaa9e19e6721dfd3
This commit is contained in:
@@ -32,6 +32,7 @@ import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.server.pm.UserManagerService;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
@@ -261,13 +262,23 @@ public abstract class SystemService {
|
||||
public @interface EventTypesFlag {
|
||||
}
|
||||
|
||||
private @EventTypesFlag int mEventType;
|
||||
private final @EventTypesFlag int mEventType;
|
||||
|
||||
/** @hide */
|
||||
UserCompletedEventType(@EventTypesFlag int eventType) {
|
||||
mEventType = eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link UserCompletedEventType}.
|
||||
* @hide
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public static UserCompletedEventType newUserCompletedEventTypeForTest(
|
||||
@EventTypesFlag int eventType) {
|
||||
return new UserCompletedEventType(eventType);
|
||||
}
|
||||
|
||||
/** Returns whether one of the events is {@link #onUserStarting}. */
|
||||
public boolean includesOnUserStarting() {
|
||||
return (mEventType & EVENT_TYPE_USER_STARTING) != 0;
|
||||
|
||||
Reference in New Issue
Block a user