Basically I've got a boot receiver set up like so:
<receiver
android:name="com.xxx.xxx.XXX.BootUpReciever"
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
<intent-filter android:priority="999" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver> code here
Now this seems to work fine most of the time. It will boot fire on boot fine and continue doing what it needs to do. However, if I combine this with another application I develop, the receiver never gets called despite still being registered.
I always make sure to run the application first so it is registered, so it's not that. If I uninstall the other application, it works. They do have a shared user, but I don't think that has much to do with it as I use that across a number of applications which work fine in combination. It's just this one particular application it does not get along with.
EDIT:
I do have <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
, otherwise it would not work at all.
And the boot receiver itself:
public class BootUpReciever extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent args) {
incBootCounter(context);
Intent i = new Intent(context, HomeScreenActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
private void incBootCounter(Context ctx) {
SharedPreferences s = PreferenceManager.getDefaultSharedPreferences(ctx);
if (s != null) {
Editor edit = s.edit();
if (edit != null) {
edit.putInt("how_many_times_have_we_booted", s.getInt("how_many_times_have_we_booted", 0) + 1);
edit.commit();
}
}
}
}
Just to point out, this isn't an application that goes on the Google Play store or anything. It's a very specific application that is only deployed to devices we own as a company.
EDIT 2:
I've found some help in the logs. With the other application installed I get this message:
W/BroadcastQueue( 986): Permission Denial: receiving Intent { act=android.intent.action.BOOT_COMPLETED flg=0x8000010 (has extras) } to com.xxx.xxx.xxxxxxxxx/.BootUpReciever requires android.permission.RECEIVE_BOOT_COMPLETED due to sender null (uid 1000)
Without the other application I get this message:
I/ActivityManager( 980): Start proc com.xxx.xxx.xxxxxx for broadcast com.sps.smc.SMCKiosk/.BootUpReciever: pid=1656 uid=10109 gids={50109, 3003, 3002, 3001, 1028, 1015}