From e4569f7c82daadf014f68147aa1976819bb6ee69 Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Sat, 13 Nov 2021 19:19:44 +0900 Subject: [PATCH] universal7885: CameraLightSensor: Use correct code to start service * W ActivityManager: Unable to start service Intent { cmp=com.eurekateam.cameralightsensor/.CameraLightSensorService } U=0: not found * Ref: https://stackoverflow.com/questions/19105587/unable-to-start-service-intent-not-found * Makes BootReceiver unable to start service --- universal7885-common/apps/CameraLightSensor/Android.bp | 3 --- .../apps/CameraLightSensor/AndroidManifest.xml | 7 ++++--- universal7885-common/apps/CameraLightSensor/proguard.flags | 7 ------- .../src/com/eurekateam/cameralightsensor/BootReceiver.java | 5 ++--- .../rro_overlays/TetheringOverlay/res/values/array.xml | 7 ------- 5 files changed, 6 insertions(+), 23 deletions(-) delete mode 100755 universal7885-common/apps/CameraLightSensor/proguard.flags delete mode 100644 universal7885-common/rro_overlays/TetheringOverlay/res/values/array.xml diff --git a/universal7885-common/apps/CameraLightSensor/Android.bp b/universal7885-common/apps/CameraLightSensor/Android.bp index 6c8e4e6..9f4e546 100644 --- a/universal7885-common/apps/CameraLightSensor/Android.bp +++ b/universal7885-common/apps/CameraLightSensor/Android.bp @@ -7,7 +7,4 @@ android_app { privileged: true, certificate: "platform", static_libs: [ "androidx.core_core" ], - optimize: { - proguard_flags_files: ["proguard.flags"], - }, } diff --git a/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml b/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml index 3053306..d0165f0 100755 --- a/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml +++ b/universal7885-common/apps/CameraLightSensor/AndroidManifest.xml @@ -30,13 +30,14 @@ - + android:exported="true" + android:foregroundServiceType="camera"> - + diff --git a/universal7885-common/apps/CameraLightSensor/proguard.flags b/universal7885-common/apps/CameraLightSensor/proguard.flags deleted file mode 100755 index 25042b4..0000000 --- a/universal7885-common/apps/CameraLightSensor/proguard.flags +++ /dev/null @@ -1,7 +0,0 @@ -# Uncomment this to preserve the line number information for -# debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. --renamesourcefileattribute SourceFile diff --git a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/BootReceiver.java b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/BootReceiver.java index c15b565..b849dbe 100755 --- a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/BootReceiver.java +++ b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/BootReceiver.java @@ -3,15 +3,14 @@ package com.eurekateam.cameralightsensor; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import com.eurekateam.cameralightsensor.CameraLightSensorService; public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) { if (context != null) { - final Intent i = new Intent(); - i.setClassName("com.eurekateam.cameralightsensor", - "com.eurekateam.cameralightsensor.CameraLightSensorService"); + final Intent i = new Intent(context, CameraLightSensorService.class); context.startForegroundService(i); } } diff --git a/universal7885-common/rro_overlays/TetheringOverlay/res/values/array.xml b/universal7885-common/rro_overlays/TetheringOverlay/res/values/array.xml deleted file mode 100644 index 4d25fab..0000000 --- a/universal7885-common/rro_overlays/TetheringOverlay/res/values/array.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - "wlan\\d" - "swlan\\d" - -