Skip to content

Commit

Permalink
get installed apps names
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay-Kumar-S committed Mar 16, 2021
1 parent 89d3621 commit 998c200
Show file tree
Hide file tree
Showing 38 changed files with 57 additions and 220 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions automotive/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_app_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_app_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat">
<activity android:name=".MainActivity">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions automotive/src/main/java/com/volvo/polestar/AndroidUtil.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.volvo.polestar

import android.annotation.SuppressLint
import android.content.Context
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
import android.util.Log

object AndroidUtil {
const val TAG = "akshay"

@SuppressLint("QueryPermissionsNeeded")
fun getAllInstalledApps(context: Context) {
val pm = context.packageManager
val apps = pm.getInstalledApplications(0)
for (app in apps) {
Log.d(TAG, "getAllInstalledApps:app name: " + app.packageName)
Log.d(TAG, "getAllInstalledApps:system app " + (app.flags and ApplicationInfo.FLAG_SYSTEM != 0))
}
}
}
5 changes: 3 additions & 2 deletions automotive/src/main/java/com/volvo/polestar/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ class MainActivity : AppCompatActivity() {
CarUtil.getCarInfo(car)
Log.e(TAG, "onCreate: ConnectionType")
CarUtil.getCarConnectionType(car)
Log.e(TAG, "onCreate: getCarProperties")*/
CarUtil.getCarProperties(car, vehicleProperties)
Log.e(TAG, "onCreate: getCarProperties")
CarUtil.getCarProperties(car, vehicleProperties)*/
AndroidUtil.getAllInstalledApps(this)
}

private fun initCar() {
Expand Down
17 changes: 11 additions & 6 deletions automotive/src/main/java/com/volvo/polestar/VehicleProperties.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.volvo.polestar

import android.car.Car
import android.car.VehiclePropertyIds
import android.car.hardware.CarPropertyValue
import android.car.hardware.property.CarPropertyManager
Expand All @@ -9,12 +10,16 @@ class VehicleProperties : CarPropertyManager.CarPropertyEventCallback {
private val TAG = "akshay"
override fun onChangeEvent(p0: CarPropertyValue<*>?) {
if (p0 != null) {
if (p0.propertyId == VehiclePropertyIds.GEAR_SELECTION) {
Log.d(TAG, "onChangeEvent:GEAR_SELECTION " + p0.value)
} else if (p0.propertyId == VehiclePropertyIds.PERF_VEHICLE_SPEED) {
Log.d(TAG, "onChangeEvent: speed in mps " + p0.value)
} else if (p0.propertyId == VehiclePropertyIds.IGNITION_STATE) {
Log.d(TAG, "onChangeEvent: IGNITION_STATE " + p0.value)
when (p0.propertyId) {
VehiclePropertyIds.GEAR_SELECTION -> {
Log.d(TAG, "onChangeEvent:GEAR_SELECTION " + p0.value)
}
VehiclePropertyIds.PERF_VEHICLE_SPEED -> {
Log.d(TAG, "onChangeEvent: speed in mps " + p0.value)
}
VehiclePropertyIds.IGNITION_STATE -> {
Log.d(TAG, "onChangeEvent: IGNITION_STATE " + p0.value)
}
}
}
}
Expand Down
30 changes: 0 additions & 30 deletions automotive/src/main/res/drawable-v24/ic_launcher_foreground.xml

This file was deleted.

170 changes: 0 additions & 170 deletions automotive/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

5 changes: 5 additions & 0 deletions automotive/src/main/res/mipmap-anydpi-v26/ic_app_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_app_launcher_background"/>
<foreground android:drawable="@mipmap/ic_app_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_app_launcher_background"/>
<foreground android:drawable="@mipmap/ic_app_launcher_foreground"/>
</adaptive-icon>
5 changes: 0 additions & 5 deletions automotive/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed automotive/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed automotive/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed automotive/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Diff not rendered.
4 changes: 4 additions & 0 deletions automotive/src/main/res/values/ic_app_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_app_launcher_background">#000000</color>
</resources>

0 comments on commit 998c200

Please sign in to comment.