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.cerema.cloud2.lib.common.SingleSessionManager.java

@Override
public OwnCloudClient getClientFor(OwnCloudAccount account, Context context)
        throws AccountNotFoundException, OperationCanceledException, AuthenticatorException, IOException {

    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log_OC.d(TAG, "getClientFor starting ");
    }/*from w w w.j ava  2s.c om*/
    if (account == null) {
        throw new IllegalArgumentException("Cannot get an OwnCloudClient for a null account");
    }

    OwnCloudClient client = null;
    String accountName = account.getName();
    String sessionName = account.getCredentials() == null ? ""
            : AccountUtils.buildAccountName(account.getBaseUri(), account.getCredentials().getAuthToken());

    if (accountName != null) {
        client = mClientsWithKnownUsername.get(accountName);
    }
    boolean reusingKnown = false; // just for logs
    if (client == null) {
        if (accountName != null) {
            client = mClientsWithUnknownUsername.remove(sessionName);
            if (client != null) {
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log_OC.v(TAG, "reusing client for session " + sessionName);
                }
                mClientsWithKnownUsername.put(accountName, client);
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log_OC.v(TAG, "moved client to account " + accountName);
                }
            }
        } else {
            client = mClientsWithUnknownUsername.get(sessionName);
        }
    } else {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log_OC.v(TAG, "reusing client for account " + accountName);
        }
        reusingKnown = true;
    }

    if (client == null) {
        // no client to reuse - create a new one
        client = OwnCloudClientFactory.createOwnCloudClient(account.getBaseUri(),
                context.getApplicationContext(), true); // TODO remove dependency on OwnCloudClientFactory
        client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
        // enable cookie tracking

        AccountUtils.restoreCookies(accountName, client, context);

        account.loadCredentials(context);
        client.setCredentials(account.getCredentials());
        if (accountName != null) {
            mClientsWithKnownUsername.put(accountName, client);
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log_OC.v(TAG, "new client for account " + accountName);
            }

        } else {
            mClientsWithUnknownUsername.put(sessionName, client);
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log_OC.v(TAG, "new client for session " + sessionName);
            }
        }
    } else {
        if (!reusingKnown && Log.isLoggable(TAG, Log.VERBOSE)) {
            Log_OC.v(TAG, "reusing client for session " + sessionName);
        }
        keepCredentialsUpdated(account, client);
        keepUriUpdated(account, client);
    }

    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log_OC.d(TAG, "getClientFor finishing ");
    }
    return client;
}

From source file:com.digipom.manteresting.android.service.cache.CacheService.java

@Override
public void onCreate() {
    if (LoggerConfig.canLog(Log.VERBOSE)) {
        Log.v(TAG, "onCreate()");
    }//from   w  ww . j  a va2s  .  c  om

    final int memoryClass = tryGetLargeMemoryClass(
            ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)));

    imageDownloader = new ImageDownloader();

    // 25% of memory allocated to the bitmap memory cache
    bitmapMemoryCache = new BitmapMemoryCache((memoryClass * 1024 * 1024) / 4);

    // 12% of memory allocated to the image memory cache
    imageMemoryCache = new LruCache<String, ImageWithCategory>((memoryClass * 1024 * 1024) / 8) {
        @Override
        protected int sizeOf(String key, ImageWithCategory value) {
            return value != null && value.image != null ? value.image.length : 0;
        }
    };

    initializePrimaryFileCache();
    initializeSecondaryFileCache();
}

From source file:com.xorcode.andtweet.TweetListActivity.java

/**
 * Called when the activity is first created.
 * /*from   w w w  . j  a v a2  s  . c o  m*/
 * @see android.app.Activity#onCreate(android.os.Bundle)
 * @param savedInstanceState
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (MyLog.isLoggable(TAG, Log.VERBOSE)) {
        Log.v(TAG, "onCreate");
    }

    // Create list footer for loading messages
    mListFooter = new LinearLayout(getApplicationContext());
    mListFooter.setClickable(false);
    getListView().addFooterView(mListFooter);
    LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
    View tv = inflater.inflate(R.layout.item_loading, null);
    mListFooter.addView(tv, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT));
    mListFooter.setVisibility(View.INVISIBLE);

    getListView().setOnScrollListener(this);

    initUI();
}

From source file:com.android.mms.widget.MmsWidgetProvider.java

public static void notifyDatasetChanged(Context context) {
    if (Log.isLoggable(LogTag.WIDGET, Log.VERBOSE)) {
        Log.v(TAG, "notifyDatasetChanged");
    }//w  ww . j a va  2  s .c om
    final Intent intent = new Intent(ACTION_NOTIFY_DATASET_CHANGED);
    context.sendBroadcast(intent);
}

From source file:com.pindroid.client.PinboardApi.java

/**
 * Attempts to authenticate to Pinboard using a legacy Pinboard account.
 * // w w w .  j av  a  2 s  . c o  m
 * @param username The user's username.
 * @param password The user's password.
 * @param handler The hander instance from the calling UI thread.
 * @param context The context of the calling Activity.
 * @return The boolean result indicating whether the user was
 *         successfully authenticated.
 * @throws  
 */
public static String pinboardAuthenticate(String username, String password) {
    final HttpResponse resp;

    Uri.Builder builder = new Uri.Builder();
    builder.scheme(SCHEME);
    builder.authority(PINBOARD_AUTHORITY);
    builder.appendEncodedPath(AUTH_TOKEN_URI);
    Uri uri = builder.build();

    HttpGet request = new HttpGet(String.valueOf(uri));

    DefaultHttpClient client = (DefaultHttpClient) HttpClientFactory.getThreadSafeClient();

    CredentialsProvider provider = client.getCredentialsProvider();
    Credentials credentials = new UsernamePasswordCredentials(username, password);
    provider.setCredentials(SCOPE, credentials);

    try {
        resp = client.execute(request);
        if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {

            final HttpEntity entity = resp.getEntity();

            InputStream instream = entity.getContent();
            SaxTokenParser parser = new SaxTokenParser(instream);
            PinboardAuthToken token = parser.parse();
            instream.close();

            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Successful authentication");
                Log.v(TAG, "AuthToken: " + token.getToken());
            }

            return token.getToken();
        } else {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Error authenticating" + resp.getStatusLine());
            }
            return null;
        }
    } catch (final IOException e) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "IOException when getting authtoken", e);
        }
        return null;
    } catch (ParseException e) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "ParseException when getting authtoken", e);
        }
        return null;
    } finally {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "getAuthtoken completing");
        }
    }
}

From source file:edu.cmu.android.restaurant.authentication.NetworkUtilities.java

/**
 * Connects to the Voiper server, authenticates the provided username and
 * password./* ww  w.j a  v a  2s.  com*/
 * 
 * @param username
 *            The user's username
 * @param password
 *            The user's password
 * @param handler
 *            The hander instance from the calling UI thread.
 * @param context
 *            The context of the calling Activity.
 * @return boolean The boolean result indicating whether the user was
 *         successfully authenticated.
 */
public static boolean authenticate(String username, String password, Handler handler, final Context context) {
    final HttpResponse resp;

    final ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair(PARAM_USERNAME, username));
    params.add(new BasicNameValuePair(PARAM_PASSWORD, password));
    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params);
    } catch (final UnsupportedEncodingException e) {
        // this should never happen.
        throw new AssertionError(e);
    }
    final HttpPost post = new HttpPost(AUTH_URI);
    post.addHeader(entity.getContentType());
    post.setEntity(entity);
    maybeCreateHttpClient();

    try {
        resp = mHttpClient.execute(post);
        if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Successful authentication");
            }
            sendResult(true, handler, context);
            return true;
        } else {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Error authenticating" + resp.getStatusLine());
            }
            sendResult(false, handler, context);
            return false;
        }
    } catch (final IOException e) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "IOException when getting authtoken", e);
        }
        sendResult(false, handler, context);
        return false;
    } finally {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "getAuthtoken completing");
        }
    }
}

From source file:com.senechaux.rutino.utils.NetworkUtilities.java

/**
 * Connects to the Voiper server, authenticates the provided username and password.
 * /*  w  w w  . j ava2  s.c o  m*/
 * @param username
 *            The user's username
 * @param password
 *            The user's password
 * @param handler
 *            The hander instance from the calling UI thread.
 * @param context
 *            The context of the calling Activity.
 * @return boolean The boolean result indicating whether the user was successfully authenticated.
 */
public static boolean authenticate(String username, String password, Handler handler, final Context context) {
    final HttpResponse resp;
    String response = "";
    final ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair(PARAM_USERNAME, username));
    params.add(new BasicNameValuePair(PARAM_PASSWORD, password));
    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params);
    } catch (final UnsupportedEncodingException e) {
        // this should never happen.
        throw new AssertionError(e);
    }

    final HttpPost post = new HttpPost(Constants.AUTH_URI);
    post.addHeader(entity.getContentType());
    post.setEntity(entity);
    maybeCreateHttpClient();

    try {
        resp = mHttpClient.execute(post);
        response = EntityUtils.toString(resp.getEntity());
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "Resp: " + resp.toString());
        }
        if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Successful authentication, resp: " + resp.toString());
            }
            sendResult(true, handler, context, response);
            return true;
        } else {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Error authenticating" + resp.getStatusLine());
            }
            sendResult(false, handler, context, response);
            return false;
        }
    } catch (final IOException e) {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "IOException when getting authtoken", e);
        }
        sendResult(false, handler, context, response);
        return false;
    } finally {
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Log.v(TAG, "getAuthtoken completing");
        }
    }
}

From source file:com.googlecode.eyesfree.testing.BaseAccessibilityInstrumentationTestCase.java

@Override
protected void setUp() throws Exception {
    super.setUp();

    LogUtils.setLogLevel(Log.VERBOSE);

    mInsCtx = getInstrumentation().getContext();
    mAppCtx = getInstrumentation().getTargetContext();
    mManager = (AccessibilityManager) mAppCtx.getSystemService(Context.ACCESSIBILITY_SERVICE);

    assertEquals(/*from ww w  . j a  v  a 2s .c o m*/
            "Has WRITE_SECURE_SETTINGS permission (did you run \"adb shell pm grant " + mInsCtx.getPackageName()
                    + " android.permission.WRITE_SECURE_SETTINGS\"?)",
            PackageManager.PERMISSION_GRANTED, mInsCtx.getPackageManager()
                    .checkPermission(permission.WRITE_SECURE_SETTINGS, mInsCtx.getPackageName()));

    AccessibilityService service = getService();

    // Ensure the TalkBack and system accessibility states are in sync.
    if ((service == null) || !mManager.isEnabled()) {
        disableAllServices();
        obtainNullTargetServiceSync();
        enableTargetService();
        obtainTargetServiceSync();

        service = getService();
    }

    assertNotNull("Connected to service", service);

    connectServiceListener();
}

From source file:com.android.screenspeak.formatter.TouchExplorationFormatter.java

/**
 * Formatter that returns an utterance to announce touch exploration.
 *///from   w  w w .j  av a  2s. co  m
@Override
public boolean format(AccessibilityEvent event, ScreenSpeakService context, Utterance utterance) {
    if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED
            && EventState.getInstance().hasEvent(EventState.EVENT_SKIP_FOCUS_PROCESSING_AFTER_GRANULARITY_MOVE,
                    SKIP_GRANULARITY_MOVE_FOCUS_TIMEOUT)) {
        EventState.getInstance().clearEvent(EventState.EVENT_SKIP_FOCUS_PROCESSING_AFTER_GRANULARITY_MOVE);
        return true;
    }

    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    final AccessibilityNodeInfoCompat sourceNode = record.getSource();
    final AccessibilityNodeInfoCompat focusedNode = getFocusedNode(event.getEventType(), sourceNode);

    // Drop the event if the source node was non-null, but the focus
    // algorithm decided to drop the event by returning null.
    if ((sourceNode != null) && (focusedNode == null)) {
        AccessibilityNodeInfoUtils.recycleNodes(sourceNode);
        return false;
    }

    LogUtils.log(this, Log.VERBOSE, "Announcing node: %s", focusedNode);

    // Populate the utterance.
    addDescription(utterance, focusedNode, event, sourceNode);
    addFeedback(utterance, focusedNode);

    // By default, touch exploration flushes all other events.
    utterance.getMetadata().putInt(Utterance.KEY_METADATA_QUEUING, DEFAULT_QUEUING_MODE);

    // Events formatted by this class should always advance continuous
    // reading, if active.
    utterance.addSpokenFlag(FeedbackItem.FLAG_ADVANCE_CONTINUOUS_READING);

    AccessibilityNodeInfoUtils.recycleNodes(sourceNode, focusedNode);

    return true;
}

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

/**
 * Given an {@link AccessibilityEvent}, obtains and speaks a long
 * hover utterance./*from w w w. jav  a 2 s  .com*/
 *
 * @param event The source event.
 */
private void speakLongHover(AccessibilityEvent event) {
    // Never speak hint text if the tutorial is active
    if (AccessibilityTutorialActivity.isTutorialActive()) {
        LogUtils.log(this, Log.VERBOSE, "Dropping long hover hint speech because tutorial is active.");
        return;
    }

    final AccessibilityRecordCompat record = new AccessibilityRecordCompat(event);
    AccessibilityNodeInfoCompat source = record.getSource();

    if (source == null) {
        return;
    }

    // If this was a HOVER_ENTER event, we need to compute the focused node.
    // TODO: We're already doing this in the touch exploration formatter --
    // maybe this belongs there instead?
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER) {
        source = AccessibilityNodeInfoUtils.findFocusFromHover(mContext, source);
        if (source == null) {
            return;
        }
    }

    final CharSequence text = mRuleProcessor.getHintForNode(source);
    source.recycle();

    // Use QUEUE mode so that we don't interrupt more important messages.
    mSpeechController.speak(text, SpeechController.QUEUE_MODE_QUEUE, FeedbackItem.FLAG_NO_HISTORY, null);
}