wake-alarm/phone_app/android/app/src/main/AndroidManifest.xml
Krzysztof kuhy Rudnicki 34037e55c1 phone: sick days — picker, silent ring, stick stand-down, pre-alarm sync
- Sick days screen (own name, sick icon, cat-2 fill): tap today or a later
  day to mark it sick, tap again to clear; past days inert. Writes the
  sickdays wire format (state sick/cleared + actor, one HLC per write) to
  sickdays-sync/devices via crdt_sync syncLog.
- Mutual exclusion in both pickers: each syncs the other pool on open and
  refuses a date it holds, naming the pool; an unreadable pool refuses all.
- Native SickDays cache (fail closed via DayCache); AlarmReceiver skips the
  ring with reason "sick_day" (no markFired, no ring_started); StickCheck
  verdict sick_day, streak skips sick days; stakes card says so.
- Pre-alarm pool sync: allow-while-idle alarm at 21:00 and A-30 (request
  code 1006) runs a headless engine (poolSyncMain) that pulls both pools
  from RTDB and rewrites both native caches, so a PC mark arrives with the
  app closed. The ring decision stays a cache read.
- JVM unit tests (JUnit 4.13.2) for DayCache, RingDecision,
  PoolSyncSchedule, StickCheck; Dart tests; Dart->Python interop check.

pylint hook skipped: verify.py imports sickdays, not in the hook env until
the sickdays-v0.1.0 tag exists; run by hand in a sickdays venv (10.00/10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xfj1sxKH9VBPqpcAni8Jry
2026-10-16 13:22:40 +02:00

118 lines
6.1 KiB
XML

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<!-- Alarm-clock app: USE_EXACT_ALARM is granted at install with no user
prompt, unlike SCHEDULE_EXACT_ALARM. setAlarmClock() is what earns it. -->
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- The full-screen intent is what puts the dismiss screen over the
lockscreen; from API 34 this permission gates it and can still be
revoked, so the app checks canUseFullScreenIntent() at schedule time. -->
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.TURN_SCREEN_ON"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<!-- Room proof (item 3): steps are the fallback, NFC the real proof. -->
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.NFC"/>
<!-- Home presence: the BSSID of the connected Wi-Fi is redacted to
02:00:00:00:00:00 without fine location, so this gates the Wi-Fi
check as much as the GPS fallback. While-in-use only: the read
runs from AlarmActivity, which is foregrounded over the
lockscreen, so no ACCESS_BACKGROUND_LOCATION and no change to
AlarmService's foregroundServiceType. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- Install-time, no prompt. WifiManager/ConnectivityManager throw
SecurityException without these, which would look exactly like
"not at home". -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- Lets WorkdayStick reach focus-owner's signature-protected receiver;
both apps are signed with the same release key. -->
<uses-permission android:name="com.kuhy.focus_owner.permission.SIGNAL_LOCKDOWN"/>
<application
android:label="wake_alarm_sync"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
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>
<!-- The dismiss screen, launched by the full-screen intent. Not
exported: only this app's own PendingIntent may start it. -->
<activity
android:name=".AlarmActivity"
android:exported="false"
android:launchMode="singleInstance"
android:taskAffinity=".alarm"
android:excludeFromRecents="true"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"/>
<!-- foregroundServiceType must ALSO be passed to startForeground(); on
API 34+ omitting either is a hard crash the moment the alarm fires. -->
<service
android:name=".AlarmService"
android:exported="false"
android:foregroundServiceType="mediaPlayback"/>
<receiver
android:name=".AlarmReceiver"
android:exported="false"/>
<!-- Daily check that the alarm is still armed; not exported, only
this app's own repeating PendingIntent reaches it. -->
<receiver
android:name=".WatchdogReceiver"
android:exported="false"/>
<!-- The stick's exact check at A + 15 (StickAlarm.kt); not exported,
only this app's own PendingIntent reaches it. -->
<receiver
android:name=".StickCheckReceiver"
android:exported="false"/>
<!-- The pre-alarm sync of the free/sick day pools (PoolSyncAlarm.kt);
not exported, only this app's own PendingIntent reaches it. -->
<receiver
android:name=".PoolSyncReceiver"
android:exported="false"/>
<receiver
android:name=".BootReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
<intent>
<action android:name="android.intent.action.SET_ALARM"/>
</intent>
</queries>
</manifest>