源码位置:frameworks/base/core/java/android/os/ServiceManagerNative.java

继承关系

public abstract class ServiceManagerNative extends Binder implements IServiceManager

方法

  • asInterface
    30     /**
    31      * Cast a Binder object into a service manager interface, generating
    32      * a proxy if needed.
    33      */
    34     @UnsupportedAppUsage
    35     static public IServiceManager asInterface(IBinder obj)
    36     {
    37         if (obj == null) {
    38             return null;
    39         }
    40         IServiceManager in =
    41             (IServiceManager)obj.queryLocalInterface(descriptor);
    42         if (in != null) {
    43             return in;
    44         }
    45 
    46         return new ServiceManagerProxy(obj);
    47     }

0 条评论

发表回复

您的电子邮箱地址不会被公开。