Skip to content

Commit

Permalink
添加接收开机广播,兼容不允许安卓系统开机启动其他应用的系统
Browse files Browse the repository at this point in the history
  • Loading branch information
kooritea committed Feb 18, 2022
1 parent 345ab3d commit 897a4b0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.kooritea.fcmfix"
minSdkVersion 29
targetSdkVersion 30
versionCode 22
versionName "0.4.3"
versionCode 23
versionName "0.4.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -26,8 +26,4 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

}
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kooritea.fcmfix">
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application
android:allowBackup="true"
Expand Down Expand Up @@ -36,6 +37,11 @@
android:exported="true"
>
</provider>
<receiver android:name=".BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>

</manifest>
13 changes: 13 additions & 0 deletions app/src/main/java/com/kooritea/fcmfix/BootCompletedReceiver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.kooritea.fcmfix;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootCompletedReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i("fcmfix", "waiting load config");
}
}

0 comments on commit 897a4b0

Please sign in to comment.