List of usage examples for android.util Log VERBOSE
int VERBOSE
To view the source code for android.util Log VERBOSE.
Click Source Link
From source file:com.google.android.marvin.mytalkback.ProcessorFocusAndSingleTap.java
/** * Attempts to place focus within a new window. */// ww w . j av a2 s .c om private boolean ensureFocusConsistency(boolean shouldPlaceFocus) { AccessibilityNodeInfoCompat root = null; AccessibilityNodeInfoCompat focused = null; AccessibilityNodeInfoCompat inputFocused = null; AccessibilityNodeInfoCompat firstFocus = null; try { root = AccessibilityServiceCompatUtils.getRootInActiveWindow(mService); if (root == null) { return false; } // First, see if we've already placed accessibility focus. focused = root.findFocus(AccessibilityNodeInfo.FOCUS_ACCESSIBILITY); if (focused != null) { if (AccessibilityNodeInfoUtils.shouldFocusNode(mService, focused)) { return true; } LogUtils.log(Log.VERBOSE, "Clearing focus from invalid node"); focused.performAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS); } // If not, should we attempt to place focus? if (!shouldPlaceFocus) { return false; } // Next, see if the system has placed input focus. inputFocused = root.findFocus(AccessibilityNodeInfo.FOCUS_INPUT); if (tryFocusing(inputFocused)) { return true; } // Finally, just try to focus the first focusable item. firstFocus = AccessibilityNodeInfoUtils.searchFromInOrderTraversal(mService, root, AccessibilityNodeInfoUtils.FILTER_SHOULD_FOCUS, NodeFocusFinder.SEARCH_FORWARD); if (tryFocusing(firstFocus)) { return true; } LogUtils.log(Log.ERROR, "Failed to place focus from new window"); return false; } finally { AccessibilityNodeInfoUtils.recycleNodes(root, focused, inputFocused, firstFocus); } }
From source file:android.percent.support.PercentLayoutHelper.java
private static PercentLayoutInfo setMarginRelatedVal(TypedArray array, PercentLayoutInfo info) { //margin????//from w ww .j a v a 2s.c om PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent margin: " + percentVal.percent); } info = checkForInfoExists(info); info.leftMarginPercent = percentVal; info.topMarginPercent = percentVal; info.rightMarginPercent = percentVal; info.bottomMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginLeftPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent left margin: " + percentVal.percent); } info = checkForInfoExists(info); info.leftMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginTopPercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent top margin: " + percentVal.percent); } info = checkForInfoExists(info); info.topMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginRightPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent right margin: " + percentVal.percent); } info = checkForInfoExists(info); info.rightMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginBottomPercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent bottom margin: " + percentVal.percent); } info = checkForInfoExists(info); info.bottomMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginStartPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent start margin: " + percentVal.percent); } info = checkForInfoExists(info); info.startMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginEndPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent end margin: " + percentVal.percent); } info = checkForInfoExists(info); info.endMarginPercent = percentVal; } return info; }
From source file:com.neuwill.support.PercentLayoutHelper.java
private static PercentLayoutInfo setMarginRelatedVal(TypedArray array, PercentLayoutInfo info) { // margin//from www .j a v a2s .c o m PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent margin: " + percentVal.percent); } info = checkForInfoExists(info); info.leftMarginPercent = percentVal; info.topMarginPercent = percentVal; info.rightMarginPercent = percentVal; info.bottomMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginLeftPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent left margin: " + percentVal.percent); } info = checkForInfoExists(info); info.leftMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginTopPercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent top margin: " + percentVal.percent); } info = checkForInfoExists(info); info.topMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginRightPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent right margin: " + percentVal.percent); } info = checkForInfoExists(info); info.rightMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginBottomPercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent bottom margin: " + percentVal.percent); } info = checkForInfoExists(info); info.bottomMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginStartPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent start margin: " + percentVal.percent); } info = checkForInfoExists(info); info.startMarginPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_marginEndPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent end margin: " + percentVal.percent); } info = checkForInfoExists(info); info.endMarginPercent = percentVal; } return info; }
From source file:com.digipom.manteresting.android.fragment.NailFragment.java
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { // Swap the new cursor in. (The framework will take care of closing the // old cursor once we return.) nailAdapter.swapCursor(data);/*from www. ja v a 2s. c o m*/ if (LoggerConfig.canLog(Log.VERBOSE)) { Log.v(TAG, "onLoadFinished(" + loader + ", " + data + "): Swapped nailAdapter cursor."); } }
From source file:com.android.mms.ui.ConversationList.java
public void onDraftChanged(final long threadId, final boolean hasDraft) { // Run notifyDataSetChanged() on the main thread. mQueryHandler.post(new Runnable() { public void run() { if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) { log("onDraftChanged: threadId=" + threadId + ", hasDraft=" + hasDraft); }// w ww .j a v a2 s. c o m mListAdapter.notifyDataSetChanged(); } }); }
From source file:com.googlecode.eyesfree.testing.BaseAccessibilityInstrumentationTestCase.java
/** * Ensures that {@link #NO_EVENTS_DURATION} milliseconds have passed since * the last accessibility event./*from w ww .j a v a 2s . co m*/ */ protected void waitForAccessibilityIdleSync() { boolean hasIdleSync = false; final long startTime = SystemClock.uptimeMillis(); synchronized (mAccessibilityEventLock) { try { // Reset the event time to now so that we catch queued events. mLastEventTime = SystemClock.uptimeMillis(); while (true) { final long eventTimeElapsed = (SystemClock.uptimeMillis() - mLastEventTime); final long eventTimeLeft = (NO_EVENTS_DURATION - eventTimeElapsed); if (eventTimeLeft <= 0) { hasIdleSync = true; break; } final long timeElapsed = (SystemClock.uptimeMillis() - startTime); final long timeLeft = (NO_EVENTS_TIMEOUT - timeElapsed); if (timeLeft <= 0) { break; } final long timeToWait = Math.min(timeLeft, eventTimeLeft); mAccessibilityEventLock.wait(timeToWait); } } catch (InterruptedException e) { // Do nothing. } assertTrue("Accessibility events idle for " + NO_EVENTS_DURATION + " ms", hasIdleSync); } LogUtils.log(this, Log.VERBOSE, "Took %d ms to sync accessibility idle state", (SystemClock.uptimeMillis() - startTime)); }
From source file:com.digipom.manteresting.android.fragment.NailFragment.java
@Override public void onLoaderReset(Loader<Cursor> loader) { // This is called when the last Cursor provided to onLoadFinished() // above is about to be closed. We need to make sure we are no // longer using it. nailAdapter.swapCursor(null);/*w ww.ja v a 2 s. co m*/ if (LoggerConfig.canLog(Log.VERBOSE)) { Log.v(TAG, "onLoaderReset(" + loader + "): Swapped nailAdapter with a null cursor."); } }
From source file:com.android.talkback.formatter.TouchExplorationFormatter.java
private void addCollectionTransition(Utterance utterance) { @CollectionState.CollectionTransition int collectionTransition = mCollectionState.getCollectionTransition(); if (collectionTransition != CollectionState.NAVIGATE_ENTER && collectionTransition != CollectionState.NAVIGATE_EXIT) { return;/*w w w. j a va 2 s . c om*/ } CharSequence transitionText; if (collectionTransition == CollectionState.NAVIGATE_ENTER) { CharSequence collectionDescription = getCollectionDescription(mCollectionState, true); transitionText = mService.getString(R.string.template_collection_start, collectionDescription); } else { // NAVIGATE_EXIT CharSequence collectionDescription = getCollectionDescription(mCollectionState, false); if (!mCollectionState.doesCollectionExist()) { // If the collection root no longer exists, then skip the exit announcement. // The app has probably switched its activity/fragment/other UI. LogUtils.log(this, Log.VERBOSE, "Exit announcement skipped: %s", collectionDescription); return; } transitionText = mService.getString(R.string.template_collection_end, collectionDescription); } utterance.addSpoken(transitionText); }
From source file:com.android.talkback.eventprocessor.AccessibilityEventProcessor.java
/** * Returns whether the device should drop this event. Caches notifications * if necessary./*from w w w . ja v a 2s . c om*/ * * @param event The current event. * @return {@code true} if the event should be dropped. */ private boolean shouldDropEvent(AccessibilityEvent event) { // Always drop null events. if (event == null) { return true; } // Always drop events if the service is suspended. if (!TalkBackService.isServiceActive()) { return true; } // If touch exploration is enabled, drop automatically generated events // that are sent immediately after a window state change... unless we // decide to keep the event. if (AccessibilityManagerCompat.isTouchExplorationEnabled(mAccessibilityManager) && ((event.getEventType() & AUTOMATIC_AFTER_STATE_CHANGE) != 0) && ((event.getEventTime() - mLastWindowStateChanged) < DELAY_AUTO_AFTER_STATE) && !shouldKeepAutomaticEvent(event)) { if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop event after window state change"); } return true; } // Some view-selected events are spurious if sent immediately after a focused event. if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SELECTED && !shouldKeepViewSelectedEvent(event)) { if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop selected event after focused event"); } return true; } // Real notification events always have parcelable data. final boolean isNotification = (event.getEventType() == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) && (event.getParcelableData() != null); final boolean isPhoneActive = (mCallStateMonitor != null) && (mCallStateMonitor.getCurrentCallState() != TelephonyManager.CALL_STATE_IDLE); final boolean isPhoneRinging = (mCallStateMonitor != null) && (mCallStateMonitor.getCurrentCallState() == TelephonyManager.CALL_STATE_RINGING); // Sometimes the dialer's window-state-changed event gets sent right before the // TelephonyManager transitions to CALL_STATE_RINGING, so we need to check isDialerEvent(). final boolean shouldSpeakCallerId = isPhoneRinging || isDialerEvent(event); if (mRingerModeAndScreenMonitor != null && !mRingerModeAndScreenMonitor.isScreenOn() && !shouldSpeakCallerId) { if (!mSpeakWhenScreenOff) { // If the user doesn't allow speech when the screen is // off, drop the event immediately. if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop event due to screen state and user pref"); } return true; } else if (!isNotification) { // If the user allows speech when the screen is off, drop // all non-notification events. if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop non-notification event due to screen state"); } return true; } } final boolean canInterruptRadialMenu = AccessibilityEventUtils.eventMatchesAnyType(event, MASK_EVENT_TYPES_INTERRUPT_RADIAL_MENU); final boolean silencedByRadialMenu = (mService.getMenuManager().isMenuShowing() && !canInterruptRadialMenu); // Don't speak events that cannot interrupt the radial menu, if showing if (silencedByRadialMenu) { if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop event due to radial menu state"); } return true; } // Don't speak notification events if the user is touch exploring or a phone call is active. if (isNotification && (mIsUserTouchExploring || isPhoneActive)) { if (LogUtils.LOG_LEVEL <= Log.VERBOSE) { Log.v(LOGTAG, "Drop notification due to touch or phone state"); } return true; } final int touchscreenState = mService.getResources().getConfiguration().touchscreen; final boolean isTouchInteractionStateChange = AccessibilityEventUtils.eventMatchesAnyType(event, MASK_EVENT_TYPES_TOUCH_STATE_CHANGES); // Drop all events related to touch interaction state on devices that don't support touch. return (touchscreenState == Configuration.TOUCHSCREEN_NOTOUCH) && isTouchInteractionStateChange; }
From source file:at.jclehner.rxdroid.DrugListActivity.java
@Override public void onCreateContextMenu(ContextMenu menu, final View v, ContextMenuInfo menuInfo) { final DoseView doseView = (DoseView) v; if (toastIfPastMaxHistoryAge(doseView.getDate())) return;//from w w w . j a v a 2 s .c om final Drug drug = doseView.getDrug(); final int doseTime = doseView.getDoseTime(); // menu.setHeaderIcon(android.R.drawable.ic_menu_agenda); menu.setHeaderTitle(drug.getName()); // //////////////////////////////////////////////// // //////////////////////////////////////////////// final boolean wasDoseTaken = doseView.wasDoseTaken(); if (wasDoseTaken) { menu.add(0, CMENU_REMOVE_DOSE, 0, R.string._title_mark_not_taken) .setOnMenuItemClickListener(new OnContextMenuItemClickListener() { @Override public boolean onMenuItemClick(android.view.MenuItem item) { MutableFraction dose = new MutableFraction(); for (DoseEvent intake : Entries.findDoseEvents(drug, mCurrentDate, doseTime)) { dose.add(intake.getDose()); Database.delete(intake); } drug.setCurrentSupply(drug.getCurrentSupply().plus(dose)); Database.update(drug); return true; } }); } else { menu.add(0, CMENU_IGNORE_DOSE, 0, R.string._title_ignore_dose) .setOnMenuItemClickListener(new OnContextMenuItemClickListener() { @Override public boolean onMenuItemClick(android.view.MenuItem item) { Database.create(new DoseEvent(drug, doseView.getDate(), doseTime)); return true; } }); } menu.add(0, CMENU_TAKE_DOSE, 0, R.string._title_mark_taken) .setOnMenuItemClickListener(new OnContextMenuItemClickListener() { @Override public boolean onMenuItemClick(android.view.MenuItem item) { showDoseDialog(drug, doseView.getDate(), doseTime, true); return true; } }); final Intent editIntent = new Intent(this, DrugEditActivity.class); editIntent.setAction(Intent.ACTION_EDIT); editIntent.putExtra(DrugEditActivity.EXTRA_DRUG_ID, drug.getId()); menu.add(0, CMENU_EDIT_DRUG, 0, R.string._title_edit_drug).setIntent(editIntent); if (BuildConfig.DEBUG) { menu.add(0, CMENU_DUMP, 0, "Dump").setOnMenuItemClickListener(new OnContextMenuItemClickListener() { @Override public boolean onMenuItemClick(android.view.MenuItem item) { Util.dumpObjectMembers(TAG, Log.VERBOSE, drug, drug.getName()); return true; } }); } }