androidx.annotation.RestrictTo Java Examples

The following examples show how to use androidx.annotation.RestrictTo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MeshNetworkDb.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * 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;
        }
    }
}
 
Example #3
Source File: OperationMonitor.java    From FairEmail with GNU General Public License v3.0 5 votes vote down vote up
/** @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();
}
 
Example #4
Source File: TransportContext.java    From firebase-android-sdk with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #5
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #6
Source File: Group.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #7
Source File: DatabaseError.java    From firebase-android-sdk with Apache License 2.0 5 votes vote down vote up
/**
 * <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);
}
 
Example #8
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * 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();
}
 
Example #9
Source File: DeleteStorageTask.java    From firebase-android-sdk with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #10
Source File: RoomDatabase.java    From FairEmail with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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.");
    }
}
 
Example #11
Source File: Provisioner.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setLastSelected(final boolean lastSelected) {
    this.lastSelected = lastSelected;
}
 
Example #12
Source File: BannerBindingWrapper.java    From firebase-android-sdk with Apache License 2.0 4 votes vote down vote up
@Inject
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public BannerBindingWrapper(
    InAppMessageLayoutConfig config, LayoutInflater inflater, InAppMessage message) {
  super(config, inflater, message);
}
 
Example #13
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public final void setProductIdentifier(final Integer productIdentifier) {
    this.productIdentifier = productIdentifier;
}
 
Example #14
Source File: Element.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setName(@NonNull final String name) {
    this.name = name;
}
 
Example #15
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
@RestrictTo(RestrictTo.Scope.LIBRARY)
public ProvisionedMeshNode() { }
 
Example #16
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setDeviceKey(final byte[] deviceKey) {
    this.deviceKey = deviceKey;
}
 
Example #17
Source File: ProvisionedBaseMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public final void setConfigured(final boolean configured) {
    isConfigured = configured;
}
 
Example #18
Source File: SearchTEPresenter.java    From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.TESTS)
public void setProgramForTesting(Program program) {
    selectedProgram = program;
}
 
Example #19
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public final void setVersionIdentifier(final Integer versionIdentifier) {
    this.versionIdentifier = versionIdentifier;
}
 
Example #20
Source File: ProvisionedBaseMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public final void setNodeName(final String nodeName) {
    if (!TextUtils.isEmpty(nodeName))
        this.nodeName = nodeName;
}
 
Example #21
Source File: ModalBindingWrapper.java    From firebase-android-sdk with Apache License 2.0 4 votes vote down vote up
@Inject
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ModalBindingWrapper(
    InAppMessageLayoutConfig config, LayoutInflater inflater, InAppMessage message) {
  super(config, inflater, message);
}
 
Example #22
Source File: Blob.java    From firebase-android-sdk with Apache License 2.0 4 votes vote down vote up
/** @hide */
@NonNull
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ByteString toByteString() {
  return bytes;
}
 
Example #23
Source File: DynamicDialog.java    From dynamic-support with Apache License 2.0 4 votes vote down vote up
/**
 * @hide
 */
@RestrictTo(LIBRARY_GROUP)
public Builder setRecycleOnMeasureEnabled(boolean enabled) {
    P.mRecycleOnMeasure = enabled;
    return this;
}
 
Example #24
Source File: DatabaseConfiguration.java    From FairEmail with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a database configuration with the given values.
 *
 * @deprecated Use {@link #DatabaseConfiguration(Context, String,
 * SupportSQLiteOpenHelper.Factory, RoomDatabase.MigrationContainer, List, boolean,
 * RoomDatabase.JournalMode, Executor, Executor, boolean, boolean, boolean, Set, String, File)}
 *
 * @param context The application context.
 * @param name Name of the database, can be null if it is in memory.
 * @param sqliteOpenHelperFactory The open helper factory to use.
 * @param migrationContainer The migration container for migrations.
 * @param callbacks The list of callbacks for database events.
 * @param allowMainThreadQueries Whether to allow main thread reads/writes or not.
 * @param journalMode The journal mode. This has to be either TRUNCATE or WRITE_AHEAD_LOGGING.
 * @param queryExecutor The Executor used to execute asynchronous queries.
 * @param requireMigration True if Room should require a valid migration if version changes,
 *                        instead of recreating the tables.
 * @param migrationNotRequiredFrom The collection of schema versions from which migrations
 *                                 aren't required.
 *
 * @hide
 */
@Deprecated
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
public DatabaseConfiguration(@NonNull Context context, @Nullable String name,
        @NonNull SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory,
        @NonNull RoomDatabase.MigrationContainer migrationContainer,
        @Nullable List<androidx.room.RoomDatabase.Callback> callbacks,
        boolean allowMainThreadQueries,
        RoomDatabase.JournalMode journalMode,
        @NonNull Executor queryExecutor,
        boolean requireMigration,
        @Nullable Set<Integer> migrationNotRequiredFrom) {
    this(context, name, sqliteOpenHelperFactory, migrationContainer, callbacks,
            allowMainThreadQueries, journalMode, queryExecutor, queryExecutor, false,
            requireMigration, false, migrationNotRequiredFrom, null, null);
}
 
Example #25
Source File: BaseMeshNetwork.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setUnicastAddress(final int address) {
    this.unicastAddress = address;
}
 
Example #26
Source File: TransportRuntime.java    From firebase-android-sdk with Apache License 2.0 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public Uploader getUploader() {
  return uploader;
}
 
Example #27
Source File: SetOptions.java    From firebase-android-sdk with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Nullable
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public FieldMask getFieldMask() {
  return fieldMask;
}
 
Example #28
Source File: CrashActivity.java    From crashx with Apache License 2.0 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
@NonNull
public static CrashConfig getConfig() {
    return config;
}
 
Example #29
Source File: ProvisionedMeshNode.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public final void setAddedNetKeys(final List<NodeKey> addedNetKeyIndexes) {
    mAddedNetKeys = addedNetKeyIndexes;
}
 
Example #30
Source File: MeshKey.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void setId(final int id) {
    this.id = id;
}