Make sure mRecognitionRequested is reset when a failure
condition disables all recognitions: A stale value would
prevent from registering call and power state listeners
and properly update the states.
Also:
- In isRecognitionAllowed(), read current call and power
states directly from services if listeners are not registered.
- Also add missing null checks on mModule at various places.
Bug: 139268184
Test: repro steps in the bug
Change-Id: I763130b4d491a1a6a9e0756c7a18943e406ce73e
The legacy settings for them can actually remain null and it was
handled specially to use the system default instead. If the legacy
role holders aren't resolved correctly, role implementation will do a
fallback grant which overrides permission state, whereas if they are
resolved correctly the normal fix up won't do an override.
Fixes: 139752137
Test: manual
Change-Id: I5cc301c3b7b459bdfaece0117bcacd984d1cb78f
When voice interactor is being used, it should run as the top app to
handle processing as quickly as possible. This is similar to what IME
does when IME is shown.
Bug 139756725
Test: invoke assistant, confirm :interactor becomes top-app and then
goes back to foreground after use.
Change-Id: Id13b47dcb4de6658eede13a650e6ef631f649f4f
When stopping a recognition, do not unregister power save mode
listener if no recognition is active any more but only if no recognition
is requested. Otherwise recognitions suspended due to power save mode will
never resume.
Bug: 136978230
Test: Activate power save mode, plug USB and verify OK G works.
Change-Id: I426e11447fcde5c578ae2f64aa1fe18ef00fba0f
This reverts commit f105c93c4aa6d1cbebe94c5c8d7d6297258f6fc9.
Reason for revert: b/132974796#23 the offloaded thread will be holding a lock for a noticeable period of time and cause contention.
Bug: 132974796
Change-Id: Ic81a2e3ee7226266c8f97b606fc1a2834240f689
This limitation is being added to increase privacy protection.
Bug: 70619678
Bug: 117213117
Test: built android
Change-Id: Ic6ceed60a9687204fc7bf440becaa344a42d8e74
Make the get actions API async. Also fix a potenrial
memory leak when exchaning callbacks.
Test: atest CtsVoiceInteractionTestCases
bug:129705716
Change-Id: I91f1beb3dc7a395c6c6307ca4601fe7b7097f6e3
DirectActions are abstract actions defined by an Activtiy. The
actual definition of these actions will be available through
the support lib.
This API provides a secure channel for system or assistant to
interact with a running app using these Actions.
Test: atest CtsVoiceInteractionTestCases
Test: added android.voiceinteraction.cts.DirectActionsTest
Bug: 129705716
Change-Id: I0ce568e0d8f41e0fe46306052016a74c7b394efa
Wallpapers and Input Methods are bound by the system
and are only brought up to BFGS, which is insufficient
for getting foreground location. Add the required
flag to the bindService call to allow the bound process
to reach FGSL when visible.
Same for VoiceInteractionServices
Bug: 117494189
Test: Manually enable a wallpaper that needs location and
verify it gets location.
atest CtsAppTestCases:ActivityManagerProcessStateTest
Change-Id: I6767e1f480e5b3d6e33864dabd9cb167df4846f5
- Trigger the role changed callback manually when initializing the
voice interaction manager in case the role handler changed prior to
registering the listener. In addition, ensure that we query for all
packages regardless of current locked state.
Bug: 130126913
Test: Wipe device, restart and ensure that the assistant setting is set
(adb shell setting get secure assistant)
Change-Id: I170189d9fd5177108c62c486e93b35a3a32af48c
Updated logic to allow HotWord detection while phone is ringing (still
not off-hook).
Test: Manual Testing
Bug: 124762676
Change-Id: Idce6d39a5589aee6d5baa4e5bcd8d98b3e13b239
and the mechanism to use it
Since both starts and bindings might be contributing to the service
being whitelisted, track the state in ServiceRecord and update
the parent process accordingly when changes happen.
While we're at it, add that flag for bindings to accessibility
services, voice interaction services and QSTiles.
Also, make the timeout constant configurable for start-based
whitelisting.
Bug: 124298522
Bug: 123495976 (accessibility services)
Bug: 123337181 (paying via NFC, like Google Pay)
Bug: 122887611 (binding to InCallService)
Bug: 127774234 (binding to QSTile)
Bug: 124288681 (binding to voice interaction services)
Test: atest WmTests:ActivityStarterTests
Test: atest AccessibilityServiceConnectionTest
Test: manual with:
1) notifications from calendar and dynamite to test service starts
whitelisting
2) enabling talkback and livetranscribe to test service bindings
whitelisting
3) adding the LastPass QSTile and clicking on it
Change-Id: I8b6f23f999683920411ca40ab5b25c688a4f7055
Continuation of ag/6226654; edits made per Svetoslav's last comments.
Bug: 122740752
Bug: 123080754
Test: blueline-userdebug build completes successfully.
Change-Id: I3e43137eb6e0d8cae77e14d331150d5a05ede07c
- Extract current code for checking caller into a private method
- Replace occurrences of that code with a call to the private method
- Add method call to setTranscription/clearTranscription/setVoiceState
Test: Verified Milford can't call setTranscription/clearTranscription
when it is no longer the active service.
Bug: b/123412646
Change-Id: I2c428c6c65b62f6a83264286df4f44fb5d1c249e
events.
This change should have been part of ag/5933708
Test: manual test with NowPlaying app on p19 device
Change-Id: I42ed7c17ebdd2cb75055122b8d45302e28c510b6
- Register a role observer in VoiceInteractionManagerService. Once the
role is changes map the new role setting onto the old settings.
- As the assistant role is now always set, there is no need to have code
in AssistUtil for the case the assistant setting is not set
- Remove old config option for the default assistant. The default
assistant is not configured via the roles config
Bug: 110557011
Test: - Set, unset and swtiched assistant via the settings UI
- for voice interaction service
- for assist activity
- Booted from freshly wiped device and saw assitant to be set to
default
Change-Id: I8596f49c6f6496e8b70cf3236aaa7d7557443a93
Voice state as well as voice transcription can be provided by the
VoiceInteractionService. These get proxied to the AssistManager which
can update the system UI to reflect the state & transcription.
Test: TBD
Bug: 122740752
Bug: 123080754
Change-Id: I79cac1d89fe0123bf25a05d551cb4ef40ae1368e
The top-level framework overlay already says this should (by default) be
skipped if the device is low-ram (leaving the device able to turn it
back on again without committing to a specific voice recognizer at build
time):
<feature name="android.software.voice_recognizers" notLowRam="true" />
The form factor-specific overlay for tablets does override this back to
a state where the feature is always enabled regardless of low-ram:
<feature name="android.software.voice_recognizers" />
But this is probably a mistake as the code before this change ignored
the feature flag anyway in case of a low-ram device, using a hardcoded
check.
Lets Android TVs have voice recognisers working on all devices by
default without needing to set katniss' package as a force override.
Bug: 117630721
Test: flashall ; adb logcat | grep VoiceInteractionService
Change-Id: I7816bebbc363ae0751b097fe1b6cdc2a646b20e0
as regular recogntion events
The application will differentiate between DSP and app triggered
regcognition events.
Test: manual test with STTA and NowPlaying app on p19
Bug: 119386757
Change-Id: I4a3eb4da6ee6be35084fec8aaa3c495423d74033
If you have a legacy assist app (launched through ACTION_ASSIST, not
implementing a VoiceInteractionService) then we kept the Google app
as the current speech recognizer. Thus if you force stopped the
Google app, we saw that as one of the active parts of the interactor
or recognizer and reset all of the state.
Now we handle the "only recognizer" case separately, only resettting
the recognizer state in that case.
Bug: 121104681
Test: manual
Change-Id: Icc007bdf2352548d58be997fae77d9e5aba842f3
This reverts commit 81f71f1c27b7e877babe1f3293ac00256a66980c.
Reason for revert: rolling forward with fix
Change-Id: Ifc0c53581ac567cb968d91993f453220f8253aec
Add @GuardedBy for simple functions that require locks and have a name in
one of the frameworks naming styles for locks ("^.*(Locked|LPw|LPr|L[a-zA-Z]|UL|AL|NL)$").
Derived by errorprone.
Bug: 73000847
Test: m
Change-Id: If70bb03313388af34d547efca20fb5115de95bf1
Allows for other services like window manager to call uri grants without
holding AM service lock.
Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie5b4ddb19a2cedff09332dbeb56bcd9292fd18ac