@Test public void testGenerateCommands_systemMountedFirst() throws Exception { downloadFontPack(); TestSubscriber<String> testSubscriber = new TestSubscriber<>(); FontInstaller.generateCommands(MOCK_FONT_PACK, null).subscribe(testSubscriber); List<String> commands = testSubscriber.getOnNextEvents(); assertEquals(SystemConstants.MOUNT_SYSTEM_COMMAND, commands.get(0)); deleteDownloadFolder(); }
static Observable<String> generateCommands(FontPackage fontPackage, Context context) { return Observable.from(fontPackage.getFontSet()) .map(FontInstaller::getFileOrThrow) .map(FontInstaller::createInstallCommand) .toList() .startWith(Arrays.asList(MOUNT_SYSTEM_COMMAND, createLockscreenFixCommand(context))) .flatMapIterable(commands -> commands); }
FontInstaller { static Observable<String> generateCommands(FontPackage fontPackage, Context context) { return Observable.from(fontPackage.getFontSet()) .map(FontInstaller::getFileOrThrow) .map(FontInstaller::createInstallCommand) .toList() .startWith(Arrays.asList(MOUNT_SYSTEM_COMMAND, createLockscreenFixCommand(context))) .flatMapIterable(commands -> commands); } }
FontInstaller { static Observable<String> generateCommands(FontPackage fontPackage, Context context) { return Observable.from(fontPackage.getFontSet()) .map(FontInstaller::getFileOrThrow) .map(FontInstaller::createInstallCommand) .toList() .startWith(Arrays.asList(MOUNT_SYSTEM_COMMAND, createLockscreenFixCommand(context))) .flatMapIterable(commands -> commands); }  }
FontInstaller { static Observable<String> generateCommands(FontPackage fontPackage, Context context) { return Observable.from(fontPackage.getFontSet()) .map(FontInstaller::getFileOrThrow) .map(FontInstaller::createInstallCommand) .toList() .startWith(Arrays.asList(MOUNT_SYSTEM_COMMAND, createLockscreenFixCommand(context))) .flatMapIterable(commands -> commands); }  static Observable<List<String>> install(FontPackage fontPackage, Context context); }
FontInstaller { static Observable<String> generateCommands(FontPackage fontPackage, Context context) { return Observable.from(fontPackage.getFontSet()) .map(FontInstaller::getFileOrThrow) .map(FontInstaller::createInstallCommand) .toList() .startWith(Arrays.asList(MOUNT_SYSTEM_COMMAND, createLockscreenFixCommand(context))) .flatMapIterable(commands -> commands); }  static Observable<List<String>> install(FontPackage fontPackage, Context context);  }