本帖最后由 kris_fei 于 2011-05-18 09:04:08 编辑

解决方案 »

  1.   

    找到问题了。
           sp<ISurfaceComposerClient> conn = sm->createConnection();
    会调用到
           virtual sp<ISurfaceComposerClient> createConnection()
        {
            uint32_t n;
            Parcel data, reply;
            data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
            remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply);
            return interface_cast<ISurfaceComposerClient>(reply.readStrongBinder());
        }
    中间有句
         interface_cast<ISurfaceComposerClient>(reply.readStrongBinder());
        这样就得到了BpSurfaceComposerClient。
        因此conn的值不是BnSurfaceComposerClient类型,而是BpSurfaceComposerClient。