Example usage for android.util Log VERBOSE

List of usage examples for android.util Log VERBOSE

Introduction

In this page you can find the example usage for android.util Log VERBOSE.

Prototype

int VERBOSE

To view the source code for android.util Log VERBOSE.

Click Source Link

Document

Priority constant for the println method; use Log.v.

Usage

From source file:com.googlecode.eyesfree.brailleback.DefaultNavigationMode.java

private boolean longClickNode(AccessibilityNodeInfoCompat node) {
    if (node == null) {
        return false;
    }/*ww  w  .jav  a 2 s  .c om*/
    AccessibilityNodeInfoRef current = AccessibilityNodeInfoRef.unOwned(node);
    try {
        do {
            LogUtils.log(this, Log.VERBOSE, "Considering to long click: %s", current.get().getInfo());
            if (current.get().performAction(AccessibilityNodeInfo.ACTION_LONG_CLICK)) {
                return true;
            }
        } while (current.parent());
    } finally {
        current.recycle();
    }
    LogUtils.log(this, Log.VERBOSE, "Long click action failed");
    return false;
}

From source file:org.restcomm.android.sdk.RCDevice.java

/**
 * Internal service callback; not meant for application use
 *//*  w  w  w .  j a  v  a 2  s  .  c o m*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    // Runs whenever the user calls startService()
    Log.i(TAG, "%% onStartCommand");

    if (intent == null) {
        // TODO: this might be an issue, if it happens often. If the service is killed all context will be lost, so it won't
        // be able to automatically re-initialize. The only possible way to avoid this would be to return START_REDELIVER_INTENT
        // but then we would need to retrieve the parameters the Service was started with, and for that we 'd need to pack
        // all parameters inside the original intent. something which I tried but failed back when I implemented backgrounding,
        // and main reason was that I wasn't able to pack other intents in that Intent
        Log.e(TAG, "%% onStartCommand after having been killed");
    }

    if (intent != null && intent.getAction() != null) {
        String intentAction = intent.getAction();

        //check is intent is from push notifications,
        //if it is, check is service initialized,
        //if its not initialize it
        if (intentAction.equals(ACTION_FCM)) {
            setLogLevel(Log.VERBOSE);

            //if service is attached we dont need to run foreground
            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
                NotificationCompat.Builder builder = getNotificationBuilder(false);
                builder.setSmallIcon(R.drawable.ic_chat_24dp);
                builder.setAutoCancel(true);
                builder.setContentTitle("Restcomm Connect");
                builder.setContentText("Background initialization...");
                startForeground(notificationId, builder.build());
            }

            //initialize
            if (!isServiceInitialized) {
                //get values
                storageManagerPreferences = new StorageManagerPreferences(this);
                HashMap<String, Object> parameters = StorageUtils.getParams(storageManagerPreferences);
                try {
                    initialize(null, parameters, null);
                } catch (RCException e) {
                    RCLogger.e(TAG, e.toString());
                }
            }
        } else {
            // if action originates at Notification subsystem, need to handle it
            if (intentAction.equals(ACTION_NOTIFICATION_CALL_DEFAULT)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_ACCEPT_VIDEO)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_ACCEPT_AUDIO)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_DECLINE)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_DELETE)
                    || intentAction.equals(ACTION_NOTIFICATION_MESSAGE_DEFAULT)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_DISCONNECT)
                    || intentAction.equals(ACTION_NOTIFICATION_CALL_MUTE_AUDIO)) {
                onNotificationIntent(intent);
            }
        }
    }

    return START_NOT_STICKY;
}

From source file:com.android.contacts.group.GroupMembersFragment.java

private void onGroupMetadataLoaded() {
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "Loaded " + mGroupMetaData);

    maybeAttachCheckBoxListener();/* w ww  . j  a  v  a  2  s  . c  om*/

    mActivity.setTitle(mGroupMetaData.groupName);
    mActivity.invalidateOptionsMenu();
    mActivity.updateDrawerGroupMenu(mGroupMetaData.groupId);

    // Start loading the group members
    super.startLoading();
}

From source file:com.googlecode.eyesfree.brailleback.DefaultNavigationMode.java

/**
 * Formats some braille content from an {@link AccessibilityEvent}.
 *
 * @param event The event from which to format an utterance.
 * @return The formatted utterance./*from w w w .  j  a v a2 s.c  o m*/
 */
private DisplayManager.Content formatEventToBraille(AccessibilityEvent event) {
    AccessibilityNodeInfoCompat eventNode = getNodeFromEvent(event);
    if (eventNode != null) {
        DisplayManager.Content ret = mNodeBrailler.brailleNode(eventNode);
        ret.setPanStrategy(DisplayManager.Content.PAN_CURSOR);
        mLastFocusedNode.reset(eventNode);
        return ret;
    }

    // Fall back on putting the event text on the display.
    // TODO: This can interfere with what's on the display and should be
    // done in a more disciplined manner.
    LogUtils.log(this, Log.VERBOSE, "No node on event, falling back on event text");
    mLastFocusedNode.clear();
    return new DisplayManager.Content(AccessibilityEventUtils.getEventText(event));
}

From source file:org.readium.sdk.lcp.StatusDocumentProcessing.java

public void doRenew(final DoneCallback doneCallback_checkLink_RENEW) {

    if (m_statusDocument_LINK_RENEW == null) {
        doneCallback_checkLink_RENEW.Done(false);
        return;//from w w  w .j a  va 2  s  .  co  m
    }

    String url = m_statusDocument_LINK_RENEW.m_href;
    if (m_statusDocument_LINK_RENEW.m_templated.equals("true")) {

        String deviceID = m_deviceIDManager.getDeviceID();
        String deviceNAME = m_deviceIDManager.getDeviceNAME();

        // URLEncoder.encode() doesn't generate %20 for space character (instead: '+')
        // So we use android.net.Uri's appendQueryParameter() instead (see below)
        //        try {
        //            deviceID = URLEncoder.encode(deviceID, "UTF-8");
        //            deviceNAME = URLEncoder.encode(deviceNAME, "UTF-8");
        //        } catch (Exception ex) {
        //            // noop
        //        }
        //        url = url.replace("{?end,id,name}", "?id=" + deviceID + "&name=" + deviceNAME);

        url = url.replace("{?end,id,name}", ""); // TODO: smarter regexp?
        url = Uri.parse(url).buildUpon().appendQueryParameter("id", deviceID)
                .appendQueryParameter("name", deviceNAME).build().toString();
    }

    Locale currentLocale = getCurrentLocale();
    String langCode = currentLocale.toString().replace('_', '-');
    langCode = langCode + ",en-US;q=0.7,en;q=0.5";

    Future<Response<InputStream>> request = Ion.with(m_context).load("PUT", url)
            .setLogging("Readium Ion", Log.VERBOSE)

            //.setTimeout(AsyncHttpRequest.DEFAULT_TIMEOUT) //30000
            .setTimeout(6000)

            // TODO: comment this in production! (this is only for testing a local HTTP server)
            //.setHeader("X-Add-Delay", "2s")

            // LCP / LSD server with message localization
            .setHeader("Accept-Language", langCode)

            // QUERY params (templated URI)
            //                        .setBodyParameter("id", deviceID)
            //                        .setBodyParameter("name", deviceNAME)
            //.setBodyParameter("end", "") //ISO 8601 date-time

            .asInputStream().withResponse()

            // UI thread
            .setCallback(new FutureCallback<Response<InputStream>>() {
                @Override
                public void onCompleted(Exception e, Response<InputStream> response) {

                    InputStream inputStream = response != null ? response.getResult() : null;
                    int httpResponseCode = response != null ? response.getHeaders().code() : 0;
                    if (e != null || inputStream == null || httpResponseCode < 200 || httpResponseCode >= 300) {

                        doneCallback_checkLink_RENEW.Done(false);
                        return;
                    }

                    try {
                        // forces re-check of LSD, now with updated LCP timestamp
                        mLicense.setStatusDocumentProcessingFlag(false);

                        doneCallback_checkLink_RENEW.Done(true);

                    } catch (Exception ex) {
                        ex.printStackTrace();
                        doneCallback_checkLink_RENEW.Done(false);
                    } finally {
                        try {
                            inputStream.close();
                        } catch (IOException ex) {
                            ex.printStackTrace();
                            // ignore
                        }
                    }
                }
            });
}

From source file:com.google.android.marvin.mytalkback.TalkBackService.java

@Override
protected void onServiceConnected() {
    LogUtils.log(this, Log.VERBOSE, "System bound to service.");
    resumeInfrastructure();/* w  ww  .  j a  v  a2  s.c  om*/

    // Handle any update actions.
    final TalkBackUpdateHelper helper = new TalkBackUpdateHelper(this);
    helper.showPendingNotifications();
    helper.checkUpdate();

    // Handle showing the tutorial if touch exploration is enabled.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        final ContentResolver resolver = getContentResolver();
        if (Settings.Secure.getInt(resolver, Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0) == 1) {
            onTouchExplorationEnabled();
        } else {
            registerTouchSettingObserver(resolver);
        }
    }
}

From source file:com.google.android.marvin.screenspeak.ScreenSpeakService.java

@Override
protected void onServiceConnected() {
    if (LogUtils.LOG_LEVEL <= Log.VERBOSE) {
        Log.v(LOGTAG, "System bound to service.");
    }//  w  w w .  j a v  a2 s. c o  m
    resumeInfrastructure();

    // Handle any update actions.
    final ScreenSpeakUpdateHelper helper = new ScreenSpeakUpdateHelper(this);
    helper.showPendingNotifications();
    helper.checkUpdate();

    final ContentResolver resolver = getContentResolver();
    if (!ScreenSpeakPreferencesActivity.isTouchExplorationEnabled(resolver) || !showTutorial()) {
        startCallStateMonitor();
    }

    if (mPrefs.getBoolean(getString(R.string.pref_suspended), false)) {
        suspendScreenSpeak();
    } else {
        mSpeechController.speak(getString(R.string.screenspeak_on), SpeechController.QUEUE_MODE_UNINTERRUPTIBLE,
                0, null);
    }
}

From source file:com.android.mms.ui.MessageUtils.java

public static void recordVideo(Activity activity, int requestCode, long sizeLimit) {
    // The video recorder can sometimes return a file that's larger than the max we
    // say we can handle. Try to handle that overshoot by specifying an 85% limit.
    /// M: media recoder can handle this issue,so mark it.
    //        sizeLimit *= .85F;

    int durationLimit = getVideoCaptureDurationLimit();

    if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) {
        log("recordVideo: durationLimit: " + durationLimit + " sizeLimit: " + sizeLimit);
    }/*  w  w w .j  ava  2s.c o m*/

    Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
    intent.putExtra("android.intent.extra.sizeLimit", sizeLimit);
    intent.putExtra("android.intent.extra.durationLimit", durationLimit);
    /// M: Code analyze 009, For fix bug ALPS00241707, You can not add
    // capture video to Messaging after you preview it in Gallery. @{
    intent.putExtra(MediaStore.EXTRA_OUTPUT, TempFileProvider.SCRAP_VIDEO_URI);
    /// M: fix bug ALPS01043585
    intent.putExtra("CanShare", false);
    activity.startActivityForResult(intent, requestCode);
}

From source file:org.readium.sdk.lcp.StatusDocumentProcessing.java

public void doReturn(final DoneCallback doneCallback_checkLink_RETURN) {

    if (m_statusDocument_LINK_RETURN == null) {
        doneCallback_checkLink_RETURN.Done(false);
        return;//from www. j a v a2s .  c  o  m
    }

    String url = m_statusDocument_LINK_RETURN.m_href;
    if (m_statusDocument_LINK_RETURN.m_templated.equals("true")) {

        String deviceID = m_deviceIDManager.getDeviceID();
        String deviceNAME = m_deviceIDManager.getDeviceNAME();

        // URLEncoder.encode() doesn't generate %20 for space character (instead: '+')
        // So we use android.net.Uri's appendQueryParameter() instead (see below)
        //        try {
        //            deviceID = URLEncoder.encode(deviceID, "UTF-8");
        //            deviceNAME = URLEncoder.encode(deviceNAME, "UTF-8");
        //        } catch (Exception ex) {
        //            // noop
        //        }
        //        url = url.replace("{?id,name}", "?id=" + deviceID + "&name=" + deviceNAME);

        url = url.replace("{?id,name}", ""); // TODO: smarter regexp?
        url = Uri.parse(url).buildUpon().appendQueryParameter("id", deviceID)
                .appendQueryParameter("name", deviceNAME).build().toString();
    }

    Locale currentLocale = getCurrentLocale();
    String langCode = currentLocale.toString().replace('_', '-');
    langCode = langCode + ",en-US;q=0.7,en;q=0.5";

    Future<Response<InputStream>> request = Ion.with(m_context).load("PUT", url)
            .setLogging("Readium Ion", Log.VERBOSE)

            //.setTimeout(AsyncHttpRequest.DEFAULT_TIMEOUT) //30000
            .setTimeout(6000)

            // TODO: comment this in production! (this is only for testing a local HTTP server)
            //.setHeader("X-Add-Delay", "2s")

            // LCP / LSD server with message localization
            .setHeader("Accept-Language", langCode)

            // QUERY params (templated URI)
            //                        .setBodyParameter("id", deviceID)
            //                        .setBodyParameter("name", deviceNAME)

            .asInputStream().withResponse()

            // UI thread
            .setCallback(new FutureCallback<Response<InputStream>>() {
                @Override
                public void onCompleted(Exception e, Response<InputStream> response) {

                    InputStream inputStream = response != null ? response.getResult() : null;
                    int httpResponseCode = response != null ? response.getHeaders().code() : 0;
                    if (e != null || inputStream == null || httpResponseCode < 200 || httpResponseCode >= 300) {

                        doneCallback_checkLink_RETURN.Done(false);
                        return;
                    }

                    try {
                        // forces re-check of LSD, now with updated LCP timestamp
                        mLicense.setStatusDocumentProcessingFlag(false);

                        doneCallback_checkLink_RETURN.Done(true);

                    } catch (Exception ex) {
                        ex.printStackTrace();
                        doneCallback_checkLink_RETURN.Done(false);
                    } finally {
                        try {
                            inputStream.close();
                        } catch (IOException ex) {
                            ex.printStackTrace();
                            // ignore
                        }
                    }
                }
            });
}

From source file:com.concentriclivers.mms.com.android.mms.transaction.MessagingNotification.java

private static final void addSmsNotificationInfos(Context context, Set<Long> threads) {
    // TDH/*ww  w.java  2  s.c  o  m*/
    Log.d("NotificationDebug", "addSmsNotificationInfos");

    // TDH: On my Samsung phone, the message has a type of 4 (OUTBOX)
    // instead of 1 (INBOX)! God knows why. Samsung are fucking retards.

    // Ok, but that seems to be only when I send a text to myself.
    // When I get one from someone else the type is 1 (INBOX) but seen
    // is also 1! How am I supposed to know... blargh!
    // read is also 1. I'm getting to the point where I will need
    // to add duplicate columns to the DB (e.g. seen_by_tdh).
    // Alternatively maintain another database just for "seen".
    // Or as a hacky workaround, maintain a count of the number of unread
    // messages in each thread id.

    // TDH: TODO: Do I really need this custom constraint? It
    // seems to be working as expected now...
    final String NEW_INCOMING_SM_CONSTRAINT_TDH = "((" + Sms.TYPE + " = " + Sms.MESSAGE_TYPE_INBOX + " OR "
            + Sms.TYPE + " = " + Sms.MESSAGE_TYPE_OUTBOX + ")" + " AND " + Sms.SEEN + " = 0)";
    ContentResolver resolver = context.getContentResolver();
    Cursor cursor = SqliteWrapper.query(context, resolver, Sms.CONTENT_URI, SMS_STATUS_PROJECTION,
            NEW_INCOMING_SM_CONSTRAINT_TDH, null, Sms.DATE + " desc");

    if (cursor == null) {
        // TDH: TODO: This happens because our SQL code above
        // assumes columns exist that don't or something...
        // but to get the error I need to read logcat and automatically
        // send myself a message.
        Log.d("NotificationDebug", "cursor null");

        return;
    }

    // TDH
    Log.d("NotificationDebug", "Cursor count: " + cursor.getCount());

    String[] testProjection = new String[] { Sms.THREAD_ID, Sms.DATE, Sms.ADDRESS, Sms.SUBJECT, Sms.BODY,
            Sms.SEEN, Sms.READ, Sms.TYPE };
    // TDH: Test
    Cursor cursor2 = SqliteWrapper.query(context, resolver, Sms.CONTENT_URI, testProjection, null, null,
            Sms.DATE + " desc");
    if (cursor2 == null) {
        Log.d("NotificationDebug", "Cursor2 null");

        return;
    }
    Log.d("NotificationDebug", "Cursor2 count: " + cursor2.getCount());
    int i = 0;
    while (cursor2.moveToNext() && ++i < 3) {
        Log.d("NotificationDebug",
                "message: " + cursor2.getString(COLUMN_SMS_BODY) + ", threadId: "
                        + cursor2.getLong(COLUMN_THREAD_ID) + ", seen: " + cursor2.getInt(5) + ", read: "
                        + cursor2.getInt(6) + ", type: " + cursor2.getInt(7));
    }

    // TDH: Ok we get here. cursor isn't null but something still fails below.
    // I think it is still because it is looking up the SMS in the database
    // and it doesn't exist yet. Yeah seems to be that way.
    // Ok I will just add a delay for 2 second to the receive code.

    try {
        while (cursor.moveToNext()) {
            Log.d("NotificationDebug", "movedToNext.");
            String address = cursor.getString(COLUMN_SMS_ADDRESS);
            Log.d("NotificationDebug", "address: " + address);

            Contact contact = Contact.get(address, false);
            Log.d("NotificationDebug", "contact: " + contact);

            if (contact.getSendToVoicemail()) {
                Log.d("NotificationDebug", "getSendToVoicemail() = true");

                // don't notify, skip this one
                continue;
            }

            String message = cursor.getString(COLUMN_SMS_BODY);
            long threadId = cursor.getLong(COLUMN_THREAD_ID);

            Log.d("NotificationDebug", "message: " + message + ", threadId: " + threadId);

            // TDH: Never gets to here!
            Log.d("NotificationDebug", "Got thread id: " + threadId);

            long timeMillis = cursor.getLong(COLUMN_DATE);

            if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) {
                Log.d(TAG, "addSmsNotificationInfos: count=" + cursor.getCount() + ", addr=" + address
                        + ", thread_id=" + threadId);
            }

            NotificationInfo info = getNewMessageNotificationInfo(context, true /* isSms */, address, message,
                    null /* subject */, threadId, timeMillis, null /* attachmentBitmap */, contact,
                    WorkingMessage.TEXT);

            sNotificationSet.add(info);

            threads.add(threadId);
            threads.add(cursor.getLong(COLUMN_THREAD_ID));
        }
    } catch (Exception e) {
        // TDH
        e.printStackTrace();
    } finally {
        cursor.close();
    }
}