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


Java Config.LOGV属性代码示例

本文整理汇总了Java中android.util.Config.LOGV属性的典型用法代码示例。如果您正苦于以下问题:Java Config.LOGV属性的具体用法?Java Config.LOGV怎么用?Java Config.LOGV使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.util.Config的用法示例。


在下文中一共展示了Config.LOGV属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColumnIndex

public int getColumnIndex(String columnName) {
    // Hack according to bug 903852
    final int periodIndex = columnName.lastIndexOf('.');
    if (periodIndex != -1) {
        Exception e = new Exception();
        Log.e(TAG, "requesting column name with table name -- " + columnName, e);
        columnName = columnName.substring(periodIndex + 1);
    }

    String columnNames[] = getColumnNames();
    int length = columnNames.length;
    for (int i = 0; i < length; i++) {
        if (columnNames[i].equalsIgnoreCase(columnName)) {
            return i;
        }
    }

    if (Config.LOGV) {
        if (getCount() > 0) {
            Log.w("AbstractCursor", "Unknown column " + columnName);
        }
    }
    return -1;
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:24,代码来源:AbstractCursor.java

示例2: finalize

/**
 * Release the native resources, if they haven't been released yet.
 */
@Override
protected void finalize() {
    try {
        // if the cursor hasn't been closed yet, close it first
        if (mWindow != null) {
            int len = mQuery.mSql.length();
            Log.e(TAG, "Finalizing a Cursor that has not been deactivated or closed. " +
                    "database = " + mDatabase.getPath() + ", table = " + mEditTable +
                    ", query = " + mQuery.mSql.substring(0, (len > 100) ? 100 : len),
                    mStackTrace);
            close();
            SQLiteDebug.notifyActiveCursorFinalized();
        } else {
            if (Config.LOGV) {
                Log.v(TAG, "Finalizing cursor on database = " + mDatabase.getPath() +
                        ", table = " + mEditTable + ", query = " + mQuery.mSql);
            }
        }
    } finally {
        super.finalize();
    }
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:25,代码来源:SQLiteCursor.java

示例3: onContentChangedInternal

/**
 * Called when the {@link ContentObserver} on the cursor receives a change notification.
 * The default implementation provides the auto-requery logic, but may be overridden by
 * sub classes.
 *
 * @see ContentObserver#onChange(boolean)
 */
// renamed from Android source so as not to conflict with RobolectricWiringTest
protected void onContentChangedInternal() {
  if (mAutoRequery && mCursor != null && !mCursor.isClosed()) {
    if (Config.LOGV) Log.v("Cursor", "Auto requerying " + mCursor + " due to update");
    mDataValid = mCursor.requery();
  }
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:14,代码来源:ShadowCursorAdapter.java

示例4: SQLiteCursor

/**
 * Execute a query and provide access to its result set through a Cursor
 * interface. For a query such as: {@code SELECT name, birth, phone FROM
 * myTable WHERE ... LIMIT 1,20 ORDER BY...} the column names (name, birth,
 * phone) would be in the projection argument and everything from
 * {@code FROM} onward would be in the params argument. This constructor
 * has package scope.
 *
 * @param db a reference to a Database object that is already constructed
 *     and opened
 * @param editTable the name of the table used for this query
 * @param query the rest of the query terms
 *     cursor is finalized
 */
public SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver,
        String editTable, SQLiteQuery query) {
    // The AbstractCursor constructor needs to do some setup.
    super();
    mStackTrace = new DatabaseObjectNotClosedException().fillInStackTrace();
    mDatabase = db;
    mDriver = driver;
    mEditTable = editTable;
    mColumnNameMap = null;
    mQuery = query;

    try {
        db.lock();

        // Setup the list of columns
        int columnCount = mQuery.columnCountLocked();
        mColumns = new String[columnCount];

        // Read in all column names
        for (int i = 0; i < columnCount; i++) {
            String columnName = mQuery.columnNameLocked(i);
            mColumns[i] = columnName;
            if (Config.LOGV) {
                Log.v("DatabaseWindow", "mColumns[" + i + "] is "
                        + mColumns[i]);
            }

            // Make note of the row ID column index for quick access to it
            if ("_id".equals(columnName)) {
                mRowIdColumnIndex = i;
            }
        }
    } finally {
        db.unlock();
    }
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:50,代码来源:SQLiteCursor.java

示例5: deactivateCommon

private void deactivateCommon() {
    if (Config.LOGV) Log.v(TAG, "<<< Releasing cursor " + this);
    mCursorState = 0;
    if (mWindow != null) {
        mWindow.close();
        mWindow = null;
    }
    if (Config.LOGV) Log.v("DatabaseWindow", "closing window in release()");
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:9,代码来源:SQLiteCursor.java

示例6: v

public static void v(String TAG, String logMe) {
    if (Config.LOGV) android.util.Log.v(LOGTAG, TAG + ": " + logMe);
}
 
开发者ID:leinardi,项目名称:KitchenTimer,代码行数:3,代码来源:Log.java

示例7: createSmilDocument

private static SMILDocument createSmilDocument(PduBody pb) {
    if (Config.LOGV) {
        Log.v(TAG, "Creating default SMIL document.");
    }

    SMILDocument document = new SmilDocumentImpl();

    // Create root element.
    // FIXME: Should we create root element in the constructor of document?
    SMILElement smil = (SMILElement) document.createElement("smil");
    smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
    document.appendChild(smil);

    // Create <head> and <layout> element.
    SMILElement head = (SMILElement) document.createElement("head");
    smil.appendChild(head);

    SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
    head.appendChild(layout);

    // Create <body> element and add a empty <par>.
    SMILElement body = (SMILElement) document.createElement("body");
    smil.appendChild(body);
    SMILParElement par = addPar(document);

    // Create media objects for the parts in PDU.
    int partsNum = pb.getPartsNum();
    if (partsNum == 0) {
        return document;
    }

    DrmManagerClient drmManagerClient = QKSMSApp.getApplication().getDrmManagerClient();

    boolean hasText = false;
    boolean hasMedia = false;
    for (int i = 0; i < partsNum; i++) {
        // Create new <par> element.
        if ((par == null) || (hasMedia && hasText)) {
            par = addPar(document);
            hasText = false;
            hasMedia = false;
        }

        PduPart part = pb.getPart(i);
        String contentType = new String(part.getContentType());

        if (ContentType.isDrmType(contentType)) {
            contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
        }

        if (contentType.equals(ContentType.TEXT_PLAIN)
                || contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
                || contentType.equals(ContentType.TEXT_HTML)) {
            SMILMediaElement textElement = createMediaElement(
                    ELEMENT_TAG_TEXT, document, part.generateLocation());
            par.appendChild(textElement);
            hasText = true;
        } else if (ContentType.isImageType(contentType)) {
            SMILMediaElement imageElement = createMediaElement(
                    ELEMENT_TAG_IMAGE, document, part.generateLocation());
            par.appendChild(imageElement);
            hasMedia = true;
        } else if (ContentType.isVideoType(contentType)) {
            SMILMediaElement videoElement = createMediaElement(
                    ELEMENT_TAG_VIDEO, document, part.generateLocation());
            par.appendChild(videoElement);
            hasMedia = true;
        } else if (ContentType.isAudioType(contentType)) {
            SMILMediaElement audioElement = createMediaElement(
                    ELEMENT_TAG_AUDIO, document, part.generateLocation());
            par.appendChild(audioElement);
            hasMedia = true;
        } else {
            // TODO: handle other media types.
            Log.w(TAG, "unsupport media type");
        }
    }

    return document;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:80,代码来源:SmilHelper.java

示例8: getCallerInfo

/**
 * getCallerInfo given a Cursor.
 * @param context the context used to retrieve string constants
 * @param contactRef the URI to attach to this CallerInfo object
 * @param cursor the first object in the cursor is used to build the CallerInfo object.
 * @return the CallerInfo which contains the caller id for the given
 * number. The returned CallerInfo is null if no number is supplied.
 */
public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) {
    
    CallerInfo info = new CallerInfo();
    info.photoResource = 0;
    info.phoneLabel = null;
    info.numberType = 0;
    info.numberLabel = null;
    info.cachedPhoto = null;
    info.isCachedPhotoCurrent = false;
    
    if (Config.LOGV) Log.v(TAG, "construct callerInfo from cursor");
    
    if (cursor != null) {
        while (cursor.moveToNext()) {

            int columnIndex;

            // Look for the number
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.NUMBER);
            if (columnIndex != -1) {
                info.phoneNumber = cursor.getString(columnIndex);
            }
            
            // Look for the name
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME);
            if (columnIndex != -1) {
                info.name = cursor.getString(columnIndex);
            }

            // Look for the label/type combo
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.LABEL);
            if (columnIndex != -1) {
                int typeColumnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.TYPE);
                if (typeColumnIndex != -1) {
                    info.numberType = cursor.getInt(typeColumnIndex);
                    info.numberLabel = cursor.getString(columnIndex);
                    info.phoneLabel = ContactsContract.CommonDataKinds.Phone.getTypeLabel(context.getResources(),
                            info.numberType, info.numberLabel)
                            .toString();
                }
            }

            // Look for the person ID
            columnIndex = cursor.getColumnIndex(Phone.CONTACT_ID);
            if (columnIndex != -1) {
                    info.person_id = cursor.getLong(columnIndex);
            }
        }
        cursor.close();
    }

    info.needUpdate = false;
    info.name = normalize(info.name);
    info.contactRefUri = contactRef;

    return info;
}
 
开发者ID:mnhkahn,项目名称:cInterphone,代码行数:65,代码来源:CallerInfo.java

示例9: rawQueryWithFactory

/**
 * Runs the provided SQL and returns a cursor over the result set.
 *
 * @param cursorFactory the cursor factory to use, or null for the default factory
 * @param sql the SQL query. The SQL string must not be ; terminated
 * @param selectionArgs You may include ?s in where clause in the query,
 *     which will be replaced by the values from selectionArgs. The
 *     values will be bound as Strings.
 * @param editTable the name of the first table, which is editable
 * @return A {@link Cursor} object, which is positioned before the first entry. Note that
 * {@link Cursor}s are not synchronized, see the documentation for more details.
 */
public Cursor rawQueryWithFactory(
                                  CursorFactory cursorFactory, String sql, String[] selectionArgs,
                                  String editTable) {
    if (!isOpen()) {
        throw new IllegalStateException("database not open");
    }
    long timeStart = 0;

    if (Config.LOGV || mSlowQueryThreshold != -1) {
        timeStart = System.currentTimeMillis();
    }

    SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, editTable);

    Cursor cursor = null;
    try {
        cursor = driver.query(
                              cursorFactory != null ? cursorFactory : mFactory,
                              selectionArgs);
    } finally {
        if (Config.LOGV || mSlowQueryThreshold != -1) {

            // Force query execution
            int count = -1;
            if (cursor != null) {
                count = cursor.getCount();
            }

            long duration = System.currentTimeMillis() - timeStart;

            if (Config.LOGV || duration >= mSlowQueryThreshold) {
                Log.v(TAG,
                      "query (" + duration + " ms): " + driver.toString() + ", args are "
                      + (selectionArgs != null
                         ? TextUtils.join(",", selectionArgs)
                         : "<null>")  + ", count is " + count);
            }
        }
    }
    return new CrossProcessCursorWrapper(cursor);
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:53,代码来源:SQLiteDatabase.java

示例10: requery

@Override
public boolean requery() {
    if (isClosed()) {
        return false;
    }
    long timeStart = 0;
    if (Config.LOGV) {
        timeStart = System.currentTimeMillis();
    }
    /*
     * Synchronize on the database lock to ensure that mCount matches the
     * results of mQuery.requery().
     */
    mDatabase.lock();
    try {
        if (mWindow != null) {
            mWindow.clear();
        }
        mPos = -1;
        // This one will recreate the temp table, and get its count
        mDriver.cursorRequeried(this);
        mCount = NO_COUNT;
        mCursorState++;
        queryThreadLock();
        try {
            mQuery.requery();
        } finally {
            queryThreadUnlock();
        }
    } finally {
        mDatabase.unlock();
    }

    if (Config.LOGV) {
        Log.v("DatabaseWindow", "closing window in requery()");
        Log.v(TAG, "--- Requery()ed cursor " + this + ": " + mQuery);
    }

    boolean result = super.requery();
    if (Config.LOGV) {
        long timeEnd = System.currentTimeMillis();
        Log.v(TAG, "requery (" + (timeEnd - timeStart) + " ms): " + mDriver.toString());
    }
    return result;
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:45,代码来源:SQLiteCursor.java

示例11: createSmilDocument

private static SMILDocument createSmilDocument(PduBody pb) {
    if (Config.LOGV) {
        Log.v(TAG, "Creating default SMIL document.");
    }

    SMILDocument document = new SmilDocumentImpl();

    // Create root element.
    // FIXME: Should we create root element in the constructor of document?
    SMILElement smil = (SMILElement) document.createElement("smil");
    smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
    document.appendChild(smil);

    // Create <head> and <layout> element.
    SMILElement head = (SMILElement) document.createElement("head");
    smil.appendChild(head);

    SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
    head.appendChild(layout);

    // Create <body> element and add a empty <par>.
    SMILElement body = (SMILElement) document.createElement("body");
    smil.appendChild(body);
    SMILParElement par = addPar(document);

    // Create media objects for the parts in PDU.
    int partsNum = pb.getPartsNum();
    if (partsNum == 0) {
        return document;
    }

    DrmManagerClient drmManagerClient = MmsApp.getApplication().getDrmManagerClient();

    boolean hasText = false;
    boolean hasMedia = false;
    for (int i = 0; i < partsNum; i++) {
        // Create new <par> element.
        if ((par == null) || (hasMedia && hasText)) {
            par = addPar(document);
            hasText = false;
            hasMedia = false;
        }

        PduPart part = pb.getPart(i);
        String contentType = new String(part.getContentType());

        if (ContentType.isDrmType(contentType)) {
            contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
        }

        if (contentType.equals(ContentType.TEXT_PLAIN)
                || contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
                || contentType.equals(ContentType.TEXT_HTML)) {
            SMILMediaElement textElement = createMediaElement(
                    ELEMENT_TAG_TEXT, document, part.generateLocation());
            par.appendChild(textElement);
            hasText = true;
        } else if (ContentType.isImageType(contentType)) {
            SMILMediaElement imageElement = createMediaElement(
                    ELEMENT_TAG_IMAGE, document, part.generateLocation());
            par.appendChild(imageElement);
            hasMedia = true;
        } else if (ContentType.isVideoType(contentType)) {
            SMILMediaElement videoElement = createMediaElement(
                    ELEMENT_TAG_VIDEO, document, part.generateLocation());
            par.appendChild(videoElement);
            hasMedia = true;
        } else if (ContentType.isAudioType(contentType)) {
            SMILMediaElement audioElement = createMediaElement(
                    ELEMENT_TAG_AUDIO, document, part.generateLocation());
            par.appendChild(audioElement);
            hasMedia = true;
        } else {
            // TODO: handle other media types.
            Log.w(TAG, "unsupport media type");
        }
    }

    return document;
}
 
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:80,代码来源:SmilHelper.java


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