This commit is contained in:
Tungstend 2022-12-05 20:43:59 +08:00
parent e7e6df937d
commit 36ce421ebc
3 changed files with 7 additions and 10 deletions

View File

@ -101,7 +101,6 @@
<service
android:name="com.tungsten.fclcore.download.ProcessService"
android:process=":processService"
android:multiprocess="true"
android:enabled="true"/>
<provider
android:name="androidx.core.content.FileProvider"

View File

@ -68,7 +68,7 @@ public class ProcessService extends Service {
} catch (Exception e) {
e.printStackTrace();
}
onDestroy();
stopSelf();
}
@Override

View File

@ -149,14 +149,12 @@ public class ForgeNewInstallTask extends Task<Version> {
server1.stop();
latch.countDown();
});
Schedulers.androidUIThread().execute(() -> {
Intent service = new Intent(FCLPath.CONTEXT, ProcessService.class);
Bundle bundle = new Bundle();
bundle.putStringArray("command", command.toArray(new String[0]));
service.putExtras(bundle);
FCLPath.CONTEXT.startService(service);
server.start();
});
Intent service = new Intent(FCLPath.CONTEXT, ProcessService.class);
Bundle bundle = new Bundle();
bundle.putStringArray("command", command.toArray(new String[0]));
service.putExtras(bundle);
FCLPath.CONTEXT.startService(service);
server.start();
latch.await();
exitCode = tryCast(((String) server.getResult()).replaceAll(" ", ""), Integer.class).orElse(0);
if (exitCode != 0)