类androidx.annotation.RestrictTo源码实例Demo

下面列出了怎么用androidx.annotation.RestrictTo的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * Removes an AppKey index that was added to the node
 *
 * @param index AppKey index
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
protected final void removeAddedAppKeyIndex(final int index) {
    for (int i = 0; i < mAddedAppKeys.size(); i++) {
        final int keyIndex = mAddedAppKeys.get(i).getIndex();
        if (keyIndex == index) {
            mAddedAppKeys.remove(i);
            for (Map.Entry<Integer, Element> elementEntry : getElements().entrySet()) {
                final Element element = elementEntry.getValue();
                for (Map.Entry<Integer, MeshModel> modelEntry : element.getMeshModels().entrySet()) {
                    final MeshModel model = modelEntry.getValue();
                    if (model != null) {
                        for (int j = 0; j < model.getBoundAppKeyIndexes().size(); j++) {
                            final int boundKeyIndex = model.getBoundAppKeyIndexes().get(j);
                            if (boundKeyIndex == index) {
                                model.mBoundAppKeyIndexes.remove(j);
                                break;
                            }
                        }
                    }
                }
            }
            break;
        }
    }
}
 
源代码2 项目: Android-nRF-Mesh-Library   文件: MeshNetworkDb.java
/**
 * Returns the mesh database
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
static MeshNetworkDb getDatabase(final Context context) {
    if (INSTANCE == null) {
        synchronized (MeshNetworkDb.class) {
            if (INSTANCE == null) {
                INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
                        MeshNetworkDb.class, "mesh_network_database.db")
                        .addCallback(sRoomDatabaseCallback)
                        .addMigrations(MIGRATION_1_2)
                        .addMigrations(MIGRATION_2_3)
                        .addMigrations(MIGRATION_3_4)
                        .addMigrations(MIGRATION_4_5)
                        .addMigrations(MIGRATION_5_6)
                        .addMigrations(MIGRATION_6_7)
                        .addMigrations(MIGRATION_7_8)
                        .addMigrations(MIGRATION_8_9)
                        .build();
            }

        }
    }
    return INSTANCE;
}
 
源代码3 项目: firebase-android-sdk   文件: TransportContext.java
/**
 * Returns a copy of the context with modified {@link Priority}.
 *
 * @hide
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public TransportContext withPriority(Priority priority) {
  return builder()
      .setBackendName(getBackendName())
      .setPriority(priority)
      .setExtras(getExtras())
      .build();
}
 
源代码4 项目: FairEmail   文件: OperationMonitor.java
/** @hide */
@RestrictTo(LIBRARY)
@MainThread
synchronized void reset() {
    if (DEBUG) Log.d(TAG, "Received reset request.");
    if (mNumOps > 0) {
        Log.w(TAG, "Resetting OperationMonitor with " + mNumOps + " active operations.");
    }
    mNumOps = 0;
    notifyStateChanged();
}
 
源代码5 项目: FairEmail   文件: RoomDatabase.java
/**
 * Asserts that we are not on a suspending transaction.
 *
 * @hide
 */
@SuppressWarnings("WeakerAccess")
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// used in generated code
public void assertNotSuspendingTransaction() {
    if (!inTransaction() && mSuspendingTransactionId.get() != null) {
        throw new IllegalStateException("Cannot access database on a different coroutine"
                + " context inherited from a suspending transaction.");
    }
}
 
源代码6 项目: Android-nRF-Mesh-Library   文件: Group.java
/**
 * Sets the group address label
 *
 * @param uuidLabel UUID label of the address
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setAddressLabel(@Nullable final UUID uuidLabel) {
    addressLabel = uuidLabel;
    if (uuidLabel != null) {
        address = MeshAddress.generateVirtualAddress(uuidLabel);
    }
}
 
源代码7 项目: firebase-android-sdk   文件: DeleteStorageTask.java
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public DeleteStorageTask(
    @NonNull StorageReference storageRef, @NonNull TaskCompletionSource<Void> pendingResult) {
  Preconditions.checkNotNull(storageRef);
  Preconditions.checkNotNull(pendingResult);
  this.mStorageRef = storageRef;
  this.mPendingResult = pendingResult;

  FirebaseStorage storage = mStorageRef.getStorage();
  mSender =
      new ExponentialBackoffSender(
          storage.getApp().getApplicationContext(),
          storage.getAuthProvider(),
          storage.getMaxDownloadRetryTimeMillis());
}
 
/**
 * Constructor to be used only by hte library
 *
 * @param node {@link UnprovisionedMeshNode}
 */
@Ignore
@RestrictTo(RestrictTo.Scope.LIBRARY)
public ProvisionedMeshNode(final UnprovisionedMeshNode node) {
    uuid = node.getDeviceUuid().toString();
    isConfigured = node.isConfigured();
    nodeName = node.getNodeName();
    mAddedNetKeys.add(new NodeKey(node.getKeyIndex()));
    mFlags = node.getFlags();
    unicastAddress = node.getUnicastAddress();
    deviceKey = node.getDeviceKey();
    ttl = node.getTtl();
    final NetworkKey networkKey = new NetworkKey(node.getKeyIndex(), node.getNetworkKey());
    mTimeStampInMillis = node.getTimeStamp();
}
 
源代码9 项目: firebase-android-sdk   文件: DatabaseError.java
/**
 * <strong>For internal use</strong>
 *
 * @hide
 * @param code The error code
 * @return An error corresponding the to the code
 */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static DatabaseError fromCode(int code) {
  if (!errorReasons.containsKey(code)) {
    throw new IllegalArgumentException("Invalid Firebase Database error code: " + code);
  }
  String message = errorReasons.get(code);
  return new DatabaseError(code, message, null);
}
 
/**
 * Update an app key's updated state
 *
 * @param index AppKey index
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
protected final void updateAddedAppKey(final int index) {
    final NodeKey nodeKey = MeshParserUtils.getNodeKey(mAddedNetKeys, index);
    if (nodeKey != null) {
        nodeKey.setUpdated(true);
    }
}
 
源代码11 项目: crashx   文件: CrashActivity.java
@RestrictTo(RestrictTo.Scope.LIBRARY)
@NonNull
public static CrashConfig getConfig() {
    return config;
}
 
@VisibleForTesting
@RestrictTo(RestrictTo.Scope.TESTS)
DefaultHeartBeatInfo(HeartBeatInfoStorage testStorage) {
  storage = testStorage;
}
 
/**
 * Set security state of the node {@link SecurityState}
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setSecurity(@SecurityState final int security) {
    this.security = security;
}
 
/**
 * Sets the {@link SecureNetworkBeacon} beacon for this node
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setSecureNetworkBeaconSupported(final Boolean secureNetworkBeacon) {
    this.secureNetworkBeaconSupported = secureNetworkBeacon;
}
 
源代码15 项目: firebase-android-sdk   文件: ImageBindingWrapper.java
@Inject
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ImageBindingWrapper(
    InAppMessageLayoutConfig config, LayoutInflater inflater, InAppMessage message) {
  super(config, inflater, message);
}
 
@VisibleForTesting
@RestrictTo(RestrictTo.Scope.TESTS)
HeartBeatInfoStorage(SharedPreferences preferences) {
  this.sharedPreferences = preferences;
}
 
源代码17 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.LIBRARY)
synchronized boolean isInitialized() {
    return isInitialized.get();
}
 
源代码18 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setStarted(boolean isStarted) {
    this.isInitialized.set(isStarted);
}
 
源代码19 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setAppContext(Context context) {
    this.appContext = context;
}
 
源代码20 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setGattServerStarted(boolean isStarted) {
    this.isGattServerStarted.set(isStarted);
}
 
源代码21 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setGattClientStarted(boolean isStarted) {
    this.isGattClientStarted.set(isStarted);
}
 
源代码22 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setConnectionMap(ConcurrentHashMap<FitbitBluetoothDevice, GattConnection> map) {
    this.connectionMap.clear();
    this.connectionMap.putAll(map);
}
 
源代码23 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setPeripheralScanner(PeripheralScanner scanner) {
    this.peripheralScanner = scanner;
}
 
源代码24 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setClientCallback(GattClientCallback callback) {
    this.clientCallback = callback;
}
 
源代码25 项目: firebase-android-sdk   文件: CardBindingWrapper.java
@Inject
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public CardBindingWrapper(
    InAppMessageLayoutConfig config, LayoutInflater inflater, InAppMessage message) {
  super(config, inflater, message);
}
 
源代码26 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setConnectionCleanup(Handler handler) {
    this.connectionCleanup = handler;
}
 
源代码27 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void setAsyncOperationThreadWatchdog(LooperWatchdog watchdog) {
    this.asyncOperationThreadWatchdog = watchdog;
}
 
源代码28 项目: bitgatt   文件: FitbitGatt.java
@RestrictTo(RestrictTo.Scope.TESTS)
void clearConnectionsMap() {
    connectionMap.clear();
}
 
源代码29 项目: bitgatt   文件: FitbitGatt.java
/**
 * @return true if log statements that may slow down data transfer speeds should be executed
 */
@RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean isSlowLoggingEnabled() {
    return slowLoggingEnabled;
}
 
@RestrictTo(RestrictTo.Scope.LIBRARY)
public ProvisionedBaseMeshNode() {
}