Merge "Minor improvements on voice interaction workflows." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7aa28bd502
@@ -3554,11 +3554,13 @@ public final class ActivityThread extends ClientTransactionHandler {
|
||||
@NonNull RemoteCallback callback) {
|
||||
final ActivityClientRecord r = mActivities.get(activityToken);
|
||||
if (r == null) {
|
||||
Log.w(TAG, "requestDirectActions(): no activity for " + activityToken);
|
||||
callback.sendResult(null);
|
||||
return;
|
||||
}
|
||||
final int lifecycleState = r.getLifecycleState();
|
||||
if (lifecycleState < ON_START || lifecycleState >= ON_STOP) {
|
||||
Log.w(TAG, "requestDirectActions(" + r + "): wrong lifecycle: " + lifecycleState);
|
||||
callback.sendResult(null);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1452,7 +1452,13 @@ public class AudioService extends IAudioService.Stub
|
||||
Settings.Secure.ASSISTANT, UserHandle.USER_CURRENT);
|
||||
}
|
||||
if (!TextUtils.isEmpty(assistantName)) {
|
||||
packageName = ComponentName.unflattenFromString(assistantName).getPackageName();
|
||||
ComponentName componentName = ComponentName.unflattenFromString(assistantName);
|
||||
if (componentName == null) {
|
||||
Slog.w(TAG, "Invalid service name for "
|
||||
+ Settings.Secure.VOICE_INTERACTION_SERVICE + ": " + assistantName);
|
||||
return;
|
||||
}
|
||||
packageName = componentName.getPackageName();
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(packageName)) {
|
||||
|
||||
Reference in New Issue
Block a user