also looking at this
fix(native): preserve workspace sources and native overlay lifecycle
#384
20 files
+500
-227
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2597,6 +2597,21 @@ it('emits native Bluetooth GATT support and versioned permissions only when enab | ||
| 2597 | 2597 | finally { rmSync(output, { recursive: true, force: true }) } |
| 2598 | 2598 | }) |
| 2599 | 2599 | |
| 2600 | it('declares location once when Bluetooth overlaps unrestricted location capabilities', () => { | |
| 2601 | for (const bluetooth of ['enableBluetooth', 'enableHeartRate'] as const) { | |
| 2602 | for (const location of ['enableGeolocation', 'enableBackgroundLocation', 'enableHealthServices'] as const) { | |
| 2603 | const permissions = renderAndroidPermissions({ | |
| 2604 | appName: 'Combined capabilities', | |
| 2605 | packageName: 'dev.craft.combined', | |
| 2606 | [bluetooth]: true, | |
| 2607 | [location]: true, | |
| 2608 | }) | |
| 2609 | const fineLocation = permissions.split('\n').filter(line => line.includes('"android.permission.ACCESS_FINE_LOCATION"')) | |
| 2610 | expect(fineLocation).toEqual([' <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />']) | |
| 2611 | } | |
| 2612 | } | |
| 2613 | }) | |
| 2614 | ||
| 2600 | 2615 | it('reads a heart-rate strap on the page and on native screens alike, declared only when enabled', async () => { |
| 2601 | 2616 | for (const renderer of ['native', 'web'] as const) { |
| 2602 | 2617 | const output = createTempDir(`craft-android-heart-rate-${renderer}-`) |
| @@ -727,7 +727,7 @@ export function renderAndroidPermissions(config: CraftAndroidConfig): string { | ||
| 727 | 727 | ' <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />', |
| 728 | 728 | ' <uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />', |
| 729 | 729 | ' <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />', |
| 730 | ...(config.enableGeolocation ? [] : [' <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />']), | |
| 730 | ...(permissions.has('android.permission.ACCESS_FINE_LOCATION') ? [] : [' <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />']), | |
| 731 | 731 | ].join('\n') : '' |
| 732 | 732 | return [bluetooth, ...[...permissions].map(permission => ` <uses-permission android:name="${permission}" />`)].filter(Boolean).join('\n') |
| 733 | 733 | } |