TP-80792 | patch supersami
This commit is contained in:
@@ -7,8 +7,18 @@ index 0000000..0d259dd
|
||||
+o/classes
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/042976b41dc1ef162569303f31ddcffc/transformed/classes/classes.dex b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/042976b41dc1ef162569303f31ddcffc/transformed/classes/classes.dex
|
||||
new file mode 100644
|
||||
index 0000000..8240780
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/042976b41dc1ef162569303f31ddcffc/transformed/classes/classes.dex differ
|
||||
index 0000000..e69de29
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/results.bin b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/results.bin
|
||||
new file mode 100644
|
||||
index 0000000..28bb879
|
||||
--- /dev/null
|
||||
+++ b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/results.bin
|
||||
@@ -0,0 +1 @@
|
||||
+o/classes.jar
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/transformed/classes.jar b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/transformed/classes.jar
|
||||
new file mode 100644
|
||||
index 0000000..5837d85
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/0cfab95b40dc736141057b808d40da6d/transformed/classes.jar differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/7da62193441587b95bce6ba6e8fd9d83/results.bin b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/7da62193441587b95bce6ba6e8fd9d83/results.bin
|
||||
new file mode 100644
|
||||
index 0000000..28bb879
|
||||
@@ -18,8 +28,18 @@ index 0000000..28bb879
|
||||
+o/classes.jar
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/7da62193441587b95bce6ba6e8fd9d83/transformed/classes.jar b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/7da62193441587b95bce6ba6e8fd9d83/transformed/classes.jar
|
||||
new file mode 100644
|
||||
index 0000000..389b7e8
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/7da62193441587b95bce6ba6e8fd9d83/transformed/classes.jar differ
|
||||
index 0000000..e69de29
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/results.bin b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/results.bin
|
||||
new file mode 100644
|
||||
index 0000000..0d259dd
|
||||
--- /dev/null
|
||||
+++ b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/results.bin
|
||||
@@ -0,0 +1 @@
|
||||
+o/classes
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/transformed/classes/classes.dex b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/transformed/classes/classes.dex
|
||||
new file mode 100644
|
||||
index 0000000..3261f3d
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/.transforms/d9ca77dc84434606c913ea5755b89c5d/transformed/classes/classes.dex differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/generated/source/buildConfig/debug/com/supersami/foregroundservice/BuildConfig.java b/node_modules/@supersami/rn-foreground-service/android/build/generated/source/buildConfig/debug/com/supersami/foregroundservice/BuildConfig.java
|
||||
new file mode 100644
|
||||
index 0000000..c379c5b
|
||||
@@ -113,7 +133,7 @@ index 0000000..9e26dfe
|
||||
\ No newline at end of file
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/compile_library_classes_jar/debug/classes.jar b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/compile_library_classes_jar/debug/classes.jar
|
||||
new file mode 100644
|
||||
index 0000000..be50f48
|
||||
index 0000000..c0a9c56
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/compile_library_classes_jar/debug/classes.jar differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/compile_r_class_jar/debug/R.jar b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/compile_r_class_jar/debug/R.jar
|
||||
new file mode 100644
|
||||
@@ -2085,11 +2105,11 @@ index 0000000..611979d
|
||||
+int xml rn_dev_preferences 0x0
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
|
||||
new file mode 100644
|
||||
index 0000000..858a0ab
|
||||
index 0000000..9a93c12
|
||||
--- /dev/null
|
||||
+++ b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
|
||||
@@ -0,0 +1 @@
|
||||
+#Thu Sep 05 19:37:39 IST 2024
|
||||
+#Fri Sep 20 01:04:33 IST 2024
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml
|
||||
new file mode 100644
|
||||
index 0000000..74fb504
|
||||
@@ -2136,15 +2156,15 @@ index 0000000..ee71c76
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/Constants.class differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$1.class b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$1.class
|
||||
new file mode 100644
|
||||
index 0000000..3d1310f
|
||||
index 0000000..52136e1
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$1.class differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$2.class b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$2.class
|
||||
new file mode 100644
|
||||
index 0000000..0da94eb
|
||||
index 0000000..48431aa
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService$2.class differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService.class b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService.class
|
||||
new file mode 100644
|
||||
index 0000000..6fb9b22
|
||||
index 0000000..9936030
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundService.class differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundServiceModule.class b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/javac/debug/classes/com/supersami/foregroundservice/ForegroundServiceModule.class
|
||||
new file mode 100644
|
||||
@@ -2292,7 +2312,7 @@ index 0000000..5264350
|
||||
\ No newline at end of file
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar
|
||||
new file mode 100644
|
||||
index 0000000..e8b6add
|
||||
index 0000000..c279b44
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt b/node_modules/@supersami/rn-foreground-service/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt
|
||||
new file mode 100644
|
||||
@@ -3812,10 +3832,14 @@ index 0000000..7839885
|
||||
+ INJECTED from /Users/amanchaturvedi/Documents/Projects/Address-Verification-App/node_modules/@supersami/rn-foreground-service/android/src/main/AndroidManifest.xml
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin b/node_modules/@supersami/rn-foreground-service/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin
|
||||
new file mode 100644
|
||||
index 0000000..063d042
|
||||
index 0000000..c09d308
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/.DS_Store b/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/.DS_Store
|
||||
new file mode 100644
|
||||
index 0000000..1a484c3
|
||||
Binary files /dev/null and b/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/.DS_Store differ
|
||||
diff --git a/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/foregroundservice/ForegroundService.java b/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/foregroundservice/ForegroundService.java
|
||||
index 31a2bd8..3fbf5e5 100644
|
||||
index 31a2bd8..e596979 100644
|
||||
--- a/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/foregroundservice/ForegroundService.java
|
||||
+++ b/node_modules/@supersami/rn-foreground-service/android/src/main/java/com/supersami/foregroundservice/ForegroundService.java
|
||||
@@ -4,6 +4,7 @@ import android.app.Notification;
|
||||
@@ -3904,7 +3928,7 @@ index 31a2bd8..3fbf5e5 100644
|
||||
|
||||
startForeground(id, notification);
|
||||
|
||||
@@ -87,27 +86,27 @@ public class ForegroundService extends Service {
|
||||
@@ -87,27 +86,34 @@ public class ForegroundService extends Service {
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3925,27 +3949,36 @@ index 31a2bd8..3fbf5e5 100644
|
||||
- final Intent service = new Intent(getApplicationContext(), ForegroundServiceTask.class);
|
||||
- service.putExtras(taskConfig);
|
||||
- getApplicationContext().startService(service);
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ final Intent service = new Intent(getApplicationContext(), ForegroundServiceTask.class);
|
||||
+ service.putExtras(taskConfig);
|
||||
+ getApplicationContext().startService(service);
|
||||
|
||||
-
|
||||
- int delay = (int)taskConfig.getDouble("delay");
|
||||
+ int delay = (int) taskConfig.getDouble("delay");
|
||||
|
||||
-
|
||||
- int loopDelay = (int)taskConfig.getDouble("loopDelay");
|
||||
- Log.d("SuperLog",""+loopDelay);
|
||||
- handler.postDelayed(this, loopDelay);
|
||||
- }
|
||||
+ int loopDelay = (int) taskConfig.getDouble("loopDelay");
|
||||
+ Log.d("SuperLog", "" + loopDelay);
|
||||
+ handler.postDelayed(this, loopDelay);
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ try {
|
||||
+ final Intent service = new Intent(getApplicationContext(), ForegroundServiceTask.class);
|
||||
+ service.putExtras(taskConfig);
|
||||
+ getApplicationContext().startService(service);
|
||||
+
|
||||
+ int delay = (int) taskConfig.getDouble("delay");
|
||||
+
|
||||
+ int loopDelay = (int) taskConfig.getDouble("loopDelay");
|
||||
+ Log.d("SuperLog", "" + loopDelay);
|
||||
+ handler.postDelayed(this, loopDelay);
|
||||
+ } catch (IllegalStateException e) {
|
||||
+ Log.e("ForegroundService", "Cannot start service from background: " + e.getMessage());
|
||||
+ // Optionally, handle the case when the app is in the background, e.g., schedule a retry
|
||||
+ } catch (Exception e) {
|
||||
+ Log.e("ForegroundService", "Failed to start service: " + e.getMessage());
|
||||
+ }
|
||||
+ }
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -115,13 +114,16 @@ public class ForegroundService extends Service {
|
||||
@@ -115,13 +121,16 @@ public class ForegroundService extends Service {
|
||||
String action = intent.getAction();
|
||||
|
||||
/**
|
||||
@@ -3968,7 +4001,7 @@ index 31a2bd8..3fbf5e5 100644
|
||||
|
||||
if (action != null) {
|
||||
if (action.equals(Constants.ACTION_FOREGROUND_SERVICE_START)) {
|
||||
@@ -137,26 +139,26 @@ public class ForegroundService extends Service {
|
||||
@@ -137,26 +146,26 @@ public class ForegroundService extends Service {
|
||||
if (intent.getExtras() != null && intent.getExtras().containsKey(NOTIFICATION_CONFIG)) {
|
||||
Bundle notificationConfig = intent.getExtras().getBundle(NOTIFICATION_CONFIG);
|
||||
|
||||
@@ -4005,7 +4038,7 @@ index 31a2bd8..3fbf5e5 100644
|
||||
Log.e("ForegroundService", "Failed to update notification: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -164,18 +166,18 @@ public class ForegroundService extends Service {
|
||||
@@ -164,18 +173,18 @@ public class ForegroundService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4031,21 +4064,22 @@ index 31a2bd8..3fbf5e5 100644
|
||||
Log.e("ForegroundService", "Service is not running to run tasks.");
|
||||
return START_REDELIVER_INTENT;
|
||||
}
|
||||
@@ -186,15 +188,13 @@ public class ForegroundService extends Service {
|
||||
@@ -185,16 +194,13 @@ public class ForegroundService extends Service {
|
||||
taskConfig = intent.getExtras().getBundle(TASK_CONFIG);
|
||||
|
||||
try {
|
||||
|
||||
- if( taskConfig.getBoolean("onLoop") == true) {
|
||||
- this.handler.post(this.runnableCode);
|
||||
- }else{
|
||||
- this.runHeadlessTask(taskConfig);
|
||||
- }
|
||||
+ if (taskConfig.getBoolean("onLoop") == true) {
|
||||
+ this.handler.post(this.runnableCode);
|
||||
+ } else {
|
||||
+ this.runHeadlessTask(taskConfig);
|
||||
+ }
|
||||
|
||||
- if( taskConfig.getBoolean("onLoop") == true) {
|
||||
- this.handler.post(this.runnableCode);
|
||||
- }else{
|
||||
- this.runHeadlessTask(taskConfig);
|
||||
- }
|
||||
-
|
||||
-
|
||||
- }
|
||||
- catch (Exception e) {
|
||||
@@ -4053,7 +4087,7 @@ index 31a2bd8..3fbf5e5 100644
|
||||
Log.e("ForegroundService", "Failed to start task: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -202,23 +202,21 @@ public class ForegroundService extends Service {
|
||||
@@ -202,23 +208,21 @@ public class ForegroundService extends Service {
|
||||
}
|
||||
|
||||
else if (action.equals(Constants.ACTION_FOREGROUND_SERVICE_STOP)) {
|
||||
@@ -4081,47 +4115,56 @@ index 31a2bd8..3fbf5e5 100644
|
||||
running = 0;
|
||||
mInstance = null;
|
||||
lastNotificationConfig = null;
|
||||
@@ -232,9 +230,6 @@ public class ForegroundService extends Service {
|
||||
@@ -232,39 +236,36 @@ public class ForegroundService extends Service {
|
||||
|
||||
}
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
public void runHeadlessTask(Bundle bundle){
|
||||
- public void runHeadlessTask(Bundle bundle){
|
||||
+ public void runHeadlessTask(Bundle bundle) {
|
||||
final Intent service = new Intent(getApplicationContext(), ForegroundServiceTask.class);
|
||||
service.putExtras(bundle);
|
||||
@@ -242,11 +237,11 @@ public class ForegroundService extends Service {
|
||||
int delay = (int)bundle.getDouble("delay");
|
||||
|
||||
if(delay <= 0){
|
||||
- int delay = (int)bundle.getDouble("delay");
|
||||
+ int delay = (int) bundle.getDouble("delay");
|
||||
|
||||
- if(delay <= 0){
|
||||
- getApplicationContext().startService(service);
|
||||
-
|
||||
- // wakelock should be released automatically by the task
|
||||
- // Shouldn't be needed, it's called automatically by headless
|
||||
- //HeadlessJsTaskService.acquireWakeLockNow(getApplicationContext());
|
||||
- }
|
||||
- else{
|
||||
+ if (delay <= 0) {
|
||||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
+ ContextCompat.startForegroundService(getApplicationContext(), service);
|
||||
+ } else {
|
||||
+ getApplicationContext().startService(service);
|
||||
+ }
|
||||
}
|
||||
else{
|
||||
+ } else {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@@ -256,7 +251,11 @@ public class ForegroundService extends Service {
|
||||
@Override
|
||||
public void run() {
|
||||
- if(running <= 0){
|
||||
+ if (running <= 0) {
|
||||
return;
|
||||
}
|
||||
try{
|
||||
- try{
|
||||
- getApplicationContext().startService(service);
|
||||
- }
|
||||
- catch (Exception e) {
|
||||
+ try {
|
||||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
+ ContextCompat.startForegroundService(getApplicationContext(), service);
|
||||
+ } else {
|
||||
+ getApplicationContext().startService(service);
|
||||
+ }
|
||||
}
|
||||
catch (Exception e) {
|
||||
+ } catch (Exception e) {
|
||||
Log.e("ForegroundService", "Failed to start delayed headless task: " + e.getMessage());
|
||||
@@ -264,7 +263,5 @@ public class ForegroundService extends Service {
|
||||
}
|
||||
}
|
||||
}, delay);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user