android.app.IActivityController Java Examples

The following examples show how to use android.app.IActivityController. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NoDialogActivityController.java    From test-butler with Apache License 2.0 5 votes vote down vote up
/**
 * Attempts to set the activity controller
 *
 * On newer versions of Android, there is an extra parameter in setActivityController to
 * identify if we're in monkey testing mode. See this commit:
 * https://android.googlesource.com/platform/frameworks/base/+/4a18c26609df2c4230885acb64e92fb51aba70df%5E%21/#F0
 *
 * @throws Throwable if the activity controller cannot be set
 */
private static void attemptSetController(final Object am, @Nullable IActivityController activityController) throws Throwable {
    Method setMethod;
    try {
        setMethod = am.getClass().getMethod("setActivityController", IActivityController.class);
        setMethod.invoke(am, activityController);
    } catch (Throwable e) {
        setMethod = am.getClass().getMethod("setActivityController", IActivityController.class, boolean.class);
        final Object[] params = {activityController, false};
        setMethod.invoke(am, params);
    }
}
 
Example #2
Source File: Watchdog.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
public void setActivityController(IActivityController controller) {
    synchronized (this) {
        mController = controller;
    }
}