本文整理汇总了Java中android.util.EventLog.writeEvent方法的典型用法代码示例。如果您正苦于以下问题:Java EventLog.writeEvent方法的具体用法?Java EventLog.writeEvent怎么用?Java EventLog.writeEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.util.EventLog
的用法示例。
在下文中一共展示了EventLog.writeEvent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import android.util.EventLog; //导入方法依赖的package包/类
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);
}
}
示例2: handleLowMemory
import android.util.EventLog; //导入方法依赖的package包/类
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");
}
示例3: show
import android.util.EventLog; //导入方法依赖的package包/类
@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;
}
示例4: readNewEvents
import android.util.EventLog; //导入方法依赖的package包/类
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;
}
示例5: log
import android.util.EventLog; //导入方法依赖的package包/类
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));
}
示例6: performResumeActivity
import android.util.EventLog; //导入方法依赖的package包/类
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;
}
示例7: onMenuItemSelected
import android.util.EventLog; //导入方法依赖的package包/类
/**
* 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;
}
}
示例8: onCorruption
import android.util.EventLog; //导入方法依赖的package包/类
/**
* Sends a corruption message to the database error handler.
*/
void onCorruption() {
EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
// TODO: 17/6/1
// mErrorHandler.onCorruption(this);
}
示例9: logConcern
import android.util.EventLog; //导入方法依赖的package包/类
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());
}
示例10: onCorruption
import android.util.EventLog; //导入方法依赖的package包/类
/**
* Sends a corruption message to the database error handler.
*/
void onCorruption() {
EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
mErrorHandler.onCorruption(this);
}
示例11: report
import android.util.EventLog; //导入方法依赖的package包/类
public void report (int code, Object... list) {
EventLog.writeEvent(code, list);
}