use of com.android.internal.telephony.IWapPushManager in project android_frameworks_base by DirtyUnicorns.
the class WapPushTest method testDeletePackage1.
/**
* Deleting package test
*/
public void testDeletePackage1() {
int originalAppIdValue = mAppIdValue;
int originalContentTypeValue = mContentTypeValue;
// set up data
try {
IWapPushManager iwapman = getInterface();
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mAppIdValue += 10;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mContentTypeValue += 20;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mContentTypeValue += 20;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
} catch (RemoteException e) {
assertTrue(false);
}
mAppIdValue = originalAppIdValue;
mContentTypeValue = originalContentTypeValue;
utDeletePackage();
mAppIdValue += 10;
utDeletePackage();
mContentTypeValue += 20;
utDeletePackage();
mContentTypeValue += 20;
utDeletePackage();
mAppIdValue = originalAppIdValue;
mContentTypeValue = originalContentTypeValue;
}
use of com.android.internal.telephony.IWapPushManager in project android_frameworks_base by AOSPA.
the class WapPushTest method testIntegration2.
/**
* Integration test 2, random mAppIdValue(int), all OMA content type
*/
public void testIntegration2() {
boolean res;
int originalAppIdValue = mAppIdValue;
int originalContentTypeValue = mContentTypeValue;
String originalAppIdName = mAppIdName;
String originalContentTypeName = mContentTypeName;
String originalClassName = mClassName;
byte[] originalMessageBody = mMessageBody;
Random rd = new Random();
IWapPushManager iwapman = getInterface();
IDataVerify dataverify = getVerifyInterface();
mClassName = "com.android.smspush.unitTests.ReceiverActivity";
for (int i = 0; i < OMA_CONTENT_TYPE_NAMES.length; i++) {
mContentTypeName = OMA_CONTENT_TYPE_NAMES[i];
mAppIdValue = rd.nextInt(0x0FFFFFFF);
mMessageBody = new byte[100 + rd.nextInt(100)];
rd.nextBytes(mMessageBody);
byte[] pdu = createPDU(7);
byte[] wappushPdu = retrieveWspBody();
try {
dataverify.resetData();
// set up data
iwapman.addPackage(Integer.toString(mAppIdValue), mContentTypeName, mPackageName, mClassName, WapPushManagerParams.APP_TYPE_ACTIVITY, false, false);
dispatchWapPdu(wappushPdu, iwapman);
// clean up data
iwapman.deletePackage(Integer.toString(mAppIdValue), mContentTypeName, mPackageName, mClassName);
if (mContentTypeName.equals(WspTypeDecoder.CONTENT_TYPE_B_PUSH_CO)) {
assertTrue(dataverify.verifyData(wappushPdu));
} else {
assertTrue(dataverify.verifyData(mMessageBody));
}
} catch (RemoteException e) {
}
}
mClassName = originalClassName;
mAppIdName = originalAppIdName;
mContentTypeName = originalContentTypeName;
mAppIdValue = originalAppIdValue;
mContentTypeValue = originalContentTypeValue;
mMessageBody = originalMessageBody;
}
use of com.android.internal.telephony.IWapPushManager in project android_frameworks_base by AOSPA.
the class WapPushTest method testDeletePackage1.
/**
* Deleting package test
*/
public void testDeletePackage1() {
int originalAppIdValue = mAppIdValue;
int originalContentTypeValue = mContentTypeValue;
// set up data
try {
IWapPushManager iwapman = getInterface();
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mAppIdValue += 10;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mContentTypeValue += 20;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
mContentTypeValue += 20;
iwapman.addPackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, 0, false, false);
} catch (RemoteException e) {
assertTrue(false);
}
mAppIdValue = originalAppIdValue;
mContentTypeValue = originalContentTypeValue;
utDeletePackage();
mAppIdValue += 10;
utDeletePackage();
mContentTypeValue += 20;
utDeletePackage();
mContentTypeValue += 20;
utDeletePackage();
mAppIdValue = originalAppIdValue;
mContentTypeValue = originalContentTypeValue;
}
use of com.android.internal.telephony.IWapPushManager in project android_frameworks_base by AOSPA.
the class WapPushTest method utUpdatePackage.
protected void utUpdatePackage(boolean need_sig, boolean more_proc) {
IWapPushManager iwapman = getInterface();
// insert new data
try {
assertTrue(iwapman.updatePackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, WapPushManagerParams.APP_TYPE_SERVICE, need_sig, more_proc));
} catch (RemoteException e) {
assertTrue(false);
}
// verify the data
WapPushManager wpman = getService();
assertTrue(wpman.verifyData(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName, WapPushManagerParams.APP_TYPE_SERVICE, need_sig, more_proc));
}
use of com.android.internal.telephony.IWapPushManager in project android_frameworks_base by AOSPA.
the class WapPushTest method utDeletePackage.
protected void utDeletePackage() {
IWapPushManager iwapman = getInterface();
try {
assertTrue(iwapman.deletePackage(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName));
} catch (RemoteException e) {
assertTrue(false);
}
// verify the data
WapPushManager wpman = getService();
assertTrue(!wpman.isDataExist(Integer.toString(mAppIdValue), Integer.toString(mContentTypeValue), mPackageName, mClassName));
}
Aggregations