@Test @SuppressLint("HardwareIds") public void testNullDeviceIdKit() {
final CondomContext condom = CondomContext.wrap(new ContextWrapper(context), "NullDeviceId",
new CondomOptions().addKit(new NullDeviceIdKit()));
final TelephonyManager tm = (TelephonyManager) condom.getSystemService(Context.TELEPHONY_SERVICE);
assertTrue(condom.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE).getClass().getName().startsWith(NullDeviceIdKit.class.getName()));
assertPermission(condom, READ_PHONE_STATE, true);
assertNull(tm.getDeviceId());
if (SDK_INT >= M) assertNull(tm.getDeviceId(0));
assertNull(tm.getImei());
assertNull(tm.getImei(0));
if (SDK_INT >= O) assertNull(tm.getMeid());
if (SDK_INT >= O) assertNull(tm.getMeid(0));
assertNull(tm.getSimSerialNumber());
assertNull(tm.getLine1Number());
assertNull(tm.getSubscriberId());
}
CondomKitTest.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:MiPushFramework
作者:
评论列表
文章目录