@Test public void testEventLog() throws IOException { readNewEvents(CondomCore.CondomEvent.CONCERN); Object[] data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals(condom.getPackageName(), data[0]); assertEquals(condom.TAG, data[1]); assertEquals("getBaseContext", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("Application.getBaseContext", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("PackageManager.getInstalledApplications", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("PackageManager.getInstalledPackages", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.BIND_PASS); assertEquals(condom.getPackageName(), data[0]); assertEquals("Condom." + TAG, data[1]); data = readLastEvent(CondomCore.CondomEvent.START_PASS); assertEquals(condom.getPackageName(), data[0]); assertEquals("Condom." + TAG, data[1]); final List<ResolveInfo> result = condom.getPackageManager().queryIntentServices(intent.setPackage(null).setComponent(null), 0);
private static Object[] readLastEvent(final CondomCore.CondomEvent type) throws IOException { final List<EventLog.Event> events = readNewEvents(type); assertEquals(1, events.size()); return (Object[]) events.get(0).getData(); }
private static Object[] readLastEvent(final CondomCore.CondomEvent type) throws IOException { final List<EventLog.Event> events = readNewEvents(type); assertEquals(1, events.size()); return (Object[]) events.get(0).getData(); }
@Test public void testEventLog() throws IOException { readNewEvents(CondomCore.CondomEvent.CONCERN); Object[] data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals(condom.getPackageName(), data[0]); assertEquals(condom.TAG, data[1]); assertEquals("getBaseContext", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("Application.getBaseContext", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("PackageManager.getInstalledApplications", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.CONCERN); assertEquals("PackageManager.getInstalledPackages", data[2]); assertCallerMatch(data); data = readLastEvent(CondomCore.CondomEvent.BIND_PASS); assertEquals(condom.getPackageName(), data[0]); assertEquals("Condom." + TAG, data[1]); data = readLastEvent(CondomCore.CondomEvent.START_PASS); assertEquals(condom.getPackageName(), data[0]); assertEquals("Condom." + TAG, data[1]); final List<EventLog.Event> events = readNewEvents(CondomCore.CondomEvent.FILTER_BG_SERVICE);