Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / launcher / src / main / AndroidManifest.xml

AndroidManifest.xml158 lines · 8.0 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools">
4
5 <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). -->
6 <!-- This app uses no motion/environment sensors; MAOS withholds the -->
7 <!-- Sensors permission at install instead of auto-granting it. -->
8 <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" />
9
10 <uses-permission android:name="android.permission.SET_WALLPAPER" />
11 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
12 android:maxSdkVersion="32" />
13
14 <uses-permission android:name="android.permission.DELETE_PACKAGES"
15 tools:ignore="ProtectedPermissions" />
16 <uses-permission android:name="android.permission.MODIFY_QUIET_MODE"
17 tools:ignore="ProtectedPermissions" />
18 <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
19 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
20 <!-- Only for the TV network tile: Wi-Fi, Ethernet or offline, and the Wi-Fi signal. -->
21 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
22 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
23 <!-- Lets "Uninstall" in the TV edit menu open Android's uninstall prompt. -->
24 <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
25
26 <queries>
27 <intent>
28 <action android:name="android.intent.action.MAIN" />
29 <category android:name="android.intent.category.LAUNCHER" />
30 </intent>
31 <intent>
32 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
33 </intent>
34 <!-- Android 11+ only shows a home screen the TV apps it asks to see. -->
35 <intent>
36 <action android:name="android.intent.action.MAIN" />
37 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
38 </intent>
39 <!-- Settings screens the TV network tile opens. -->
40 <intent>
41 <action android:name="android.settings.WIFI_SETTINGS" />
42 </intent>
43 <intent>
44 <action android:name="android.settings.WIRELESS_SETTINGS" />
45 </intent>
46 <intent>
47 <action android:name="android.settings.SETTINGS" />
48 </intent>
49 <!-- Google TV's HDMI input player, so TV HDMI tiles open the right surface. -->
50 <package android:name="com.google.android.tv.inputplayer" />
51 </queries>
52
53 <!-- Leanback rows list the app on TV; touch stays available so phones keep it.
54 required=true on leanback would be wrong here — this APK also serves phones. -->
55 <uses-feature
56 android:name="android.software.leanback"
57 android:required="false" />
58 <uses-feature
59 android:name="android.hardware.touchscreen"
60 android:required="false" />
61 <!-- Single APK for phone, TV and watch. Deliberately NO
62 android.hardware.type.watch uses-feature here: required="true"
63 would block every phone/TV install, and required="false" is
64 disallowed for this feature (lint InvalidWearFeatureAttribute;
65 Google's packaging model does not support one APK for Wear and
66 non-Wear via Play). This app does not distribute through Play's
67 watch channel - it is sideloaded / F-Droid-installed, where no
68 feature declaration is needed to install on a watch - so the
69 APK carries no watch feature filter at all and
70 FormFactor.isWatch (PackageManager.FEATURE_WATCH, still
71 reported by watch hardware at runtime) routes the experience. -->
72 <!-- Watch sync / ringing paths wake the watch CPU when they fire. -->
73 <uses-permission android:name="android.permission.WAKE_LOCK" />
74 <!-- Wi-Fi is only read for the TV network tile; Ethernet-only TVs must still install. -->
75 <uses-feature
76 android:name="android.hardware.wifi"
77 android:required="false" />
78
79 <application
80 android:allowBackup="true"
81 android:backupAgent=".platform.AppBackupAgent"
82 android:banner="@drawable/tv_banner"
83 android:dataExtractionRules="@xml/data_extraction_rules"
84 android:icon="@mipmap/ic_launcher"
85 android:label="@string/app_name"
86 android:roundIcon="@mipmap/ic_launcher"
87 android:supportsRtl="true"
88 android:theme="@style/Theme.Launcher">
89 <activity
90 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
91 android:name=".MainActivity"
92 android:exported="true"
93 android:launchMode="singleTask"
94 android:resizeableActivity="true"
95 android:stateNotNeeded="true"
96 android:theme="@style/Theme.Launcher">
97 <!--
98 One filter carrying every category: separate filters on one activity build
99 separate resolve entries that confuse launcher resolution (learned merging
100 tvlauncher in). LEANBACK_LAUNCHER puts the app in TV rows; HOME + DEFAULT
101 keep it offerable as the default home on both form factors.
102 -->
103 <intent-filter>
104 <action android:name="android.intent.action.MAIN" />
105 <category android:name="android.intent.category.LAUNCHER" />
106 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
107 <category android:name="android.intent.category.HOME" />
108 <category android:name="android.intent.category.DEFAULT" />
109 </intent-filter>
110 <intent-filter>
111 <action android:name="android.intent.action.APPLICATION_PREFERENCES" />
112 <category android:name="android.intent.category.DEFAULT" />
113 </intent-filter>
114 </activity>
115
116 <!-- Watch experience is paired with the phone app, not standalone. -->
117 <meta-data
118 android:name="com.google.android.wearable.standalone"
119 android:value="false" />
120
121 <!-- Watch experience: entered only via MainActivity's watch routing
122 (no launcher filter of its own; exported=false). It is inert on
123 a phone/TV: MainActivity forwards only on FEATURE_WATCH, and
124 the watch sync bridge is started only from this activity. See
125 AGENTS.md for why it must never claim CATEGORY_HOME. -->
126 <activity
127 android:name=".ui.WearMainActivity"
128 android:exported="false"
129 android:taskAffinity=""
130 android:theme="@android:style/Theme.Material.NoActionBar" />
131
132 <!-- Watch conduit scheduled push sync: the phone Watch app fires
133 ConduitSync.ACTION (signature permission, package-addressed)
134 and this receiver pushes the current snapshot over the
135 conduit. Exported only to holders of that permission. -->
136 <receiver
137 android:name=".sync.ConduitSyncTriggerReceiver"
138 android:exported="true"
139 android:permission="com.vayunmathur.watch.permissions.CONDUIT">
140 <intent-filter>
141 <action android:name="com.vayunmathur.watch.action.SYNC_TRIGGER" />
142 </intent-filter>
143 </receiver>
144 <!-- Watch "Open on phone" wake: the phone Watch conduit host fires
145 OpenOnPhoneContract.ACTION (signature permission, package-addressed)
146 when a watch open request arrives with no live registration in
147 this app; this receiver launches the main activity. -->
148 <receiver
149 android:name=".sync.OpenOnPhoneReceiver"
150 android:exported="true"
151 android:permission="com.vayunmathur.watch.permissions.CONDUIT">
152 <intent-filter>
153 <action android:name="com.vayunmathur.watch.action.OPEN_ON_PHONE" />
154 </intent-filter>
155 </receiver>
156
157 </application>
158</manifest>