Open se-ti opened 1 year ago
@se-ti What's an externPackageId
?
I thought this could be a setting string (for example, somwhere by the existing switch Collector / Notify about collected measurements), where the user can add package id (like com.example.datagatherer) of the application, he wants to notify.
Btw, i've read some more specs since july, and i'm not sure even intent.setPackage would help :( Probably there exists one more limit: implicit broadcast receivers work just between apps, signed with the same certificate. But this should be tested.
Can you share some articles? From what I found there shouldn't be any issues except for missing intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
.
As far as i understand,
https://stackoverflow.com/a/46121548/7867704 If the Intent has a ComponentName, the Intent is explicit. Otherwise, it is implicit. ComponentName... ...can be derived by the system from the action string, etc. plus the package defined via setPackage()
That's says me, you need setPackage to wake up another app with a specific intent.
P.S. The idea of common certificate goes from https://developer.android.com/about/versions/oreo/background#services Broadcasts that require a [signature permission](https://developer.android.com/guide/topics/manifest/permission-element#plevel) are exempted from this restriction, since these broadcasts are only sent to apps that are signed with the same certificate, not to all the apps on the device.
and seems to be irrelevant.
I don't declare any <permission>
in the app. My broadcasts are not protected this way so I don't think it's the case.
It may be truth that some configuration is missing but instead of setPackage
I think we need to set the exact class and package name - https://stackoverflow.com/a/62891524
Can you share the code you use to receive the intent in your app?
I've made a test in couple of scenarios:
Intent.FLAG_INCLUDE_STOPPED_PACKAGES
.This brings the conclusion that something is indeed wrong but no idea what...
I'd like to use your app to collect data to build a mobile network coverage map.
TowerCollectors' MEASUREMENTS_COLLECTED notifications are great for it, but according to contemporary Android Policies (prohibited implicit broadcast receivers) they won't wake up inactive application. https://developer.android.com/about/versions/oreo/background#broadcasts
Could you please add externPackageID setting and a couple of lines
here https://github.com/zamojski/TowerCollector/blob/7315e1f3c04e80867712467e052f08c6e29b4c01/app/src/main/java/info/zamojski/soft/towercollector/broadcast/ExternalBroadcastSender.java#L42C66-L42C66