Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I actually need to export SyncAdapter service?

onPerformSync(...) {
    // building status bar notification here
}

<service android:name=".SyncService" android:exported="false"> ...

This works for me (4.4.2 SGN3). Notifications appear. Both requestSync() and addPeriodicSync().

Do anybody has some thoughts about?

Is there need for exporting SyncAdapter service?

What am I actually wanna know is whether any other (enemy) application can start my exported service or not. If they can, I don't need to export the service hoping Android isn't so liberal.

I haven't find any clarifications in the Android dev guide/api. I'm pretty novice and I hope my question is correct and understandable enough :)

like image 786
Игорь Щербаков Avatar asked Nov 01 '22 15:11

Игорь Щербаков


1 Answers

I suppose you need to export SyncService for using it from other applications. This is what documentation says:

The attribute android:exported="true" allows processes other than your app (including the system) to access the Service.

If you don't need to share your sync service to other apps, probably you can leave it not exported. But you need to test it on old versions of android, it's logic might has changed.

like image 52
lobzik Avatar answered Nov 15 '22 04:11

lobzik