mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
The connection timestamp cache was only maintained while the connected-devices flow had a subscriber. If the process died while a device stayed connected and that device then disconnected and reconnected with nothing running, the restarted collection found the old entry still keyed by a currently-connected address, kept it through the prune, and reported the original connect time — so the popup age check rejected an arbitrarily old connection. The ACL broadcasts arrive at a manifest-registered receiver that wakes the process regardless of any flow subscription, so the stamp is taken there instead: connect stamps (keeping an existing one, which is the earlier and therefore truer time), disconnect drops the entry. The flow keeps its own stamp-on-first-sight and prune as a backstop for the force-stopped state and missed broadcasts. ACL_DISCONNECTED was already in the receiver's expected actions but was never registered in the manifest. It does not start the monitor: a disconnect is not a reason to start monitoring, and the start triggers here are deliberately conservative.
175 lines
6.3 KiB
XML
175 lines
6.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<manifest xmlns:tools="http://schemas.android.com/tools"
|
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
|
|
<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
|
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
|
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
|
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
<uses-permission
|
|
android:name="android.permission.FOREGROUND_SERVICE"
|
|
tools:ignore="ForegroundServicesPolicy" />
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
|
|
|
|
<uses-permission
|
|
android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
|
|
tools:ignore="BackgroundLocationPolicy" />
|
|
|
|
<uses-permission
|
|
android:name="android.permission.BLUETOOTH"
|
|
android:maxSdkVersion="30" />
|
|
<uses-permission
|
|
android:name="android.permission.BLUETOOTH_ADMIN"
|
|
android:maxSdkVersion="30" />
|
|
|
|
<uses-permission
|
|
android:name="android.permission.ACCESS_COARSE_LOCATION"
|
|
android:maxSdkVersion="30" />
|
|
<uses-permission
|
|
android:name="android.permission.ACCESS_FINE_LOCATION"
|
|
android:maxSdkVersion="30" />
|
|
|
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
|
|
|
<uses-permission
|
|
android:name="android.permission.BLUETOOTH_SCAN"
|
|
android:usesPermissionFlags="neverForLocation"
|
|
tools:ignore="UnusedAttribute" />
|
|
|
|
<uses-feature
|
|
android:name="android.hardware.bluetooth_le"
|
|
android:required="true" />
|
|
|
|
<application
|
|
android:name=".App"
|
|
android:allowBackup="true"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:label="@string/app_name"
|
|
android:supportsRtl="true"
|
|
android:theme="@style/AppTheme">
|
|
|
|
<activity
|
|
android:name=".main.ui.MainActivity"
|
|
android:exported="true"
|
|
android:launchMode="singleTop"
|
|
android:theme="@style/AppThemeSplash">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<receiver
|
|
android:name=".common.bluetooth.BleScanResultReceiver"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="eu.darken.capod.bluetooth.DELIVER_SCAN_RESULTS" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".monitor.core.receiver.BootCompletedReceiver"
|
|
android:exported="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".monitor.core.receiver.BluetoothEventReceiver"
|
|
android:enabled="true"
|
|
android:exported="true"
|
|
android:label="Service trigger">
|
|
<intent-filter>
|
|
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
|
|
<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
|
|
<receiver
|
|
android:name=".main.ui.widget.WidgetProvider"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
</intent-filter>
|
|
<meta-data
|
|
android:name="android.appwidget.provider"
|
|
android:resource="@xml/battery_widget_info" />
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".main.ui.widget.AncWidgetProvider"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
</intent-filter>
|
|
<meta-data
|
|
android:name="android.appwidget.provider"
|
|
android:resource="@xml/anc_widget_info" />
|
|
</receiver>
|
|
|
|
<provider
|
|
android:name="androidx.core.content.FileProvider"
|
|
android:authorities="${applicationId}.provider"
|
|
android:exported="false"
|
|
android:grantUriPermissions="true">
|
|
<meta-data
|
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
android:resource="@xml/file_provider_paths" />
|
|
</provider>
|
|
|
|
<!-- Widget configuration -->
|
|
<activity
|
|
android:name=".main.ui.widget.WidgetConfigurationActivity"
|
|
android:theme="@style/AppTheme"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<provider
|
|
android:name="androidx.startup.InitializationProvider"
|
|
android:authorities="${applicationId}.androidx-startup"
|
|
android:exported="false"
|
|
tools:node="merge">
|
|
|
|
<meta-data
|
|
android:name="androidx.work.WorkManagerInitializer"
|
|
android:value="androidx.startup"
|
|
tools:node="remove" />
|
|
|
|
</provider>
|
|
|
|
<!-- Debug stuff-->
|
|
<activity
|
|
android:name=".common.debug.recording.ui.RecorderActivity"
|
|
android:theme="@style/AppTheme" />
|
|
|
|
<service
|
|
android:name=".monitor.core.worker.MonitorService"
|
|
android:foregroundServiceType="connectedDevice"
|
|
android:exported="false" />
|
|
|
|
<service
|
|
android:name=".main.ui.tile.AncTileService"
|
|
android:exported="true"
|
|
android:icon="@drawable/ic_anc_on"
|
|
android:label="@string/tile_anc_label"
|
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
|
<intent-filter>
|
|
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
|
</intent-filter>
|
|
<meta-data
|
|
android:name="android.service.quicksettings.ACTIVE_TILE"
|
|
android:value="false" />
|
|
</service>
|
|
</application>
|
|
|
|
</manifest>
|