Java 类org.robolectric.shadows.ShadowActivityManager 实例源码

项目:android-utilset    文件:ActivityUtilsTest.java   
private RunningTaskInfo createRunningTaskInfo() {
    ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    ShadowActivityManager shadowAm = Robolectric.shadowOf(am);
    RunningTaskInfo info = new RunningTaskInfo();
    shadowAm.setTasks(Arrays.asList(info));
    return info;
}
项目:android-utilset    文件:ActivityUtilsTest.java   
private void createRunningAppProcessInfo(int pid) {
    ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    ShadowActivityManager shadowAm = Robolectric.shadowOf(am);

    RunningAppProcessInfo proc = new RunningAppProcessInfo();
    proc.importance = RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
    proc.pid = pid;
    shadowAm.setProcesses(Arrays.asList(proc));
}
项目:FullRobolectricTestSample    文件:Robolectric.java   
public static ShadowActivityManager shadowOf(ActivityManager instance) {
  return (ShadowActivityManager) shadowOf_(instance);
}