Merge "Give AccessibilityServices System Capabilities." into rvc-dev
This commit is contained in:
@@ -94,8 +94,10 @@ class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnect
|
|||||||
if (userState == null) return;
|
if (userState == null) return;
|
||||||
final long identity = Binder.clearCallingIdentity();
|
final long identity = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
int flags = Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE
|
int flags = Context.BIND_AUTO_CREATE
|
||||||
| Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS;
|
| Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE
|
||||||
|
| Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
|
||||||
|
| Context.BIND_INCLUDE_CAPABILITIES;
|
||||||
if (userState.getBindInstantServiceAllowedLocked()) {
|
if (userState.getBindInstantServiceAllowedLocked()) {
|
||||||
flags |= Context.BIND_ALLOW_INSTANT;
|
flags |= Context.BIND_ALLOW_INSTANT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,8 +129,11 @@ public class AccessibilityServiceConnectionTest {
|
|||||||
public void bind_requestsContextToBindService() {
|
public void bind_requestsContextToBindService() {
|
||||||
mConnection.bindLocked();
|
mConnection.bindLocked();
|
||||||
verify(mMockContext).bindServiceAsUser(any(Intent.class), eq(mConnection),
|
verify(mMockContext).bindServiceAsUser(any(Intent.class), eq(mConnection),
|
||||||
eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE
|
eq(Context.BIND_AUTO_CREATE
|
||||||
| Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), any(UserHandle.class));
|
| Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE
|
||||||
|
| Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
|
||||||
|
| Context.BIND_INCLUDE_CAPABILITIES),
|
||||||
|
any(UserHandle.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user