File tree Expand file tree Collapse file tree
java/com/andrerinas/headunitrevived/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 android : largeHeap =" true"
6161 android : icon =" @mipmap/ic_launcher"
6262 android : label =" @string/title"
63- android : appCategory =" navigation "
63+ android : appCategory =" maps "
6464 tools : ignore =" GoogleAppIndexingWarning" >
6565
6666 <activity
126126 <action android : name =" android.intent.action.NAVIGATE" />
127127 <category android : name =" android.intent.category.DEFAULT" />
128128 </intent-filter >
129+
130+ <meta-data
131+ android : name =" android.app.shortcuts"
132+ android : resource =" @xml/shortcuts" />
129133 </activity >
130134
131135 <activity
Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ class MainActivity : BaseActivity() {
9696 if (! ip.isNullOrEmpty()) {
9797 AppLog .i(" Received connect intent for IP: $ip " )
9898 ContextCompat .startForegroundService(this , AapService .createIntent(ip, this ))
99+ } else {
100+ AppLog .i(" Received connect intent without IP -> triggering last session auto-connect" )
101+ val autoIntent = Intent (this , AapService ::class .java).apply {
102+ action = AapService .ACTION_CHECK_USB
103+ }
104+ ContextCompat .startForegroundService(this , autoIntent)
99105 }
100106 } else if (data?.scheme == " headunit" && data.host == " disconnect" ) {
101107 AppLog .i(" Received disconnect intent" )
Original file line number Diff line number Diff line change 229229 <string name =" android_auto_starting" >Android Auto startet…</string >
230230 <string name =" notification_service_running" >Headunit Revived läuft</string >
231231 <string name =" notification_projection_active" >Android Auto wird projiziert</string >
232+ <string name =" shortcut_connect_title" >Verbinden</string >
233+ <string name =" shortcut_connect_desc" >Mit letztem Gerät verbinden</string >
234+ <string name =" shortcut_disconnect_title" >Trennen</string >
235+ <string name =" shortcut_disconnect_desc" >Aktuelle Sitzung beenden</string >
232236</resources >
Original file line number Diff line number Diff line change 229229 <string name =" android_auto_starting" >Android Auto is starting…</string >
230230 <string name =" notification_service_running" >Headunit Revived is running</string >
231231 <string name =" notification_projection_active" >Android Auto is projected</string >
232+ <string name =" shortcut_connect_title" >Connect</string >
233+ <string name =" shortcut_connect_desc" >Connect to last known device</string >
234+ <string name =" shortcut_disconnect_title" >Disconnect</string >
235+ <string name =" shortcut_disconnect_desc" >End current session</string >
232236</resources >
233237
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <shortcuts xmlns : android =" http://schemas.android.com/apk/res/android" >
3+ <shortcut
4+ android : shortcutId =" connect_last"
5+ android : enabled =" true"
6+ android : icon =" @drawable/ic_stat_aa"
7+ android : shortcutShortLabel =" @string/shortcut_connect_title"
8+ android : shortcutLongLabel =" @string/shortcut_connect_desc" >
9+ <intent
10+ android : action =" android.intent.action.VIEW"
11+ android : targetPackage =" com.andrerinas.headunitrevived"
12+ android : targetClass =" com.andrerinas.headunitrevived.main.MainActivity"
13+ android : data =" headunit://connect" />
14+ </shortcut >
15+ <shortcut
16+ android : shortcutId =" disconnect"
17+ android : enabled =" true"
18+ android : icon =" @drawable/ic_exit_to_app_white_24dp"
19+ android : shortcutShortLabel =" @string/shortcut_disconnect_title"
20+ android : shortcutLongLabel =" @string/shortcut_disconnect_desc" >
21+ <intent
22+ android : action =" android.intent.action.VIEW"
23+ android : targetPackage =" com.andrerinas.headunitrevived"
24+ android : targetClass =" com.andrerinas.headunitrevived.main.MainActivity"
25+ android : data =" headunit://disconnect" />
26+ </shortcut >
27+ </shortcuts >
You can’t perform that action at this time.
0 commit comments