Android One plus 6(Android pie version) BOOT COMPLETE Broadcast Receiver not working
<receiver
android:name=".service.ConnectionReceiver"
android:enabled="true" android:exported="true"
>
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.conn.ACTION_BOOT_COMPLETED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
below is my reciever class :
public class ConnectionReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("API123", "" + intent.getAction());
Toast.makeText(context, "isatRunningonbootanyproblem", Toast.LENGTH_SHORT).show();
context.startService(newIntent(context, MyBackgroundService.class));
}
}
I need to start my service once boot get completed. Please suggest what should i do
below is error log i am getting
018-11-06 05:25:34.994 885-3000/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=oneplus.intent.action.ANY_DATA_STATE flg=0x10 } to test.myapplication/.MyReceiver
2018-11-06 05:25:38.241 885-3000/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.net.conn.DATA_ACTIVITY_CHANGE flg=0x10 (has extras) } to test.myapplication/.MyReceiver requires android.permission.RECEIVE_DATA_ACTIVITY_CHANGE due to sender android (uid 1000)