Files
FocusBox/src/main/AndroidManifest.xml

72 lines
3.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 计时在前台服务里跑,需要常驻通知;息屏后 EMUI 可能冻结进程,
到点结算靠精确闹钟唤醒兜底(Android 12+ 需要 SCHEDULE_EXACT_ALARM,
拿不到时退化为窗口闹钟)。 -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- specialUse:Android 14 起 dataSync 类型有 24 小时 6 小时的累计上限,
番茄钟连续衔接多轮会被强停;specialUse 没有这个限制。
但 specialUse 是 Android 14 才引入的类型,Android 12/13 不认识这个位,
startForeground 会被拒绝 → 计时冻结成负数。因此两种类型都声明:
运行时按系统版本选(<34 用 dataSync,>=34 用 specialUse)。 -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- 锁屏全屏倒计时:计时中锁屏亮屏时把全屏页盖在锁屏上 -->
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<!-- 锁屏悬浮窗:鸿蒙拦 Activity 后台启动,改用 WindowManager 直接把倒计时画在锁屏上(addView 不受"后台弹出界面"限制) -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name=".App"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".ui.MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.lockscreen.LockScreenActivity"
android:excludeFromRecents="true"
android:exported="false"
android:launchMode="singleTask"
android:showWhenLocked="true"
android:taskAffinity=""
android:theme="@style/LockScreenTheme" />
<service
android:name=".service.TimerService"
android:exported="false"
android:foregroundServiceType="dataSync|specialUse">
<!-- Android 14 要求说明 specialUse 的具体用途;旧系统忽略此声明 -->
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="pomodoro_timer_countdown" />
</service>
<receiver
android:name=".service.DeadlineReceiver"
android:exported="false" />
</application>
</manifest>