@@ -9,6 +9,8 @@ import android.graphics.Color
99import android.graphics.drawable.ColorDrawable
1010import android.os.Bundle
1111import android.os.IBinder
12+ import android.view.GestureDetector
13+ import android.view.MotionEvent
1214import android.view.View
1315import android.widget.ImageView
1416import android.widget.TextView
@@ -83,10 +85,6 @@ class MainActivity : PrimaryNavigationActivity() {
8385 outcome.filterValues { ! it }.keys.forEach {
8486 AppLogger .w(TAG , " vehicle permission denied: $it " )
8587 }
86- // An activity holds one permission request at a time; a second launched while this one
87- // is in flight is dropped by the framework. The unstable update check asks for storage
88- // access of its own, so it starts here, once this dialog has been answered.
89- UpdateHook .checkInBackground(this )
9088 }
9189
9290 /* *
@@ -137,6 +135,23 @@ class MainActivity : PrimaryNavigationActivity() {
137135 binding.driftLine.setOnClickListener { forgetPlan() }
138136 binding.aboutAction.text = getString(R .string.about_version_badge, appVersion())
139137 binding.aboutAction.setOnClickListener { showAbout() }
138+ val versionGestures = GestureDetector (this , object : GestureDetector .SimpleOnGestureListener () {
139+ override fun onDown (event : MotionEvent ): Boolean = true
140+
141+ override fun onSingleTapConfirmed (event : MotionEvent ): Boolean {
142+ binding.aboutAction.performClick()
143+ return true
144+ }
145+
146+ override fun onDoubleTap (event : MotionEvent ): Boolean {
147+ UpdateHook .checkInBackground(this @MainActivity)
148+ return true
149+ }
150+ })
151+ binding.aboutAction.setOnTouchListener { _, event ->
152+ versionGestures.onTouchEvent(event)
153+ true
154+ }
140155 renderUnavailable()
141156 requestVehiclePermissions()
142157 if (TripRecordingService .isAutomaticDetectionEnabled(this )) {
@@ -153,12 +168,7 @@ class MainActivity : PrimaryNavigationActivity() {
153168 val missing = VehiclePermissions .missing {
154169 ContextCompat .checkSelfPermission(this , it) == PackageManager .PERMISSION_GRANTED
155170 }
156- // Unstable only, and nothing waits on it: the check runs on its own thread and speaks
157- // only when a newer build is already downloaded. Stable contains no updater. It starts
158- // here when there is no vehicle dialog to collide with, and from that dialog's answer
159- // when there is.
160- if (missing.isEmpty()) UpdateHook .checkInBackground(this )
161- else vehiclePermissions.launch(missing)
171+ if (missing.isNotEmpty()) vehiclePermissions.launch(missing)
162172 }
163173
164174 /* *
@@ -167,10 +177,6 @@ class MainActivity : PrimaryNavigationActivity() {
167177 */
168178 override fun onStart () {
169179 super .onStart()
170- // Unstable only, and a no-op unless the last check gave up without reaching GitHub:
171- // the hook latches itself. This is what makes a head unit whose Wi-Fi arrived after
172- // launch still find the update, without polling for it. Stable contains no updater.
173- UpdateHook .checkInBackground(this )
174180 pack = VehicleSettings .read(this ).pack
175181 loadRecentTrips()
176182 // The consumption fit reads the whole trip history, so it happens once per visit to
0 commit comments