forked from openhab/openhab-android
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove EventListener for Android 14 on Play Store
According to Google the permission `FOREGROUND_SERVICE_DATA_SYNC` may not be requested by openHAB. The ItemUpdateWorker can use the foreground type `shortService` instead, but I haven't found a good replacement for `EventListenerService`, so it needs to be removed for Android 14 on Play Store builds. Signed-off-by: mueller-ma <[email protected]>
- Loading branch information
1 parent
31ec680
commit 3b96e16
Showing
6 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- Not allowed on Play Store --> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> | ||
|
||
<application> | ||
<service | ||
android:name=".background.EventListenerService" | ||
android:foregroundServiceType="dataSync" | ||
android:enabled="true" | ||
android:exported="false" /> | ||
</application> | ||
</manifest> |
16 changes: 16 additions & 0 deletions
16
mobile/src/foss/java/org/openhab/habdroid/util/ForegroundServiceHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2010-2025 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
package org.openhab.habdroid.util | ||
|
||
fun isDataSyncForegroundServiceAllowed() = true |
18 changes: 18 additions & 0 deletions
18
mobile/src/full/java/org/openhab/habdroid/util/ForegroundServiceHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2010-2025 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
package org.openhab.habdroid.util | ||
|
||
import android.os.Build | ||
|
||
fun isDataSyncForegroundServiceAllowed() = Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters