mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 16:41:43 +01:00
Add MY_PACKAGE_REPLACED receiver to manifest, to re-connect after update, especially for users of Nightly releases. Fix #2855
This commit is contained in:
parent
cc44ba4123
commit
6f01dd6514
@ -393,8 +393,8 @@
|
|||||||
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
|
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
@ -30,8 +30,12 @@ public class AutoStartReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (GBApplication.getGBPrefs().getAutoStart() && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
|
||||||
Log.i(TAG, "Boot completed, starting Gadgetbridge");
|
if (GBApplication.getGBPrefs().getAutoStart() &&
|
||||||
|
(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) ||
|
||||||
|
Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())
|
||||||
|
)) {
|
||||||
|
Log.i(TAG, "Boot or reinstall completed, starting Gadgetbridge");
|
||||||
if (GBApplication.getPrefs().getBoolean("general_autoconnectonbluetooth", false)) {
|
if (GBApplication.getPrefs().getBoolean("general_autoconnectonbluetooth", false)) {
|
||||||
Log.i(TAG, "Autoconnect is enabled, attempting to connect");
|
Log.i(TAG, "Autoconnect is enabled, attempting to connect");
|
||||||
GBApplication.deviceService().connect();
|
GBApplication.deviceService().connect();
|
||||||
|
Loading…
Reference in New Issue
Block a user