Loading src/com/android/packageinstaller/role/model/AssistantRoleBehavior.java +12 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.provider.Settings; import android.service.voice.VoiceInteractionService; import android.util.ArraySet; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import androidx.annotation.NonNull; Loading @@ -49,6 +50,8 @@ import java.util.Set; */ public class AssistantRoleBehavior implements RoleBehavior { private static final String LOG_TAG = AssistantRoleBehavior.class.getSimpleName(); private static final Intent ASSIST_SERVICE_PROBE = new Intent(VoiceInteractionService.SERVICE_INTERFACE); private static final Intent ASSIST_ACTIVITY_PROBE = new Intent(Intent.ACTION_ASSIST); Loading Loading @@ -131,8 +134,16 @@ public class AssistantRoleBehavior implements RoleBehavior { } Intent pkgActivityProbe = new Intent(ASSIST_ACTIVITY_PROBE).setPackage(packageName); return !pm.queryIntentActivities(pkgActivityProbe, boolean hasAssistantActivity = !pm.queryIntentActivities(pkgActivityProbe, PackageManager.MATCH_DEFAULT_ONLY).isEmpty(); if (!hasAssistantActivity) { Log.w(LOG_TAG, "Package " + packageName + " not qualified for " + role.getName() + " due to " + (services.isEmpty() ? "missing service" : "service without qualifying metadata") + " and missing activity"); } return hasAssistantActivity; } private boolean isAssistantVoiceInteractionService(@NonNull PackageManager pm, Loading src/com/android/packageinstaller/role/model/ExclusiveDefaultHolderMixin.java +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ public class ExclusiveDefaultHolderMixin { } if (!role.isPackageQualified(packageName, context)) { Log.w(LOG_TAG, "Default holder does not qualify for the role, config: " + resourceName + ", package: " + packageName); return null; } return packageName; Loading Loading
src/com/android/packageinstaller/role/model/AssistantRoleBehavior.java +12 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.provider.Settings; import android.service.voice.VoiceInteractionService; import android.util.ArraySet; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import androidx.annotation.NonNull; Loading @@ -49,6 +50,8 @@ import java.util.Set; */ public class AssistantRoleBehavior implements RoleBehavior { private static final String LOG_TAG = AssistantRoleBehavior.class.getSimpleName(); private static final Intent ASSIST_SERVICE_PROBE = new Intent(VoiceInteractionService.SERVICE_INTERFACE); private static final Intent ASSIST_ACTIVITY_PROBE = new Intent(Intent.ACTION_ASSIST); Loading Loading @@ -131,8 +134,16 @@ public class AssistantRoleBehavior implements RoleBehavior { } Intent pkgActivityProbe = new Intent(ASSIST_ACTIVITY_PROBE).setPackage(packageName); return !pm.queryIntentActivities(pkgActivityProbe, boolean hasAssistantActivity = !pm.queryIntentActivities(pkgActivityProbe, PackageManager.MATCH_DEFAULT_ONLY).isEmpty(); if (!hasAssistantActivity) { Log.w(LOG_TAG, "Package " + packageName + " not qualified for " + role.getName() + " due to " + (services.isEmpty() ? "missing service" : "service without qualifying metadata") + " and missing activity"); } return hasAssistantActivity; } private boolean isAssistantVoiceInteractionService(@NonNull PackageManager pm, Loading
src/com/android/packageinstaller/role/model/ExclusiveDefaultHolderMixin.java +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ public class ExclusiveDefaultHolderMixin { } if (!role.isPackageQualified(packageName, context)) { Log.w(LOG_TAG, "Default holder does not qualify for the role, config: " + resourceName + ", package: " + packageName); return null; } return packageName; Loading