當前位置: 首頁>>代碼示例>>Java>>正文


Java Parcel.writeStrongBinder方法代碼示例

本文整理匯總了Java中android.os.Parcel.writeStrongBinder方法的典型用法代碼示例。如果您正苦於以下問題:Java Parcel.writeStrongBinder方法的具體用法?Java Parcel.writeStrongBinder怎麽用?Java Parcel.writeStrongBinder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Parcel的用法示例。


在下文中一共展示了Parcel.writeStrongBinder方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: managedSelf

import android.os.Parcel; //導入方法依賴的package包/類
private void managedSelf(String packageName) {
	
	log("managedSelf package name = " + packageName);
	
	Parcel data = Parcel.obtain();
	data.writeString(packageName);
	data.writeStrongBinder(this);
	
	Parcel reply = Parcel.obtain();
	
	try {
		mRemoteServiceManager.transact(ServiceContext.MANAGED_CLIENT_SIVMGR, data, reply, 0);
	} catch (RemoteException e) {
		e.printStackTrace();
		log("managedSelf exception");
	}finally {
		data.recycle();
		reply.recycle();
	}
	
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:22,代碼來源:ServiceManagerImpl.java

示例2: updateVisuals

import android.os.Parcel; //導入方法依賴的package包/類
public boolean updateVisuals(ICustomTabsCallback callback, Bundle bundle) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    boolean _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        if (bundle != null) {
            _data.writeInt(1);
            bundle.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(6, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:26,代碼來源:ICustomTabsService.java

示例3: executeService

import android.os.Parcel; //導入方法依賴的package包/類
private void executeService(int jobId) {
    Intent intent = new Intent(GcmJobService.ACTION_EXECUTE);
    intent.putExtra(GcmIntentParser.BUNDLE_KEY_TAG, String.valueOf(jobId));
    intent.putExtra(GcmIntentParser.BUNDLE_KEY_EXTRAS, Bundle.EMPTY);
    Parcel parcel = Parcel.obtain();
    try {
        parcel.writeStrongBinder(new Binder());
        parcel.setDataPosition(0);
        intent.putExtra(GcmIntentParser.BUNDLE_KEY_CALLBACK, new PendingCallback(parcel));
    } finally {
        parcel.recycle();
    }
    service.onStartCommand(intent, 0, 0);
}
 
開發者ID:Doist,項目名稱:JobSchedulerCompat,代碼行數:15,代碼來源:GcmJobServiceTest.java

示例4: unregisterCallback

import android.os.Parcel; //導入方法依賴的package包/類
public final void unregisterCallback(IRemoteServiceCallback iRemoteServiceCallback) throws RemoteException {
    Parcel obtain = Parcel.obtain();
    Parcel obtain2 = Parcel.obtain();
    try {
        obtain.writeInterfaceToken(Stub.DESCRIPTOR);
        obtain.writeStrongBinder(iRemoteServiceCallback != null ? iRemoteServiceCallback.asBinder() : null);
        this.a.transact(4, obtain, obtain2, 0);
        obtain2.readException();
    } finally {
        obtain2.recycle();
        obtain.recycle();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:IAlixPay.java

示例5: mayLaunchUrl

import android.os.Parcel; //導入方法依賴的package包/類
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    boolean _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        if (url != null) {
            _data.writeInt(1);
            url.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        _data.writeTypedList(otherLikelyBundles);
        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:34,代碼來源:ICustomTabsService.java

示例6: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.mType);
    dest.writeByte(this.mOrderedHint ? (byte) 1 : (byte) 0);
    dest.writeByte(this.mInitialStickyHint ? (byte) 1 : (byte) 0);
    dest.writeStrongBinder(this.mToken);
    dest.writeInt(this.mSendingUser);
    dest.writeInt(this.mFlags);
    dest.writeInt(this.mResultCode);
    dest.writeString(this.mResultData);
    dest.writeBundle(this.mResultExtras);
    dest.writeByte(this.mAbortBroadcast ? (byte) 1 : (byte) 0);
    dest.writeByte(this.mFinished ? (byte) 1 : (byte) 0);
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:15,代碼來源:PendingResultData.java

示例7: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    info.writeToParcel(dest, 0);
    if (provider != null) {
        dest.writeStrongBinder(provider.asBinder());
    } else {
        dest.writeStrongBinder(null);
    }
    dest.writeStrongBinder(connection);
    dest.writeInt(noReleaseNeeded ? 1:0);
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:12,代碼來源:IActivityManager.java

示例8: registerDeviceCallback

import android.os.Parcel; //導入方法依賴的package包/類
public void registerDeviceCallback(String deviceId, DeviceCallback callback, int events) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(deviceId);
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        _data.writeInt(events);
        this.mRemote.transact(5, _data, _reply, 0);
        ExceptionUtils.readExceptionFromParcel(_reply);
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:16,代碼來源:RemoteDeviceManager.java

示例9: registerCallbackListener

import android.os.Parcel; //導入方法依賴的package包/類
public void registerCallbackListener(IMediaControllerCallback cb) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeStrongBinder(cb != null ? cb.asBinder() : null);
        this.mRemote.transact(3, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:IMediaSession.java

示例10: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
public void writeToParcel(Parcel dest, int flags) {
    if (VERSION.SDK_INT >= 21) {
        dest.writeParcelable((Parcelable) this.mInner, flags);
    } else {
        dest.writeStrongBinder((IBinder) this.mInner);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:8,代碼來源:MediaSessionCompat.java

示例11: readPendingIntent

import android.os.Parcel; //導入方法依賴的package包/類
public static PendingIntent readPendingIntent(IBinder binder) {
    Parcel parcel = Parcel.obtain();
    parcel.writeStrongBinder(binder);
    parcel.setDataPosition(0);
    try {
        return PendingIntent.readPendingIntentOrNullFromParcel(parcel);
    } finally {
        parcel.recycle();
    }
}
 
開發者ID:codehz,項目名稱:container,代碼行數:11,代碼來源:PendingIntentData.java

示例12: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
public void writeToParcel(Parcel out, int flags) {
    synchronized (this) {
        if (this.mReceiver == null) {
            this.mReceiver = new MyResultReceiver();
        }
        out.writeStrongBinder(this.mReceiver.asBinder());
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:ResultReceiver.java

示例13: unregisterCallbackListener

import android.os.Parcel; //導入方法依賴的package包/類
public void unregisterCallbackListener(IMediaControllerCallback cb) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeStrongBinder(cb != null ? cb.asBinder() : null);
        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:14,代碼來源:IMediaSession.java

示例14: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeStrongBinder(mBinder);
}
 
開發者ID:devyok,項目名稱:IPCServiceManager,代碼行數:5,代碼來源:BinderParcel.java


注:本文中的android.os.Parcel.writeStrongBinder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。