mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 20:15:32 -04:00
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
This commit is contained in:
parent
b867da60fc
commit
e4569f7c82
5 changed files with 6 additions and 23 deletions
|
|
@ -7,7 +7,4 @@ android_app {
|
||||||
privileged: true,
|
privileged: true,
|
||||||
certificate: "platform",
|
certificate: "platform",
|
||||||
static_libs: [ "androidx.core_core" ],
|
static_libs: [ "androidx.core_core" ],
|
||||||
optimize: {
|
|
||||||
proguard_flags_files: ["proguard.flags"],
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,14 @@
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<activity
|
<service
|
||||||
android:name=".CameraLightSensorService"
|
android:name=".CameraLightSensorService"
|
||||||
android:exported="true">
|
android:exported="true"
|
||||||
|
android:foregroundServiceType="camera">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="android.intent.action.SCREEN_OFF" />
|
<action android:name="android.intent.action.SCREEN_OFF" />
|
||||||
<action android:name="android.intent.action.SCREEN_ON" />
|
<action android:name="android.intent.action.SCREEN_ON" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</service>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -3,15 +3,14 @@ package com.eurekateam.cameralightsensor;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import com.eurekateam.cameralightsensor.CameraLightSensorService;
|
||||||
|
|
||||||
public class BootReceiver extends BroadcastReceiver {
|
public class BootReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
|
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
final Intent i = new Intent();
|
final Intent i = new Intent(context, CameraLightSensorService.class);
|
||||||
i.setClassName("com.eurekateam.cameralightsensor",
|
|
||||||
"com.eurekateam.cameralightsensor.CameraLightSensorService");
|
|
||||||
context.startForegroundService(i);
|
context.startForegroundService(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
|
||||||
<string-array translatable="false" name="config_tether_wifi_regexs">
|
|
||||||
<item>"wlan\\d"</item>
|
|
||||||
<item>"swlan\\d"</item>
|
|
||||||
</string-array>
|
|
||||||
</resources>
|
|
||||||
Loading…
Reference in a new issue