Skip to content

Commit 5a94d07

Browse files
authored
Merge pull request #2244 from Chronolife-team/native_services_upstream
Support for native services
2 parents 1b3b0e3 + 336c636 commit 5a94d07

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

+4
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ def make_package(args):
461461
"service_names": service_names,
462462
"android_api": android_api,
463463
"debug": "debug" in args.build_mode,
464+
"native_services": args.native_services
464465
}
465466
if get_bootstrap_name() == "sdl2":
466467
render_args["url_scheme"] = url_scheme
@@ -619,6 +620,9 @@ def parse_args_and_make_package(args=None):
619620
ap.add_argument('--service', dest='services', action='append', default=[],
620621
help='Declare a new service entrypoint: '
621622
'NAME:PATH_TO_PY[:foreground]')
623+
ap.add_argument('--native-service', dest='native_services', action='append', default=[],
624+
help='Declare a new native service: '
625+
'package.name.service')
622626
if get_bootstrap_name() != "service_only":
623627
ap.add_argument('--presplash', dest='presplash',
624628
help=('A jpeg file to use as a screen while the '

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

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
<service android:name="{{ args.package }}.Service{{ name|capitalize }}"
117117
android:process=":service_{{ name }}" />
118118
{% endfor %}
119+
{% for name in native_services %}
120+
<service android:name="{{ name }}" />
121+
{% endfor %}
119122

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

0 commit comments

Comments
 (0)