8000 PendingIntent.FLAG_IMMUTABLE needed for sdk level 31+ · rnixx/python-for-android@20221aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 20221aa

Browse files
committed
PendingIntent.FLAG_IMMUTABLE needed for sdk level 31+
1 parent 550a2ce commit 20221aa

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

pythonforandroid/bootstraps/common/build/jni/application/src/start.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -406,45 +406,6 @@ JNIEXPORT int JNICALL Java_org_kivy_android_PythonService_nativeStart(
406406
}
407407

408408
#if defined(BOOTSTRAP_NAME_SERVICELIBRARY)
409-
// JNIEXPORT void JNICALL Java_org_kivy_android_PythonWorker_nativeStart(
410-
// JNIEnv *env,
411-
// jobject thiz,
412-
// jstring j_android_private,
413-
// jstring j_android_argument,
414-
// jstring j_worker_entrypoint,
415-
// jstring j_python_name,
416-
// jstring j_python_home,
417-
// jstring j_python_path) {
418-
// jboolean iscopy;
419-
// const char *android_private =
420-
// (*env)->GetStringUTFChars(env, j_android_private, &iscopy);
421-
// const char *android_argument =
422-
// (*env)->GetStringUTFChars(env, j_android_argument, &iscopy);
423-
// const char *worker_entrypoint =
424-
// (*env)->GetStringUTFChars(env, j_worker_entrypoint, &iscopy);
425-
// const char *python_name =
426-
// (*env)->GetStringUTFChars(env, j_python_name, &iscopy);
427-
// const char *python_home =
428-
// (*env)->GetStringUTFChars(env, j_python_home, &iscopy);
429-
// const char *python_path =
430-
// (*env)->GetStringUTFChars(env, j_python_path, &iscopy);
431-
432-
// setenv("ANDROID_PRIVATE", android_private, 1);
433-
// setenv("ANDROID_ARGUMENT", android_argument, 1);
434-
// setenv("ANDROID_APP_PATH", android_argument, 1);
435-
// setenv("ANDROID_ENTRYPOINT", worker_entrypoint, 1);
436-
// setenv("PYTHONOPTIMIZE", "2", 1);
437-
// setenv("PYTHON_NAME", python_name, 1);
438-
// setenv("PYTHONHOME", python_home, 1);
439-
// setenv("PYTHONPATH", python_path, 1);
440-
// setenv("P4A_BOOTSTRAP", bootstrap_name, 1);
441-
442-
// char *argv[] = {"."};
443-
// /* ANDROID_ARGUMENT points to service subdir,
444-
// * so main() will run main.py from this dir
445-
// */
446-
// main_(1, argv, 0);
447-
// }
448409

449410
JNIEXPORT int JNICALL Java_org_kivy_android_PythonWorker_nativeStart(
450411
JNIEnv *env,

pythonforandroid/bootstraps/service_library/build/src/main/java/org/kivy/android/PythonBoundService.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ public void doStartForeground(String serviceTitle, String serviceDescription) {
143143
Notification notification;
144144
Context context = getApplicationContext();
145145
Intent contextIntent = new Intent(context, PythonActivity.class);
146-
// PendingIntent pIntent = PendingIntent.getActivity(context, 0, contextIntent,
147-
// PendingIntent.FLAG_UPDATE_CURRENT);
148146
PendingIntent pIntent = PendingIntent.getActivity(context, 0, contextIntent,
149-
134217728 | 67108864);
147+
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
150148

151149
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
152150
notification = new Notification(

0 commit comments

Comments
 (0)
0