-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broadcast not accepted by Android system #470
Comments
The problem is that applyDynamics method ignores target package and target class. Without the data the broadcast is implicit which is not allowed on Android 8+. Also extras are lost here. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0b8d99ca..cf238990 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
diff --git a/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java b/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
index e39fbfac..c568bbd0 100644
--- a/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
+++ b/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
@@ -225,7 +225,13 @@ public class IntentOperationData implements OperationData, Reused {
String type = extra.type;
extras.add(new ExtraItem(key, value, type));
}
- data.extras = Extras.mayConstruct(extras);
+ intentData.extras = Extras.mayConstruct(extras);
+ }
+ if (data.target_package != null) {
+ intentData.target_package = data.target_package;
+ }
+ if (data.target_class != null) {
+ intentData.target_class = data.target_class;
}
IntentOperationData ret = new IntentOperationData(intentData);
ret.setSkillID(skillID()); |
Easer version
0.8.3-beta3
To Reproduce
Settings of Send Broadcast to reproduce the behavior:
Error log (warning) from BroadcastQueue:
Background execution not allowed: receiving Intent { act=info.varden.hauk.START_ALONE_THEN_MAKE_TOAST flg=0x10 } to info.varden.hauk/.global.Receiver
Sending broadcast through command isn't possible either:
am broadcast -a info.varden.hauk.START_ALONE_THEN_MAKE_TOAST -n info.varden.hauk/.global.Receiver -e source test -e requestLink test
results in the warning
Permission Denial: broadcast asks to run as user -2 but is calling from uid u0a189; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
from ActivityManager.
Extra phone info:
Bug reproduced on
Additional context
The broadcast is addressed to Hauk.
The text was updated successfully, but these errors were encountered: