i have a rotted Nexus6
With Android6
. I've created a system app (located in system/app
) i wish to execute a simple code when receiving ACTION_BOOT_COMPLETED but for some reason the code does not executes..
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.atest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<receiver
android:name="com.atest.testReceiver">
<intent-filter android:enabled="true">
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Receiver:
public class testReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
// Some simple code
}
}
}
Any suggestions?
EDIT: When executing with adb the following:
am broadcast -a android.intent.action.BOOT_COMPLETED -p com.atest
The code execute as expected, but still when rebooting/booting, no success..