Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +33 −24 Original line number Diff line number Diff line Loading @@ -562,11 +562,10 @@ public class VoiceInteractionManagerService extends SystemService { } void switchImplementationIfNeededLocked(boolean force) { if (!mCurUserSupported || mTemporarilyDisabled) { if (!mCurUserSupported) { if (DEBUG_USER) { Slog.d(TAG, "switchImplementationIfNeeded(): skipping: force= " + force + "mCurUserSupported=" + mCurUserSupported + "mTemporarilyDisabled=" + mTemporarilyDisabled); + "mCurUserSupported=" + mCurUserSupported); } if (mImpl != null) { mImpl.shutdownLocked(); Loading Loading @@ -1048,13 +1047,16 @@ public class VoiceInteractionManagerService extends SystemService { if (DEBUG) Slog.d(TAG, "setDisabled(): already " + disabled); return; } Slog.i(TAG, "setDisabled(): changing to " + disabled); final long caller = Binder.clearCallingIdentity(); try { mTemporarilyDisabled = disabled; switchImplementationIfNeeded(/* force= */ false); } finally { Binder.restoreCallingIdentity(caller); if (mTemporarilyDisabled) { Slog.i(TAG, "setDisabled(): temporarily disabling and hiding current session"); try { hideCurrentSession(); } catch (RemoteException e) { Log.w(TAG, "Failed to call hideCurrentSession", e); } } else { Slog.i(TAG, "setDisabled(): re-enabling"); } } } Loading Loading @@ -1508,12 +1510,20 @@ public class VoiceInteractionManagerService extends SystemService { public boolean showSessionForActiveService(Bundle args, int sourceFlags, IVoiceInteractionSessionShowCallback showCallback, IBinder activityToken) { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); if (DEBUG_USER) Slog.d(TAG, "showSessionForActiveService()"); synchronized (this) { if (mImpl == null) { Slog.w(TAG, "showSessionForActiveService without running voice interaction" + "service"); return false; } if (mTemporarilyDisabled) { Slog.i(TAG, "showSessionForActiveService(): ignored while temporarily " + "disabled"); return false; } final long caller = Binder.clearCallingIdentity(); try { return mImpl.showSessionLocked(args, Loading @@ -1530,7 +1540,7 @@ public class VoiceInteractionManagerService extends SystemService { @Override public void hideCurrentSession() throws RemoteException { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); synchronized (this) { if (mImpl == null) { return; } Loading @@ -1547,7 +1557,6 @@ public class VoiceInteractionManagerService extends SystemService { Binder.restoreCallingIdentity(caller); } } } @Override public void launchVoiceAssistFromKeyguard() { Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ final class VoiceInteractionManagerServiceShellCommand extends ShellCommand { pw.println(""); pw.println(" hide"); pw.println(" Hides the current session"); pw.println(""); pw.println(" disable [true|false]"); pw.println(" Temporarily disable (when true) service"); pw.println(""); Loading Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +33 −24 Original line number Diff line number Diff line Loading @@ -562,11 +562,10 @@ public class VoiceInteractionManagerService extends SystemService { } void switchImplementationIfNeededLocked(boolean force) { if (!mCurUserSupported || mTemporarilyDisabled) { if (!mCurUserSupported) { if (DEBUG_USER) { Slog.d(TAG, "switchImplementationIfNeeded(): skipping: force= " + force + "mCurUserSupported=" + mCurUserSupported + "mTemporarilyDisabled=" + mTemporarilyDisabled); + "mCurUserSupported=" + mCurUserSupported); } if (mImpl != null) { mImpl.shutdownLocked(); Loading Loading @@ -1048,13 +1047,16 @@ public class VoiceInteractionManagerService extends SystemService { if (DEBUG) Slog.d(TAG, "setDisabled(): already " + disabled); return; } Slog.i(TAG, "setDisabled(): changing to " + disabled); final long caller = Binder.clearCallingIdentity(); try { mTemporarilyDisabled = disabled; switchImplementationIfNeeded(/* force= */ false); } finally { Binder.restoreCallingIdentity(caller); if (mTemporarilyDisabled) { Slog.i(TAG, "setDisabled(): temporarily disabling and hiding current session"); try { hideCurrentSession(); } catch (RemoteException e) { Log.w(TAG, "Failed to call hideCurrentSession", e); } } else { Slog.i(TAG, "setDisabled(): re-enabling"); } } } Loading Loading @@ -1508,12 +1510,20 @@ public class VoiceInteractionManagerService extends SystemService { public boolean showSessionForActiveService(Bundle args, int sourceFlags, IVoiceInteractionSessionShowCallback showCallback, IBinder activityToken) { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); if (DEBUG_USER) Slog.d(TAG, "showSessionForActiveService()"); synchronized (this) { if (mImpl == null) { Slog.w(TAG, "showSessionForActiveService without running voice interaction" + "service"); return false; } if (mTemporarilyDisabled) { Slog.i(TAG, "showSessionForActiveService(): ignored while temporarily " + "disabled"); return false; } final long caller = Binder.clearCallingIdentity(); try { return mImpl.showSessionLocked(args, Loading @@ -1530,7 +1540,7 @@ public class VoiceInteractionManagerService extends SystemService { @Override public void hideCurrentSession() throws RemoteException { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); synchronized (this) { if (mImpl == null) { return; } Loading @@ -1547,7 +1557,6 @@ public class VoiceInteractionManagerService extends SystemService { Binder.restoreCallingIdentity(caller); } } } @Override public void launchVoiceAssistFromKeyguard() { Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ final class VoiceInteractionManagerServiceShellCommand extends ShellCommand { pw.println(""); pw.println(" hide"); pw.println(" Hides the current session"); pw.println(""); pw.println(" disable [true|false]"); pw.println(" Temporarily disable (when true) service"); pw.println(""); Loading