Skip to content

Commit

Permalink
Disabled Legacy views in CarApp build variant for now. Fixed error wh…
Browse files Browse the repository at this point in the history
…en trying to launch the app from the notification in CarApp Build Variant.
  • Loading branch information
Ixam97 committed Aug 12, 2024
1 parent 49746c2 commit 67abd96
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions automotive/src/carapp/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
</activity>

<activity android:name=".ui.activities.PermissionsActivity" android:exported="false" />
<activity android:name=".ui.activities.MainActivity" android:exported="true" />
<!--<activity android:name=".ui.activities.MainActivity" android:exported="true" />-->
<activity android:name=".ui.activities.SettingsActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES"/>
</intent-filter>
</activity>
<activity android:name=".ui.activities.HistoryActivity" android:exported="true" />
<!--<activity android:name=".ui.activities.HistoryActivity" android:exported="true" />-->
<activity android:name=".ui.activities.SettingsMainViewActivity" android:exported="false"/>
<!--<activity android:name=".ui.activities.SettingsVehicleActivity" android:exported="false"/>-->
<activity android:name=".ui.activities.LibsActivity" android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ixam97.carStatsViewer.carApp

import android.car.Car
import android.content.Intent
import android.content.pm.PackageManager
import androidx.annotation.OptIn
Expand All @@ -13,14 +14,18 @@ import com.ixam97.carStatsViewer.BuildConfig
import com.ixam97.carStatsViewer.CarStatsViewer
import com.ixam97.carStatsViewer.carApp.renderer.CarDataSurfaceCallback
import com.ixam97.carStatsViewer.dataCollector.DataCollector
import com.ixam97.carStatsViewer.ui.activities.PermissionsActivity
import com.ixam97.carStatsViewer.utils.throttle
import kotlinx.coroutines.launch

@OptIn(ExperimentalCarApi::class)
class CarStatsViewerSession : Session(), DefaultLifecycleObserver {

val permissions = PermissionsActivity.PERMISSIONS.toList()
val permissions = listOf(
Car.PERMISSION_ENERGY,
Car.PERMISSION_SPEED,
android.Manifest.permission.ACCESS_FINE_LOCATION,
android.Manifest.permission.ACCESS_COARSE_LOCATION
)

lateinit var carDataSurfaceCallback: CarDataSurfaceCallback

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class TabsScreen(
if (BuildConfig.FLAVOR_version == "dev") addTab(createTab(R.string.car_app_dashboard, CID_DASHBOARD, R.drawable.ic_car_app_dashboard))
else addTab(createTab(R.string.car_app_status, CID_STATUS, R.drawable.ic_connected))
addTab(createTab(R.string.settings_title, CID_SETTINGS, R.drawable.ic_car_app_settings))
addTab(createTab(R.string.car_app_menu, CID_MISC, R.drawable.ic_car_app_menu))
if (BuildConfig.FLAVOR_version == "dev") addTab(createTab(R.string.car_app_menu, CID_MISC, R.drawable.ic_car_app_menu))
setTabContents(TabContents.Builder(
when (selectedTabContentID) {
CID_TRIP_DATA -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,15 @@ class AutoStartReceiver: BroadcastReceiver() {
context.getString(R.string.restart_notification_service),
actionServicePendingIntent
).build())
addAction(Notification.Action.Builder(
null,
context.getString(R.string.restart_notification_app),
actionActivityPendingIntent
).build())
if (BuildConfig.FLAVOR_aaos != "carapp") {
addAction(
Notification.Action.Builder(
null,
context.getString(R.string.restart_notification_app),
actionActivityPendingIntent
).build()
)
}
/*
addAction(Notification.Action.Builder(
null,
Expand Down

0 comments on commit 67abd96

Please sign in to comment.