Class ShadowBinder


  • @Implements(android.os.Binder.class)
    public class ShadowBinder
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowBinder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static int getCallingPid()  
      protected static int getCallingUid()  
      protected static android.os.UserHandle getCallingUserHandle()  
      static void reset()  
      static void setCallingPid​(int pid)  
      static void setCallingUid​(int uid)  
      static void setCallingUserHandle​(android.os.UserHandle userHandle)
      Configures Binder.getCallingUserHandle() to return the specified UserHandle to subsequent callers on *any* thread, for testing purposes.
      protected boolean transact​(int code, android.os.Parcel data, android.os.Parcel reply, int flags)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowBinder

        public ShadowBinder()
    • Method Detail

      • transact

        @Implementation
        protected boolean transact​(int code,
                                   android.os.Parcel data,
                                   android.os.Parcel reply,
                                   int flags)
                            throws android.os.RemoteException
        Throws:
        android.os.RemoteException
      • getCallingPid

        @Implementation
        protected static final int getCallingPid()
      • getCallingUid

        @Implementation
        protected static final int getCallingUid()
      • getCallingUserHandle

        @Implementation(minSdk=17)
        protected static final android.os.UserHandle getCallingUserHandle()
      • setCallingPid

        public static void setCallingPid​(int pid)
      • setCallingUid

        public static void setCallingUid​(int uid)
      • setCallingUserHandle

        public static void setCallingUserHandle​(android.os.UserHandle userHandle)
        Configures Binder.getCallingUserHandle() to return the specified UserHandle to subsequent callers on *any* thread, for testing purposes.
      • reset

        @Resetter
        public static void reset()