public final void close() throws IOException { try { super.close(); long l4; long l5; long l6; Object[] arrayOfObject2; return; } finally { long l1 = SystemClock.elapsedRealtime() - NetworkStatsEntity.this.mProcessingStartTime; long l2 = TrafficStats.getUidTxBytes(NetworkStatsEntity.this.mUid); long l3 = TrafficStats.getUidRxBytes(NetworkStatsEntity.this.mUid); Object[] arrayOfObject1 = new Object[5]; arrayOfObject1[0] = NetworkStatsEntity.this.mUa; arrayOfObject1[1] = Long.valueOf(NetworkStatsEntity.this.mResponseLatency); arrayOfObject1[2] = Long.valueOf(l1); arrayOfObject1[3] = Long.valueOf(l2 - NetworkStatsEntity.this.mStartTx); arrayOfObject1[4] = Long.valueOf(l3 - NetworkStatsEntity.this.mStartRx); EventLog.writeEvent(52001, arrayOfObject1); } }
final void handleLowMemory() { ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(true, null); final int N = callbacks.size(); for (int i=0; i<N; i++) { callbacks.get(i).onLowMemory(); } // Ask SQLite to free up as much memory as it can, mostly from its page caches. if (Process.myUid() != Process.SYSTEM_UID) { int sqliteReleased = SQLiteDatabase.releaseMemory(); EventLog.writeEvent(SQLITE_MEM_RELEASED_EVENT_LOG_TAG, sqliteReleased); } // Ask graphics to free up as much as possible (font/image caches) Canvas.freeCaches(); // Ask text layout engine to free also as much as possible Canvas.freeTextLayoutCaches(); BinderInternal.forceGc("mem"); }
@SuppressLint("NewApi") public MenuDialogHelper show(View originalView, IBinder token) { if (mListener == null) { throw new IllegalStateException( "Cannot show context menu without reference on ContextMenuListener"); } mContextMenuInfo = getContextMenuInfo(originalView); mListener.onCreateContextMenu(this, originalView, mContextMenuInfo); if (getVisibleItems().size() > 0) { if (VERSION.SDK_INT >= 8) { EventLog.writeEvent(50001, 1); } MenuDialogHelper helper = new MenuDialogHelper(this); helper.show(token); return helper; } return null; }
private void log(final String tag, final CondomEvent event, final String... args) { final Object[] event_args = new Object[2 + args.length]; event_args[0] = mBase.getPackageName(); event_args[1] = tag; // Package name and tag are shared parameters for all events. System.arraycopy(args, 0, event_args, 2, args.length); EventLog.writeEvent(EVENT_TAG + event.ordinal(), event_args); if (DEBUG) Log.d(asLogTag(tag), event.name() + " " + Arrays.toString(args)); }
private static List<EventLog.Event> readNewEvents(final CondomCore.CondomEvent type) throws IOException { final List<EventLog.Event> events = new ArrayList<>(); EventLog.readEvents(new int[] { EVENT_TAG_MARK, "Condom".hashCode() + type.ordinal() }, events); if (events.isEmpty()) return Collections.emptyList(); for (int i = events.size() - 1; i >= 0; i --) { final EventLog.Event event = events.get(i); if (event.getTag() == EVENT_TAG_MARK) { EventLog.writeEvent(EVENT_TAG_MARK); return events.subList(i + 1, events.size()); } } EventLog.writeEvent(EVENT_TAG_MARK); return events; }
public final ActivityClientRecord performResumeActivity(IBinder token, boolean clearHide) { ActivityClientRecord r = mActivities.get(token); if (localLOGV) Slog.v(TAG, "Performing resume of " + r + " finished=" + r.activity.mFinished); if (r != null && !r.activity.mFinished) { if (clearHide) { r.hideForNow = false; r.activity.mStartedActivity = false; } try { r.activity.mFragments.noteStateNotSaved(); if (r.pendingIntents != null) { deliverNewIntents(r, r.pendingIntents); r.pendingIntents = null; } if (r.pendingResults != null) { deliverResults(r, r.pendingResults); r.pendingResults = null; } r.activity.performResume(); EventLog.writeEvent(LOG_ON_RESUME_CALLED, UserHandle.myUserId(), r.activity.getComponentName().getClassName()); r.paused = false; r.stopped = false; r.state = null; } catch (Exception e) { if (!mInstrumentation.onException(r.activity, e)) { throw new RuntimeException( "Unable to resume activity " + r.intent.getComponent().toShortString() + ": " + e.toString(), e); } } } return r; }
/** * Default implementation of * {@link android.view.Window.Callback#onMenuItemSelected} * for activities. This calls through to the new * {@link #onOptionsItemSelected} method for the * {@link android.view.Window#FEATURE_OPTIONS_PANEL} * panel, so that subclasses of * Activity don't need to deal with feature codes. */ public boolean onMenuItemSelected(int featureId, MenuItem item) { CharSequence titleCondensed = item.getTitleCondensed(); switch (featureId) { case Window.FEATURE_OPTIONS_PANEL: // Put event logging here so it gets called even if subclass // doesn't call through to superclass's implmeentation of each // of these methods below if(titleCondensed != null) { EventLog.writeEvent(50000, 0, titleCondensed.toString()); } if (onOptionsItemSelected(item)) { return true; } if (mFragments.dispatchOptionsItemSelected(item)) { return true; } if (item.getItemId() == android.R.id.home && mActionBar != null && (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) { if (mParent == null) { return onNavigateUp(); } else { return mParent.onNavigateUpFromChild(this); } } return false; case Window.FEATURE_CONTEXT_MENU: if(titleCondensed != null) { EventLog.writeEvent(50000, 1, titleCondensed.toString()); } if (onContextItemSelected(item)) { return true; } return mFragments.dispatchContextItemSelected(item); default: return false; } }
void logConcern(final String tag, final String label) { EventLog.writeEvent(EVENT_TAG + CondomEvent.CONCERN.ordinal(), mBase.getPackageName(), tag, label, getCaller()); if (DEBUG) Log.w(asLogTag(tag), label + " is invoked", new Throwable()); }
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(); }
/** * Sends a corruption message to the database error handler. */ void onCorruption() { EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel()); // TODO: 17/6/1 // mErrorHandler.onCorruption(this); }
/** * Sends a corruption message to the database error handler. */ void onCorruption() { EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel()); mErrorHandler.onCorruption(this); }
public void report (int code, Object... list) { EventLog.writeEvent(code, list); }
/** * parse event * * @param event Event * @return false to exit readEvents * @see LogReader#readEvents(EventHandler) */ boolean onEvent(EventLog.Event event);