diff options
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
-rw-r--r-- | core/java/android/app/ContextImpl.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 8ef708c..a53f5f7 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -1411,12 +1411,13 @@ class ContextImpl extends Context { public boolean bindService(Intent service, ServiceConnection conn, int flags) { warnIfCallingFromSystemProcess(); - return bindService(service, conn, flags, UserHandle.getUserId(Process.myUid())); + return bindServiceAsUser(service, conn, flags, Process.myUserHandle()); } /** @hide */ @Override - public boolean bindService(Intent service, ServiceConnection conn, int flags, int userHandle) { + public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, + UserHandle user) { IServiceConnection sd; if (conn == null) { throw new IllegalArgumentException("connection is null"); @@ -1438,7 +1439,7 @@ class ContextImpl extends Context { int res = ActivityManagerNative.getDefault().bindService( mMainThread.getApplicationThread(), getActivityToken(), service, service.resolveTypeIfNeeded(getContentResolver()), - sd, flags, userHandle); + sd, flags, user.getIdentifier()); if (res < 0) { throw new SecurityException( "Not allowed to bind to service " + service); |