acra icon indicating copy to clipboard operation
acra copied to clipboard

MIUI 10 of Android 8.1 MIUILOG- reject service

Open DanielWu-China opened this issue 7 years ago • 6 comments

2019-02-21 15:37:36.074 1856-3166/? I/AutoStartManagerService: MIUILOG- Reject service :Intent { cmp=com.xxxxxx/org.acra.sender.JobSenderService } userId : 0 uid : 10322 2019-02-21 15:37:36.075 1856-3166/? D/JobSchedulerService: Error executing JobStatus{9ef96b7 #u0a322/0 com.xxxxxxx/org.acra.sender.JobSenderService u=0 s=10322 TIME=none:-2ms READY}

When I use the version of acra-http:5.3.0-rc02 on a xiaomi note3,logged like this above. Onlyif I turn on the app's auto run, then the SenderService can be started. When I used the version of 4.8.5,it doesn't have this problem,but has another one : Not allowed to start service Intent { cmp=com.xxxxxx/org.acra.sender.SenderService (has extras) }: app is in background uid UidRecord{add5585 u0a65 CEM idle procs:1 seq(0,0,0). Which fixed in dev 5.1

DanielWu-China avatar Feb 21 '19 07:02 DanielWu-China

Xiaomi blocks JobScheduler by default (when autostart is off), even if app is in a foreground :) Need to write your own ReportSender...

Mikanoshi avatar Mar 10 '19 03:03 Mikanoshi

With #707 and this it looks like MIUI is just broken. I am going to close these issues, as I can't do anything when android OEMs block the APIs we use.

F43nd1r avatar Mar 12 '19 01:03 F43nd1r

Xiaomi blocks JobScheduler by default (when autostart is off), even if app is in a foreground :) Need to write your own ReportSender...

So...brother, you must have wrote a ReportSender, can you share me one copy? My email address is: [email protected]. Thanks for your help!

DanielWu-China avatar Mar 19 '19 03:03 DanielWu-China

@DanielWu-China there is no ReportSender which can wich can fix this, the problem is earlier in the chain. You can try a SenderScheduler something like this:

public class MIUISenderScheduler implements SenderScheduler {
    private final SendingConductor sendingConductor;

    private MIUISenderScheduler(@NonNull Context context, @NonNull CoreConfiguration config) {
        sendingConductor = new SendingConductor(context, config);
    }

    @Override
    public void scheduleReportSending(boolean onlySendSilentReports) {
        sendingConductor.sendReports(onlySendSilentReports);
    }

    @AutoService(SenderSchedulerFactory.class)
    public static class Factory implements SenderSchedulerFactory {
        @NonNull
        @Override
        public SenderScheduler create(@NonNull Context context, @NonNull CoreConfiguration config) {
            return new MIUISenderScheduler(context, config);
        }
    }
}```

F43nd1r avatar Mar 19 '19 04:03 F43nd1r

mething like thi

Thanks for your replay & help!

DanielWu-China avatar Mar 19 '19 05:03 DanielWu-China

I wrote my own plugin that implements ReportInteraction, and my own crash dialog. Handle report files manually and send them using HttpURLConnection. Also got rid of auto service and all annotations, hate them. SimplePluginLoader all the way :)

https://code.highspec.ru/Mikanoshi/CustoMIUIzer/src/branch/master/app/src/main/java/name/mikanoshi/customiuizer/MainApplication.java https://code.highspec.ru/Mikanoshi/CustoMIUIzer/src/branch/master/app/src/main/java/name/mikanoshi/customiuizer/crashreport/DialogInteraction.java https://code.highspec.ru/Mikanoshi/CustoMIUIzer/src/branch/master/app/src/main/java/name/mikanoshi/customiuizer/crashreport/Dialog.java

Mikanoshi avatar Mar 19 '19 12:03 Mikanoshi