Skip to content

Commit 6892b35

Browse files
committed
Pull master-only commits into develop: Support for native services
2 parents f19d3f7 + 5a94d07 commit 6892b35

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ def make_package(args):
485485
"service_names": service_names,
486486
"android_api": android_api,
487487
"debug": "debug" in args.build_mode,
488+
"native_services": args.native_services
488489
}
489490
if get_bootstrap_name() == "sdl2":
490491
render_args["url_scheme"] = url_scheme
@@ -643,6 +644,9 @@ def parse_args_and_make_package(args=None):
643644
ap.add_argument('--service', dest='services', action='append', default=[],
644645
help='Declare a new service entrypoint: '
645646
'NAME:PATH_TO_PY[:foreground]')
647+
ap.add_argument('--native-service', dest='native_services', action='append', default=[],
648+
help='Declare a new native service: '
649+
'package.name.service')
646650
if get_bootstrap_name() != "service_only":
647651
ap.add_argument('--presplash', dest='presplash',
648652
help=('A jpeg file to use as a screen while the '

pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
<service android:name="{{ args.package }}.Service{{ name|capitalize }}"
118118
android:process=":service_{{ name }}" />
119119
{% endfor %}
120+
{% for name in native_services %}
121+
<service android:name="{{ name }}" />
122+
{% endfor %}
120123

121124
{% if args.billing_pubkey %}
122125
<service android:name="org.kivy.android.billing.BillingReceiver"

0 commit comments

Comments
 (0)