Add new IPC for direct Beam invoke.
Used by BeamShareActivity when Beam is invoked through the share menu. Also made these IPCs one-way as they can run asynchronously. Bug: 15939863 Change-Id: I7d048947c96c697e6b04bbda2ec3fbf28cccc29b
This commit is contained in:
@@ -18,6 +18,7 @@ package android.nfc;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentFilter;
|
||||
import android.nfc.BeamShareData;
|
||||
import android.nfc.NdefMessage;
|
||||
import android.nfc.Tag;
|
||||
import android.nfc.TechListParcel;
|
||||
@@ -47,7 +48,8 @@ interface INfcAdapter
|
||||
void setForegroundDispatch(in PendingIntent intent,
|
||||
in IntentFilter[] filters, in TechListParcel techLists);
|
||||
void setAppCallback(in IAppCallback callback);
|
||||
void invokeBeam();
|
||||
oneway void invokeBeam();
|
||||
oneway void invokeBeamInternal(in BeamShareData shareData);
|
||||
|
||||
void dispatch(in Tag tag);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.content.IntentFilter;
|
||||
import android.content.pm.IPackageManager;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.nfc.BeamShareData;
|
||||
import android.nfc.tech.MifareClassic;
|
||||
import android.nfc.tech.Ndef;
|
||||
import android.nfc.tech.NfcA;
|
||||
@@ -1273,6 +1274,21 @@ public final class NfcAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public boolean invokeBeam(BeamShareData shareData) {
|
||||
try {
|
||||
Log.e(TAG, "invokeBeamInternal()");
|
||||
sService.invokeBeamInternal(shareData);
|
||||
return true;
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "invokeBeam: NFC process has died.");
|
||||
attemptDeadServiceRecovery(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable NDEF message push over NFC while this Activity is in the foreground.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user