Google is committed to advancing racial equity for Black communities. See how.
Added in API level 29

CarPackageManager

public final class CarPackageManager
extends Object

java.lang.Object
   ↳ android.car.content.pm.CarPackageManager


Provides car specific API related with package management.

Summary

Public methods

boolean isActivityDistractionOptimized(String packageName, String className)

Returns whether an activity is distraction optimized, i.e, allowed in a restricted driving state.

boolean isPendingIntentDistractionOptimized(PendingIntent pendingIntent)

Returns whether the given PendingIntent represents an activity that is distraction optimized, i.e, allowed in a restricted driving state.

boolean isServiceDistractionOptimized(String packageName, String className)

Check if given service is distraction optimized, i.e, allowed in a restricted driving state.

Inherited methods

Public methods

isActivityDistractionOptimized

Added in API level 29
public boolean isActivityDistractionOptimized (String packageName, 
                String className)

Returns whether an activity is distraction optimized, i.e, allowed in a restricted driving state.

Parameters
packageName String: the activity's PackageItemInfo.packageName.

className String: the activity's PackageItemInfo.name.

Returns
boolean true if the activity is distraction optimized, false if it isn't or if the value could not be determined.

isPendingIntentDistractionOptimized

public boolean isPendingIntentDistractionOptimized (PendingIntent pendingIntent)

Returns whether the given PendingIntent represents an activity that is distraction optimized, i.e, allowed in a restricted driving state.

Parameters
pendingIntent PendingIntent: the PendingIntent to check.

Returns
boolean true if the pending intent represents an activity that is distraction optimized, false if it isn't or if the value could not be determined.

isServiceDistractionOptimized

Added in API level 29
public boolean isServiceDistractionOptimized (String packageName, 
                String className)

Check if given service is distraction optimized, i.e, allowed in a restricted driving state.

Returns
boolean