Java Code Examples for android.util.EventLog

The following are top voted examples for showing how to use android.util.EventLog. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: FMTech   File: NetworkStatsEntity.java   View source code 6 votes vote down vote up
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);
  }
}
 
Example 2
Project: FMTech   File: NetworkStatsEntity.java   View source code 6 votes vote down vote up
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);
  }
}
 
Example 3
Project: droidel   File: ActivityThread.java   View source code 6 votes vote down vote up
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");
}
 
Example 4
Project: gloomy-dungeons-2   File: ContextMenuBuilder.java   View source code 6 votes vote down vote up
@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;
}
 
Example 5
Project: laposte-android   File: ContextMenuBuilder.java   View source code 6 votes vote down vote up
@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;
}
 
Example 6
Project: TflTravelAlerts   File: ContextMenuBuilder.java   View source code 6 votes vote down vote up
@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;
}
 
Example 7
Project: MiPushFramework   File: CondomCore.java   View source code 5 votes vote down vote up
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));
}
 
Example 8
Project: MiPushFramework   File: CondomMiscTest.java   View source code 5 votes vote down vote up
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;
}
 
Example 9
Project: condom   File: CondomCore.java   View source code 5 votes vote down vote up
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));
}
 
Example 10
Project: condom   File: CondomMiscTest.java   View source code 5 votes vote down vote up
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;
}
 
Example 11
Project: droidel   File: ActivityThread.java   View source code 5 votes vote down vote up
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;
}
 
Example 12
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 13
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 14
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 15
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 16
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 17
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 18
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 19
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 20
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 21
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 22
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 23
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 24
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 25
Project: ProgressManager   File: a.java   View source code 4 votes vote down vote up
/**
 * 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;
    }
}
 
Example 26
Project: MiPushFramework   File: CondomCore.java   View source code 4 votes vote down vote up
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());
}
 
Example 27
Project: MiPushFramework   File: CondomMiscTest.java   View source code 4 votes vote down vote up
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();
}
 
Example 28
Project: YuiHatano   File: ShadowSQLiteDatabase.java   View source code 4 votes vote down vote up
/**
 * Sends a corruption message to the database error handler.
 */
void onCorruption() {
    EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
    // TODO: 17/6/1
    //        mErrorHandler.onCorruption(this);
}
 
Example 29
Project: condom   File: CondomCore.java   View source code 4 votes vote down vote up
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());
}
 
Example 30
Project: condom   File: CondomMiscTest.java   View source code 4 votes vote down vote up
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();
}
 
Example 31
Project: KBUnitTest   File: ShadowSQLiteDatabase.java   View source code 4 votes vote down vote up
/**
 * Sends a corruption message to the database error handler.
 */
void onCorruption() {
    EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
    // TODO: 17/6/1
    //        mErrorHandler.onCorruption(this);
}
 
Example 32
Project: sqlite-android   File: SQLiteDatabase.java   View source code 4 votes vote down vote up
/**
 * Sends a corruption message to the database error handler.
 */
void onCorruption() {
    EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
    mErrorHandler.onCorruption(this);
}
 
Example 33
Project: squidb   File: SQLiteDatabase.java   View source code 4 votes vote down vote up
/**
 * Sends a corruption message to the database error handler.
 */
void onCorruption() {
    EventLog.writeEvent(EVENT_DB_CORRUPT, getLabel());
    mErrorHandler.onCorruption(this);
}
 
Example 34
Project: droidel   File: ActivityThread.java   View source code 4 votes vote down vote up
public void report (int code, Object... list) {
    EventLog.writeEvent(code, list);
}
 
Example 35
Project: Brevent   File: EventHandler.java   View source code 2 votes vote down vote up
/**
 * parse event
 *
 * @param event Event
 * @return false to exit readEvents
 * @see LogReader#readEvents(EventHandler)
 */
boolean onEvent(EventLog.Event event);