源码位置:frameworks/base/core/java/android/os/Binder.java
方法
- allowBlocking
198 /** 199 * Allow blocking calls on the given interface, overriding the requested 200 * value of {@link #setWarnOnBlocking(boolean)}. 201 * <p> 202 * This should only be rarely called when you are <em>absolutely sure</em> 203 * the remote interface is a built-in system component that can never be 204 * upgraded. In particular, this <em>must never</em> be called for 205 * interfaces hosted by package that could be upgraded or replaced, 206 * otherwise you risk system instability if that remote interface wedges. 207 * 208 * @hide 209 */ 210 public static IBinder allowBlocking(IBinder binder) { 211 try { 212 if (binder instanceof BinderProxy) { 213 ((BinderProxy) binder).mWarnOnBlocking = false; 214 } else if (binder != null && binder.getInterfaceDescriptor() != null 215 && binder.queryLocalInterface(binder.getInterfaceDescriptor()) == null) { 216 Log.w(TAG, "Unable to allow blocking on interface " + binder); 217 } 218 } catch (RemoteException ignored) { 219 } 220 return binder; 221 }
0 条评论