Broadcast parameter sent via not taking effect
Success in PC
adb shell am broadcast -a android.intent.action.shbl.shut_down --ei time 6666
Faild in Phone
from jnius import autoclass
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
Intent = autoclass('android.content.Intent')
intent = Intent("android.intent.action.shbl.shut_down")
intent.putExtra("time", 6666)
mActivity.sendBroadcast(intent)
Can receive broadcast, but did not receive parameter “time“
I suspect this is about Android behavior rather than p4a or pyjnius behavior.
There are plenty of examples of putExtra using pyjnius. For example https://github.com/Android-for-Python/androidstorage4kivy/blob/main/src/androidstorage4kivy/chooser.py#L28. The functionality of the Java is transparent to pyjnius.
This might be a permissions issue, adb has root permission, the app has app permission.
This might be an api issue. I suggest you check the Android documentation for "android.intent.action.shbl.shut_down" (I can't find any!) for a documented "time" extra. For example https://developer.android.com/reference/android/content/Intent#ACTION_SHUTDOWN does not have a "time" extra.
I suspect this is about Android behavior rather than p4a or pyjnius behavior.
There are plenty of examples of
putExtrausing pyjnius. For example https://github.com/Android-for-Python/androidstorage4kivy/blob/main/src/androidstorage4kivy/chooser.py#L28. The functionality of the Java is transparent to pyjnius.This might be a permissions issue,
adbhas root permission, the app has app permission.This might be an api issue. I suggest you check the Android documentation for "android.intent.action.shbl.shut_down" (I can't find any!) for a documented "time" extra. For example https://developer.android.com/reference/android/content/Intent#ACTION_SHUTDOWN does not have a "time" extra.
I tried to make the system print out the received broadcast, but found that putExtra can only emit a string equivalent to es, but the broadcast requires ei numbers, and all receivers cannot recognize the parameters
I'm sorry I don't know what es and ei number are.
Its not clear to me that this is a p4a issue.