Java 类android.support.annotation.WorkerThread 实例源码

项目:javaide    文件:ExecuteActivity.java   
@WorkerThread
private void runProgram(Context context, JavaProjectFolder projectFile, int action, Intent intent) throws Exception {
    InputStream in = mConsoleEditText.getInputStream();

    File tempDir = getDir("dex", MODE_PRIVATE);
    switch (action) {
        case CompileHelper.Action.RUN: {
            CompileHelper.compileAndRun(context, in, tempDir, projectFile);
            break;
        }
        case CompileHelper.Action.RUN_DEX: {
            File dex = (File) intent.getSerializableExtra(CompileManager.DEX_FILE);
            if (dex != null) {
                String mainClass = projectFile.getMainClass().getName();
                CompileHelper.executeDex(context, in, dex, tempDir, mainClass);
            }
            break;
        }
    }
}
项目:sqlbrite-sqlcipher    文件:BriteDatabase.java   
/**
 * Delete rows from the specified {@code table} and notify any subscribed queries. This method
 * will not trigger a notification if no rows were deleted.
 *
 * @see SQLiteDatabase#delete(String, String, String[])
 */
@WorkerThread
public int delete(@NonNull String table, @Nullable String whereClause,
    @Nullable String... whereArgs) {
  SQLiteDatabase db = getWritableDatabase();

  if (logging) {
    log("DELETE\n  table: %s\n  whereClause: %s\n  whereArgs: %s", table, whereClause,
        Arrays.toString(whereArgs));
  }
  int rows = db.delete(table, whereClause, whereArgs);

  if (logging) log("DELETE affected %s %s", rows, rows != 1 ? "rows" : "row");

  if (rows > 0) {
    // Only send a table trigger if rows were affected.
    sendTableTrigger(Collections.singleton(table));
  }
  return rows;
}
项目:android-api    文件:EegeoNativeMapView.java   
@UiThread
public void surfaceChanged(final SurfaceHolder holder, int format, int width, int height) {
    runOnNativeThread(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            m_surfaceHolder = holder;
            if (m_surfaceHolder != null) {
                Surface surface = m_surfaceHolder.getSurface();
                if (surface.isValid()) {
                    nativeSetSurface(m_jniApiRunnerPtr, surface);
                }
            }
        }
    });
}
项目:android-api    文件:EegeoNativeMapView.java   
@UiThread
public void onPointerUp(final int primaryActionIndex, final int primaryActionIdentifier, final int pointerCount, final float[] x, final float y[], final int[] pointerIdentity, final int[] pointerIndex) {
    runOnNativeThread(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            nativeProcessPointerUp(m_jniApiRunnerPtr, primaryActionIndex, primaryActionIdentifier, pointerCount, x, y, pointerIdentity, pointerIndex);
        }
    });
    if (m_eeGeoMap == null) {
        Log.d("eegeo-android-sdk", "skipping input event -- map not ready");
        return;
    }
    if (x.length > 0) { // TODO: remove this and promote to native ITouchController
        Point mouseUpPoint = new Point((int) x[0], (int) y[0]);
        double distSquared = Math.pow(mouseUpPoint.x - m_mouseDownPoint.x, 2) + Math.pow(mouseUpPoint.y - m_mouseDownPoint.y, 2);
        if (distSquared < 25) {
            m_eeGeoMap.onTapped(mouseUpPoint);
        }
    }
}
项目:b-log    文件:LogFileImpl.java   
@WorkerThread
private void writeToFile() {
    if (mFiles.canWrite(mLogFile)) {
        List<LogMessage> list;

        synchronized (mLock) {
            list = new LinkedList<>(mCacheQueue);
            mCacheQueue.clear();
        }

        mFiles.writeToFile(list, mLogFile);
        if (mSetting.debuggable()) {
            mWriteCount ++;
        }
    }
}
项目:android-api    文件:EegeoMap.java   
@WorkerThread
private void jniOnIndoorEntered() {
    final IndoorMap indoorMap = IndoorsApiJniCalls.getIndoorMapData(m_eegeoMapApiPtr);
    final int currentIndoorFloor = IndoorsApiJniCalls.getCurrentFloorIndex(m_eegeoMapApiPtr);
    m_uiRunner.runOnUiThread(new Runnable() {
        @UiThread
        @Override
        public void run() {
            m_indoorMap = indoorMap;
            m_currentIndoorFloor = currentIndoorFloor;
            for (OnIndoorEnteredListener listener : m_onIndoorEnteredListeners) {
                listener.onIndoorEntered();
            }
        }
    });
}
项目:android-api    文件:TagApi.java   
@WorkerThread
public void notifyTagsLoaded()
{
    m_uiRunner.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            m_hasLoadedTags = true;
            m_loadInProgress = false;
            if(m_listener != null)
            {
                m_listener.onTagsLoadCompleted();
            }
            m_listener = null;
        }
    });
}
项目:android-api    文件:PolygonApi.java   
@WorkerThread
public int create(PolygonOptions polygonOptions, Polygon.AllowHandleAccess allowHandleAccess) throws InvalidParameterException {
    if (allowHandleAccess == null)
        throw new NullPointerException("Null access token. Method is intended for internal use by Polygon");

    if (polygonOptions.getPoints().size() < 2)
        throw new InvalidParameterException("PolygonOptions points must contain at least two elements");

    List<LatLng> exteriorPoints = polygonOptions.getPoints();
    List<List<LatLng>> holes = polygonOptions.getHoles();

    final int[] ringVertexCounts = buildRingVertexCounts(exteriorPoints, holes);
    final double[] allPointsDoubleArray = buildPointsArray(exteriorPoints, holes, ringVertexCounts);

    return nativeCreatePolygon(
            m_jniEegeoMapApiPtr,
            polygonOptions.getIndoorMapId(),
            polygonOptions.getIndoorFloorId(),
            polygonOptions.getElevation(),
            polygonOptions.getElevationMode().ordinal(),
            allPointsDoubleArray,
            ringVertexCounts,
            polygonOptions.getFillColor()
    );
}
项目:leanback-homescreen-channels    文件:SampleTvProvider.java   
@WorkerThread
static void setProgramViewCount(Context context, long programId, int numberOfViews) {
    Uri programUri = TvContractCompat.buildPreviewProgramUri(programId);
    try (Cursor cursor = context.getContentResolver().query(programUri, null, null, null,
            null)) {
        if (!cursor.moveToFirst()) {
            return;
        }
        PreviewProgram existingProgram = PreviewProgram.fromCursor(cursor);
        PreviewProgram.Builder builder = new PreviewProgram.Builder(existingProgram)
                .setInteractionCount(numberOfViews)
                .setInteractionType(TvContractCompat.PreviewProgramColumns
                        .INTERACTION_TYPE_VIEWS);
        int rowsUpdated = context.getContentResolver().update(
                TvContractCompat.buildPreviewProgramUri(programId),
                builder.build().toContentValues(), null, null);
        if (rowsUpdated != 1) {
            Log.e(TAG, "Update program failed");
        }
    }
}
项目:Recognize-it    文件:MediaReader.java   
/**
 * Get all the multimedia files, including videos and pictures.
 */
@WorkerThread
public ArrayList<AlbumFolder> getAllMedia() {
    Map<String, AlbumFolder> albumFolderMap = new HashMap<>();
    AlbumFolder allFileFolder = new AlbumFolder();
    allFileFolder.setChecked(true);
    allFileFolder.setName(mContext.getString(R.string.album_all_images_videos));

    scanImageFile(albumFolderMap, allFileFolder);
    scanVideoFile(albumFolderMap, allFileFolder);

    ArrayList<AlbumFolder> albumFolders = new ArrayList<>();
    Collections.sort(allFileFolder.getAlbumFiles());
    albumFolders.add(allFileFolder);

    for (Map.Entry<String, AlbumFolder> folderEntry : albumFolderMap.entrySet()) {
        AlbumFolder albumFolder = folderEntry.getValue();
        Collections.sort(albumFolder.getAlbumFiles());
        albumFolders.add(albumFolder);
    }
    return albumFolders;
}
项目:xlight_android_native    文件:ParticleDevice.java   
@WorkerThread
T getVariable(String variableName)
        throws ParticleCloudException, IOException, VariableDoesNotExistException {

    if (!device.deviceState.variables.containsKey(variableName)) {
        throw new VariableDoesNotExistException(variableName);
    }

    R reply;
    try {
        reply = callApi(variableName);
    } catch (RetrofitError e) {
        throw new ParticleCloudException(e);
    }

    if (!reply.coreInfo.connected) {
        // FIXME: we should be doing this "connected" check on _any_ reply that comes back
        // with a "coreInfo" block.
        device.cloud.onDeviceNotConnected(device.deviceState);
        throw new IOException("Device is not connected.");
    } else {
        return reply.result;
    }
}
项目:android-api    文件:BuildingsApi.java   
@WorkerThread
private void fetchBuildingInformation(int nativeHandle)
{
    final BuildingHighlight buildingHighlight = m_nativeHandleToBuildingHighlight.get(nativeHandle);

    if (buildingHighlight == null)
        throw new NullPointerException("BuildingHighlight object not found for nativeHandle");

    final BuildingInformation buildingInformation = nativeGetBuildingInformation(m_jniEegeoMapApiPtr, nativeHandle);
    if (buildingInformation != null) {
        m_uiRunner.runOnUiThread(new Runnable() {
            @UiThread
            @Override
            public void run() {
                buildingHighlight.setBuildingInformation(buildingInformation);
            }
        });
    }
}
项目:q-mail    文件:AttachmentInfoExtractor.java   
@WorkerThread
public List<AttachmentViewInfo> extractAttachmentInfoForView(List<Part> attachmentParts)
        throws MessagingException {

    List<AttachmentViewInfo> attachments = new ArrayList<>();
    for (Part part : attachmentParts) {
        AttachmentViewInfo attachmentViewInfo = extractAttachmentInfo(part);
        attachments.add(attachmentViewInfo);
    }

    return attachments;
}
项目:android-api    文件:BlueSphere.java   
@UiThread
private void updateElevation() {
    final double elevation = m_elevation;

    submit(new Runnable() {
        @WorkerThread
        public void run() {
            m_bluesphereApi.setElevation(BlueSphere.m_allowHandleAccess, elevation);
        }
    });
}
项目:q-mail    文件:MessageViewInfoExtractor.java   
@WorkerThread
public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations)
        throws MessagingException {

    ArrayList<Part> extraParts = new ArrayList<>();
    Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPart(message, extraParts);

    if (cryptoContentPart == null) {
        if (cryptoAnnotations != null && !cryptoAnnotations.isEmpty()) {
            Timber.e("Got crypto message cryptoContentAnnotations but no crypto root part!");
        }
        return extractSimpleMessageForView(message, message);
    }

    boolean isOpenPgpEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) &&
                    MessageCryptoStructureDetector.isMultipartEncryptedOpenPgpProtocol(cryptoContentPart)) ||
                    MessageCryptoStructureDetector.isPartPgpInlineEncrypted(cryptoContentPart);
    boolean isSMimeEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) &&
            MessageCryptoStructureDetector.isMultipartEncryptedSMimeProtocol(cryptoContentPart));
    if ((!QMail.isOpenPgpProviderConfigured() && isOpenPgpEncrypted) || (!QMail.isSMimeProviderConfigured() && isSMimeEncrypted)) {
        CryptoResultAnnotation noProviderAnnotation = CryptoResultAnnotation.createErrorAnnotation(
                CryptoError.SMIME_ENCRYPTED_NO_PROVIDER, null);
        return MessageViewInfo.createWithErrorState(message, false)
                .withCryptoData(noProviderAnnotation, null, null, null);
    }

    CryptoResultAnnotation cryptoContentPartAnnotation =
            cryptoAnnotations != null ? cryptoAnnotations.get(cryptoContentPart) : null;
    if (cryptoContentPartAnnotation != null) {
        return extractCryptoMessageForView(message, extraParts, cryptoContentPart, cryptoContentPartAnnotation);
    }

    return extractSimpleMessageForView(message, message);
}
项目:q-mail    文件:LocalMessageExtractorLoader.java   
@Override
@WorkerThread
public MessageViewInfo loadInBackground() {
    try {
        return messageViewInfoExtractor.extractMessageForView(message, annotations);
    } catch (Exception e) {
        Timber.e(e, "Error while decoding message");
        return null;
    }
}
项目:android-api    文件:MapsceneApi.java   
@UiThread
public MapsceneRequest requestMapscene(final MapsceneRequestOptions options) {
    MapsceneRequest request = new MapsceneRequest(
            this,
            options.getApplyOnLoad(),
            options.getOnMapsceneRequestCompletedListener(),
            new Callable<Integer>() {
                @WorkerThread
                @Override
                public Integer call() throws Exception {
                    return beginMapsceneRequest(options);
                }
            });
    return request;
}
项目:q-mail    文件:AttachmentTempFileProvider.java   
@WorkerThread
public static Uri createTempUriForContentUri(Context context, Uri uri) throws IOException {
    Context applicationContext = context.getApplicationContext();

    File tempFile = getTempFileForUri(uri, applicationContext);
    writeUriContentToTempFileIfNotExists(context, uri, tempFile);
    Uri tempFileUri = FileProvider.getUriForFile(context, AUTHORITY, tempFile);

    registerFileCleanupReceiver(applicationContext);

    return tempFileUri;
}
项目:android-api    文件:EegeoNativeMapView.java   
@WorkerThread
public long create(EegeoMap eegeoMap, EegeoMapOptions eegeoMapOptions) {
    String apiKey = EegeoApi.getInstance().getApiKey();
    String coverageTreeManifest = eegeoMapOptions.getCoverageTreeManifest();
    if (coverageTreeManifest == null) {
        coverageTreeManifest = "";
    }
    String environmentThemesManifest = eegeoMapOptions.getEnvironmentThemesManifest();
    if (environmentThemesManifest == null) {
        environmentThemesManifest = "";
    }
    long jniEegeoMapApiPtr = nativeCreateEegeoMapApi(m_jniApiRunnerPtr, eegeoMap, apiKey, coverageTreeManifest, environmentThemesManifest);
    return jniEegeoMapApiPtr;
}
项目:xlight_android_native    文件:ParticleCloud.java   
/**
 * Get a short-lived claiming token for transmitting to soon-to-be-claimed device in
 * soft AP setup process
 *
 * @return a claim code string set on success (48 random bytes, base64 encoded
 * to 64 ASCII characters)
 */
@WorkerThread
public Responses.ClaimCodeResponse generateClaimCode() throws ParticleCloudException {
    try {
        // Offer empty string to appease newer OkHttp versions which require a POST body,
        // even if it's empty or (as far as the endpoint cares) nonsense
        return mainApi.generateClaimCode("okhttp_appeasement");
    } catch (RetrofitError error) {
        throw new ParticleCloudException(error);
    }
}
项目:sqlbrite-sqlcipher    文件:BriteDatabase.java   
/**
 * See {@link #executeUpdateDelete(String, SQLiteStatement)} for usage. This overload allows for triggering multiple tables.
 *
 * @see BriteDatabase#executeUpdateDelete(String, SQLiteStatement)
 */
@WorkerThread
@RequiresApi(Build.VERSION_CODES.HONEYCOMB)
public int executeUpdateDelete(Set<String> tables, SQLiteStatement statement) {
  if (logging) log("EXECUTE\n %s", statement);

  int rows = statement.executeUpdateDelete();
  if (rows > 0) {
    // Only send a table trigger if rows were affected.
    sendTableTrigger(tables);
  }
  return rows;
}
项目:FirefoxData-android    文件:FirefoxSyncBookmarks.java   
/**
 * Gets the bookmarks associated with the given account.
 *
 * Both the request and the callback occur on the calling thread (this is unintuitive: issue #3).
 *
 * @param itemLimit The number of items to fetch. If < 0, fetches all items.
 */
@WorkerThread // network request.
static void getBlocking(final FirefoxSyncConfig syncConfig, final int itemLimit, final OnSyncComplete<BookmarkFolder> onComplete) {
    final SyncClientBookmarksResourceDelegate resourceDelegate = new SyncClientBookmarksResourceDelegate(syncConfig, onComplete);
    try {
        FirefoxSyncUtils.makeGetRequestForCollection(syncConfig, BOOKMARKS_COLLECTION, getArgs(itemLimit), resourceDelegate);
    } catch (final FirefoxDataException e) {
        onComplete.onException(e);
    }
}
项目:android-api    文件:EegeoNativeMapView.java   
@UiThread
public void onDestroy() {
    Log.d("eegeo-android-sdk", "onDestroy");

    runOnNativeThread(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            Log.d("eegeo-android-sdk", "Native Thread: onDestroy");
            m_nativeThread.stopUpdating();
            nativeDestroyApiRunner(m_jniApiRunnerPtr);
            m_jniApiRunnerPtr = 0;
            synchronized (m_nativeThread) {
                m_nativeThread.notifyAll();
            }
        }
    });

    Log.d("eegeo-android-sdk", "begin wait nativeDestroyApiRunner");
    synchronized (m_nativeThread) {
        try {
            m_nativeThread.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    Log.d("eegeo-android-sdk", "end wait nativeDestroyApiRunner");

    m_nativeThread.quit();
}
项目:android-api    文件:EegeoNativeMapView.java   
@UiThread
public void onPause() {
    Log.d("eegeo-android-sdk", "onPause");

    runOnNativeThread(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            m_nativeThread.stopUpdating();
            nativePauseApiRunner(m_jniApiRunnerPtr);
        }
    });
}
项目:android-api    文件:PolylineApi.java   
@WorkerThread
public int create(PolylineOptions polylineOptions, Polyline.AllowHandleAccess allowHandleAccess) throws InvalidParameterException {
    if (allowHandleAccess == null)
        throw new NullPointerException("Null access token. Method is intended for internal use by Polyline");

    if (polylineOptions.getPoints().size() < 2)
        throw new InvalidParameterException("PolylineOptions points must contain at least two elements");

    double[] latLongs = pointsToArray(polylineOptions.getPoints());

    List<Double> perPointElevationsList = polylineOptions.getPerPointElevations();
    double[] perPointElevations = new double[perPointElevationsList.size()];
    for (int i = 0; i < perPointElevationsList.size(); ++i) {
        perPointElevations[i] = perPointElevationsList.get(i);
    }


    return nativeCreatePolyline(
            m_jniEegeoMapApiPtr,
            polylineOptions.getIndoorMapId(),
            polylineOptions.getIndoorFloorId(),
            polylineOptions.getElevation(),
            polylineOptions.getElevationMode().ordinal(),
            latLongs,
            perPointElevations,
            polylineOptions.getWidth(),
            polylineOptions.getColor(),
            polylineOptions.getMiterLimit()
    );
}
项目:xlight_android_native    文件:ParticleDevice.java   
/**
 * Call a function on the device
 *
 * @param functionName Function name
 * @param args         Array of arguments to pass to the function on the device.
 *                     Arguments must not be more than MAX_PARTICLE_FUNCTION_ARG_LENGTH chars
 *                     in length. If any arguments are longer, a runtime exception will be thrown.
 * @return result code: a value of 1 indicates success
 */
@WorkerThread
public int callFunction(String functionName, @Nullable List<String> args)
        throws ParticleCloudException, IOException, FunctionDoesNotExistException {
    // TODO: check response of calling a non-existent function
    if (!deviceState.functions.contains(functionName)) {
        throw new FunctionDoesNotExistException(functionName);
    }

    // null is accepted here, but it won't be in the Retrofit API call later
    if (args == null) {
        args = list();
    }

    String argsString = ParticleInternalStringUtils.join(args, ',');
    Preconditions.checkArgument(argsString.length() < MAX_PARTICLE_FUNCTION_ARG_LENGTH,
            String.format("Arguments '%s' exceed max args length of %d",
                    argsString, MAX_PARTICLE_FUNCTION_ARG_LENGTH));

    Responses.CallFunctionResponse response;
    try {
        response = mainApi.callFunction(deviceState.deviceId, functionName,
                new FunctionArgs(argsString));
    } catch (RetrofitError e) {
        throw new ParticleCloudException(e);
    }

    if (!response.connected) {
        cloud.onDeviceNotConnected(deviceState);
        throw new IOException("Device is not connected.");
    } else {
        return response.returnValue;
    }
}
项目:android-api    文件:BlueSphere.java   
@UiThread
private void updateEnabled() {
    final boolean enabled = m_enabled;

    submit(new Runnable() {
        @WorkerThread
        public void run() {
            m_bluesphereApi.setEnabled(BlueSphere.m_allowHandleAccess, enabled);
        }
    });
}
项目:android-api    文件:EegeoNativeMapView.java   
@UiThread
public void onResume() {
    runOnNativeThread(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            if (m_surfaceHolder != null && m_surfaceHolder.getSurface() != null) {
                nativeSetSurface(m_jniApiRunnerPtr, m_surfaceHolder.getSurface());

                nativeResumeApiRunner(m_jniApiRunnerPtr);
            }
            m_nativeThread.startUpdating();
        }
    });
}
项目:b-log    文件:BLog.java   
/**
 * Sync log message to file.
 */
@WorkerThread
public static void syncLog(int priority, String message) {
    if (checkInit()) {
        sLogEngine.syncLog(priority, null, message);
    }
}
项目:goblin-lib    文件:BaseSyncableDao.java   
@WorkerThread
public boolean updateAfterSync(HashSet<T> tHashSet) {
    LinkedHashSet<ParamUpdate> paramUpdates = new LinkedHashSet<>();
    for(T t : tHashSet){
        paramUpdates.add(new ParamUpdate(getTableName(), getIdFieldName() + " = ?", new String[]{t.id},
                getSyncContentValuesAfterSync(t)));
    }

    return BaseDao.bulkUpdate(paramUpdates) >= tHashSet.size();
}
项目:Xndroid    文件:HistoryDatabase.java   
@WorkerThread
@NonNull
private synchronized SQLiteDatabase lazyDatabase() {
    if (mDatabase == null || !mDatabase.isOpen()) {
        mDatabase = this.getWritableDatabase();
    }
    return mDatabase;
}
项目:android-api    文件:EegeoMap.java   
@WorkerThread
private void jniOnCameraMove() {
    m_uiRunner.runOnUiThread(new Runnable() {
        @UiThread
        @Override
        public void run() {
            for (OnCameraMoveListener listener : m_onCameraMoveListeners) {
                listener.onCameraMove();
            }
        }
    });
}
项目:goblin-lib    文件:BaseDao.java   
@WorkerThread
private Cursor query(Param param){
    SQLiteQueryBuilder sqLiteQueryBuilder = getQueryBuilder();
    Cursor c;
    if(sqLiteQueryBuilder != null){
        c = sqLiteQueryBuilder.query(
                Database.getDatabase(),
                param.projection,
                param.selection,
                param.selectionArgs,
                null, null,
                param.sortOrder
        );
    }
    else {
        c = Database.getDatabase().query(
                getTableName(),
                param.projection,
                param.selection,
                param.selectionArgs,
                null, null,
                param.sortOrder
        );
    }

    return c;
}
项目:b-log    文件:BLog.java   
/**
 * Zipping log files and return the zip file.
 */
@WorkerThread
public static File zippingLogFiles(int mode, List<File> attaches) {
    if (checkInit()) {
        return sLogEngine.zippingFiles(mode, attaches);
    }
    return null;
}
项目:android-api    文件:NativeApiObject.java   
@WorkerThread
protected int getNativeHandle() {
    if (m_nativeHandle == null)
        throw new RuntimeException("nativeHandle not yet available, ensure all calls to getNativeHandle are wrapped by submit()");

    return m_nativeHandle.intValue();
}
项目:Xndroid    文件:HistoryDatabase.java   
@WorkerThread
@Nullable
synchronized String getHistoryItem(@NonNull String url) {
    Cursor cursor = lazyDatabase().query(TABLE_HISTORY, new String[]{KEY_ID, KEY_URL, KEY_TITLE},
        KEY_URL + " = ?", new String[]{url}, null, null, null, "1");
    String m = null;
    if (cursor != null) {
        cursor.moveToFirst();
        m = cursor.getString(0);

        cursor.close();
    }
    return m;
}
项目:android-api    文件:PoiSearch.java   
@UiThread
PoiSearch(final PoiApi poiApi, OnPoiSearchCompletedListener callback, Callable<Integer> beginSearchCallable) {
    super(poiApi.getNativeRunner(), poiApi.getUiRunner(), beginSearchCallable);

    m_poiApi = poiApi;
    m_callback = callback;

    submit(new Runnable() {
        @WorkerThread
        @Override
        public void run() {
            m_poiApi.register(PoiSearch.this, getNativeHandle());
        }
    });
}
项目:android-api    文件:EegeoMap.java   
@WorkerThread
private void jniOnIndoorEnterFailed() {
    m_uiRunner.runOnUiThread(new Runnable() {
        public void run() {
            m_indoorMap = null;
            m_currentIndoorFloor = -1;
        }
    });
}
项目:android-api    文件:BlueSphereApi.java   
@WorkerThread
public void setElevation(BlueSphere.AllowHandleAccess allowHandleAccess, double elevation) {
    if (allowHandleAccess == null)
        throw new NullPointerException("Null access token. Method is intended for internal use by BlueSphere");


    nativeSetElevation(
            m_jniEegeoMapApiPtr,
            elevation);
}
项目:xlight_android_native    文件:ParticleCloud.java   
@WorkerThread
void unclaimDevice(String deviceId) {
    mainApi.unclaimDevice(deviceId);
    synchronized (devices) {
        devices.remove(deviceId);
    }
    sendUpdateBroadcast();
}