WakeLock(int flags, String tag) { mFlags = flags; mTag = tag; mToken = new Binder(); }
Binder tmpBinder = new Binder(); tmpBinder.attachInterface(null, "fake"); serviceManagerObject = tempInterfaceMethod.invoke(null, tmpBinder);
"asInterface", IBinder.class); Binder tmpBinder = new Binder(); tmpBinder.attachInterface(null, "fake");
/** * Construct a new Binder, starting from a given MethodType. * * @param start the starting MethodType, for calls entering the eventual chain * @return the Binder object */ public static Binder from(MethodType start) { return new Binder(start); }
/** * Construct a new Binder, starting from a given MethodType. * * @param lookup the Lookup context to use for direct handles * @param start the starting MethodType, for calls entering the eventual chain * @return the Binder object */ public static Binder from(MethodHandles.Lookup lookup, MethodType start) { return new Binder(lookup, start); }
/** * Construct a new Binder, starting from a given invokebinder. * * @param start the starting invokebinder; the new one will start with the current endpoint type * of the given invokebinder * @return the Binder object */ public static Binder from(Binder start) { return new Binder(start); }
/** * Insert at the given index the given float value. * * @param index the index at which to insert the argument value * @param value the value to insert * @return a new Binder */ public Binder insert(int index, float value) { return new Binder(this, new Insert(index, value)); }
/** * Insert at the given index the given argument value(s). * * @param index the index at which to insert the argument value * @param values the value(s) to insert * @return a new Binder */ public Binder insert(int index, Object... values) { return new Binder(this, new Insert(index, values)); }
/** * Insert at the given index the given argument value(s). * * @param index the index at which to insert the argument value * @param types the actual types to use, rather than getClass * @param values the value(s) to insert * @return a new Binder */ public Binder insert(int index, Class<?>[] types, Object... values) { return new Binder(this, new Insert(index, types, values)); }
/** * Prepend to the argument list the given byte value. * * @param value the value to prepend * @return a new Binder */ public Binder prepend(byte value) { return new Binder(this, new Insert(0, value)); }
/** * Catch the given exception type from the downstream chain and handle it with the * given function. * * @param throwable the exception type to catch * @param function the function to use for handling the exception * @return a new Binder */ public Binder catchException(Class<? extends Throwable> throwable, MethodHandle function) { return new Binder(this, new Catch(throwable, function)); }
/** * Prepend to the argument list the given float value. * * @param value the value to prepend * @return a new Binder */ public Binder prepend(float value) { return new Binder(this, new Insert(0, value)); }
/** * Cast the incoming arguments to the given MethodType. The casts * applied are equivalent to those in MethodHandle.explicitCastArguments(MethodType). * * @param returnType the target return type * @param firstType the first argument type, usually a target type * @param restTypes the remaining target argument types * @return a new Binder */ public Binder castVirtual(Class<?> returnType, Class<?> firstType, Class<?>... restTypes) { return new Binder(this, new Cast(type()), MethodType.methodType(returnType, firstType, restTypes)); }
/** * Convert the incoming arguments to the given MethodType. The conversions * applied are equivalent to those in MethodHandle.asType(MethodType). * * @param target the target MethodType * @return a new Binder */ public Binder convert(MethodType target) { return new Binder(this, new Convert(type()), target); }
/** * Box a range of incoming arguments into the given array type. * * @param index the index from which to start boxing args * @param count the count of arguments to box * @param type the array type into which the args will be boxed * @return a new Binder */ public Binder collect(int index, int count, Class<?> type) { return new Binder(this, new Collect(type(), index, count, type)); }
/** * Box all incoming arguments from the given position onward into the given array type. * * @param index the index from which to start boxing args * @param type the array type into which the args will be boxed * @return a new Binder */ public Binder collect(int index, Class<?> type) { return new Binder(this, new Collect(type(), index, type)); }
/** * Append to the argument list the given short value. * * @param value the value to append * @return a new Binder */ public Binder append(short value) { return new Binder(this, new Insert(type().parameterCount(), value)); }
/** * Append to the argument list the given float value. * * @param value the value to append * @return a new Binder */ public Binder append(float value) { return new Binder(this, new Insert(type().parameterCount(), value)); }
/** * Append to the argument list the given double value. * * @param value the value to append * @return a new Binder */ public Binder append(double value) { return new Binder(this, new Insert(type().parameterCount(), value)); }
/** * Append to the argument list the given argument value with the specified type. * * @param type the actual type to use, rather than getClass * @param value the value to append * @return a new Binder */ public Binder append(Class<?> type, Object value) { return new Binder(this, new Insert(type().parameterCount(), new Class[]{type}, value)); }