A Bluetooth device only reports its own name through AudioDeviceInfo.productName while it is enumerated as an active output, i.e. while it is connected. Paired-but-switched-off devices therefore had no name to fall back on, and the platform-name cache is in-memory only by design (bt-device-identity ADR-4), so it self-heals per session ONLY for whatever happens to be connected. Every other device showed its raw id. Android already knows those names: BluetoothAdapter.getBondedDevices() lists every pairing with its name and MAC, connected or not, and nothing in this app was asking. Read it and seed the platform-name cache from it, keyed bt_a2dp:<uppercase MAC> to match the ids the audio layer emits. Seeded BEFORE the active-device query so a live enumeration name, being the fresher of the two, still wins; a user's custom name outranks both. Re-read on refrescarDispositivoActual so pairing or renaming a device in system settings shows up as soon as the list becomes visible. Reading the bond list is gated by BLUETOOTH_CONNECT from API 31 and by the legacy BLUETOOTH permission below it, so declare the latter with maxSdkVersion 30. It is a normal permission: granted at install, no runtime prompt, no new friction. When the answer is unavailable — permission denied, no adapter, Bluetooth off — both layers return an empty map rather than throwing, and the row degrades to the id exactly as before. Does not help rows persisted under a bt_a2dp:name: placeholder id: those never had a MAC to match against.
148 lines
6.7 KiB
XML
148 lines
6.7 KiB
XML
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
<!-- Permisos requeridos para streaming de audio -->
|
|
<uses-permission android:name="android.permission.INTERNET"/>
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED"/>
|
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
|
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
|
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
|
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
|
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
|
|
<!--
|
|
Reading the paired-device list is gated by BLUETOOTH_CONNECT from API 31
|
|
and by this legacy permission below it. Normal permission: granted at
|
|
install, no runtime prompt.
|
|
-->
|
|
<uses-permission
|
|
android:name="android.permission.BLUETOOTH"
|
|
android:maxSdkVersion="30"/>
|
|
|
|
<application
|
|
android:label="PluriWave"
|
|
android:name="${applicationName}"
|
|
android:icon="@mipmap/ic_launcher"
|
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
android:networkSecurityConfig="@xml/network_security_config">
|
|
<activity
|
|
android:name=".MainActivity"
|
|
android:exported="true"
|
|
android:launchMode="singleTop"
|
|
android:taskAffinity=""
|
|
android:theme="@style/LaunchTheme"
|
|
android:showWhenLocked="true"
|
|
android:turnScreenOn="true"
|
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
android:hardwareAccelerated="true"
|
|
android:windowSoftInputMode="adjustResize">
|
|
<meta-data
|
|
android:name="io.flutter.embedding.android.NormalTheme"
|
|
android:resource="@style/NormalTheme"
|
|
/>
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN"/>
|
|
<category android:name="android.intent.category.LAUNCHER"/>
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<!-- Servicio de audio en background (audio_service) -->
|
|
<service
|
|
android:name="com.ryanheise.audioservice.AudioService"
|
|
android:foregroundServiceType="mediaPlayback"
|
|
android:exported="true">
|
|
<intent-filter>
|
|
<action android:name="android.media.browse.MediaBrowserService"/>
|
|
</intent-filter>
|
|
</service>
|
|
|
|
<service
|
|
android:name=".PluriWaveAlarmService"
|
|
android:foregroundServiceType="mediaPlayback|systemExempted"
|
|
android:exported="false" />
|
|
|
|
<!-- Receptor de controles de media (auriculares, notificación) -->
|
|
<receiver
|
|
android:name="com.ryanheise.audioservice.MediaButtonReceiver"
|
|
android:exported="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MEDIA_BUTTON"/>
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".PluriWaveAlarmReceiver"
|
|
android:exported="false"
|
|
android:directBootAware="true">
|
|
<intent-filter>
|
|
<action android:name="es.freetimelab.pluriwave.alarm.FIRE"/>
|
|
<action android:name="es.freetimelab.pluriwave.alarm.PRE_NOTICE"/>
|
|
<action android:name="es.freetimelab.pluriwave.alarm.SKIP_NEXT"/>
|
|
<action android:name="es.freetimelab.pluriwave.alarm.POSTPONE_NEXT"/>
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".PluriWaveBootReceiver"
|
|
android:exported="true"
|
|
android:directBootAware="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>
|
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
|
<action android:name="android.intent.action.USER_UNLOCKED"/>
|
|
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
|
|
<action android:name="android.intent.action.TIME_SET"/>
|
|
<action android:name="android.intent.action.TIMEZONE_CHANGED"/>
|
|
<action android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED"/>
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<provider
|
|
android:name="androidx.core.content.FileProvider"
|
|
android:authorities="${applicationId}.fileprovider"
|
|
android:exported="false"
|
|
android:grantUriPermissions="true">
|
|
<meta-data
|
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
android:resource="@xml/pluriwave_file_paths" />
|
|
</provider>
|
|
|
|
<!--
|
|
Publishes the app-private recordings folder as a browsable storage
|
|
root for the system file manager. MANAGE_DOCUMENTS restricts direct
|
|
access to the document framework (DocumentsUI); grantUriPermissions
|
|
lets it hand single-file access to whatever app the user picks.
|
|
-->
|
|
<provider
|
|
android:name=".RecordingsDocumentsProvider"
|
|
android:authorities="${applicationId}.recordings"
|
|
android:exported="true"
|
|
android:grantUriPermissions="true"
|
|
android:permission="android.permission.MANAGE_DOCUMENTS">
|
|
<intent-filter>
|
|
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
|
|
</intent-filter>
|
|
</provider>
|
|
|
|
<meta-data
|
|
android:name="flutterEmbedding"
|
|
android:value="2" />
|
|
|
|
<!-- Android Auto discovery (android-auto-media) -->
|
|
<meta-data
|
|
android:name="com.google.android.gms.car.application"
|
|
android:resource="@xml/automotive_app_desc" />
|
|
</application>
|
|
<queries>
|
|
<intent>
|
|
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
|
<data android:mimeType="text/plain"/>
|
|
</intent>
|
|
</queries>
|
|
</manifest>
|