diff options
| author | 2018-01-17 02:05:20 +0000 | |
|---|---|---|
| committer | 2018-01-17 02:05:20 +0000 | |
| commit | 3442a4922e4ef82f769e93b4d7c8688a49e2357c (patch) | |
| tree | 530dd502d0ead145d662155a298cae750042d0ba | |
| parent | 972bad79243d9ffec1f04ef2b7b73cd8d3312808 (diff) | |
| parent | 01b645072c6a8f18bf0ba677226f5f235280c25d (diff) | |
Merge "Use LocalService to access UserManagerServcie from DragState."
| -rw-r--r-- | services/core/java/com/android/server/wm/DragState.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java index b9f437af20e4..f0fffb95d03c 100644 --- a/services/core/java/com/android/server/wm/DragState.java +++ b/services/core/java/com/android/server/wm/DragState.java @@ -42,6 +42,7 @@ import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.os.IUserManager; +import android.os.UserManagerInternal; import android.util.Slog; import android.view.Display; import android.view.DragEvent; @@ -55,6 +56,7 @@ import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import com.android.internal.view.IDragAndDropPermissions; +import com.android.server.LocalServices; import com.android.server.input.InputApplicationHandle; import com.android.server.input.InputWindowHandle; @@ -318,15 +320,9 @@ class DragState { mSourceUserId = UserHandle.getUserId(mUid); - final IUserManager userManager = - (IUserManager) ServiceManager.getService(Context.USER_SERVICE); - try { - mCrossProfileCopyAllowed = !userManager.getUserRestrictions(mSourceUserId).getBoolean( - UserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE); - } catch (RemoteException e) { - Slog.e(TAG_WM, "Remote Exception calling UserManager: " + e); - mCrossProfileCopyAllowed = false; - } + final UserManagerInternal userManager = LocalServices.getService(UserManagerInternal.class); + mCrossProfileCopyAllowed = !userManager.getUserRestriction( + mSourceUserId, UserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE); if (DEBUG_DRAG) { Slog.d(TAG_WM, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")"); |