当前位置: 首页>>代码示例>>Java>>正文


Java EventLog类代码示例

本文整理汇总了Java中android.util.EventLog的典型用法代码示例。如果您正苦于以下问题:Java EventLog类的具体用法?Java EventLog怎么用?Java EventLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EventLog类属于android.util包,在下文中一共展示了EventLog类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:27,代码来源:NetworkStatsEntity.java

示例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");
}
 
开发者ID:cuplv,项目名称:droidel,代码行数:23,代码来源:ActivityThread.java

示例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;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:19,代码来源:ContextMenuBuilder.java

示例4: 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));
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:8,代码来源:CondomCore.java

示例5: 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;
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:15,代码来源:CondomMiscTest.java

示例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;
}
 
开发者ID:cuplv,项目名称:droidel,代码行数:40,代码来源:ActivityThread.java

示例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;
    }
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:50,代码来源:a.java

示例8: 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());
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:5,代码来源:CondomCore.java

示例9: readLastEvent

import android.util.EventLog; //导入依赖的package包/类
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();
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:6,代码来源:CondomMiscTest.java

示例10: 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);
}
 
开发者ID:kkmike999,项目名称:YuiHatano,代码行数:9,代码来源:ShadowSQLiteDatabase.java

示例11: 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);
}
 
开发者ID:requery,项目名称:sqlite-android,代码行数:8,代码来源:SQLiteDatabase.java

示例12: report

import android.util.EventLog; //导入依赖的package包/类
public void report (int code, Object... list) {
    EventLog.writeEvent(code, list);
}
 
开发者ID:cuplv,项目名称:droidel,代码行数:4,代码来源:ActivityThread.java

示例13: onEvent

import android.util.EventLog; //导入依赖的package包/类
/**
 * parse event
 *
 * @param event Event
 * @return false to exit readEvents
 * @see LogReader#readEvents(EventHandler)
 */
boolean onEvent(EventLog.Event event);
 
开发者ID:brevent,项目名称:Brevent,代码行数:9,代码来源:EventHandler.java


注:本文中的android.util.EventLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。