Skip to content

Commit

Permalink
Simply automotive check
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi committed Jun 29, 2023
1 parent 4b1cecb commit 096227a
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.homeassistant.companion.android.launch

import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.util.Log
import androidx.activity.compose.setContent
Expand Down Expand Up @@ -84,12 +83,7 @@ class LaunchActivity : AppCompatActivity(), LaunchView {
override fun displayWebview() {
presenter.setSessionExpireMillis(0)

val isAutomotive = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
this.packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
} else {
false
}
if (isAutomotive && BuildConfig.FLAVOR == "full") {
if (packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) && BuildConfig.FLAVOR == "full") {
val carIntent = Intent(
this,
Class.forName("androidx.car.app.activity.CarAppActivity")
Expand Down

0 comments on commit 096227a

Please sign in to comment.