Remove fast pair scan API
Bug: 227513829 Test: Built and verified no FP UI in settings Ignore-AOSP-First: nearby_not_in_aosp_yet Change-Id: I4bdf8653d0b3a85fbb53786818adb4c3ca39567a
This commit is contained in:
parent
b4c91b6983
commit
85c3e0883c
4 changed files with 2 additions and 19 deletions
|
|
@ -59,8 +59,6 @@ package android.nearby {
|
|||
}
|
||||
|
||||
public class NearbyManager {
|
||||
method public static boolean getFastPairScanEnabled(@NonNull android.content.Context);
|
||||
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void setFastPairScanEnabled(@NonNull android.content.Context, boolean);
|
||||
method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startBroadcast(@NonNull android.nearby.BroadcastRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.BroadcastCallback);
|
||||
method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int startScan(@NonNull android.nearby.ScanRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.ScanCallback);
|
||||
method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopBroadcast(@NonNull android.nearby.BroadcastCallback);
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ public class NearbyManager {
|
|||
*
|
||||
* @param context the {@link Context} to query the setting
|
||||
* @return whether the Fast Pair is enabled
|
||||
* @hide
|
||||
*/
|
||||
public static boolean getFastPairScanEnabled(@NonNull Context context) {
|
||||
final int enabled = Settings.Secure.getInt(
|
||||
|
|
@ -258,6 +259,7 @@ public class NearbyManager {
|
|||
*
|
||||
* @param context the {@link Context} to set the setting
|
||||
* @param enable whether the Fast Pair scan should be enabled
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
|
||||
public static void setFastPairScanEnabled(@NonNull Context context, boolean enable) {
|
||||
|
|
|
|||
|
|
@ -136,13 +136,6 @@ public class NearbyManagerTest {
|
|||
mNearbyManager.stopBroadcast(callback);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SdkSuppress(minSdkVersion = 32, codeName = "T")
|
||||
public void testSettingsEnable() {
|
||||
NearbyManager.setFastPairScanEnabled(mContext, false);
|
||||
assertThat(NearbyManager.getFastPairScanEnabled(mContext)).isFalse();
|
||||
}
|
||||
|
||||
private void enableBluetooth() {
|
||||
BluetoothManager manager = mContext.getSystemService(BluetoothManager.class);
|
||||
BluetoothAdapter bluetoothAdapter = manager.getAdapter();
|
||||
|
|
|
|||
|
|
@ -126,16 +126,6 @@ class FastPairSeekerSnippet : Snippet {
|
|||
return fastPairTestDataManager.testDataCache.dumpAccountKeyDeviceMetadataListAsJson()
|
||||
}
|
||||
|
||||
/** Writes into {@link Settings} whether Fast Pair scan is enabled.
|
||||
*
|
||||
* @param enable whether the Fast Pair scan should be enabled.
|
||||
*/
|
||||
@Rpc(description = "Writes into Settings whether Fast Pair scan is enabled.")
|
||||
fun setFastPairScanEnabled(enable: Boolean) {
|
||||
Log.i("Writes into Settings whether Fast Pair scan is enabled.")
|
||||
NearbyManager.setFastPairScanEnabled(appContext, enable)
|
||||
}
|
||||
|
||||
/** Dismisses the half sheet UI if showed. */
|
||||
@Rpc(description = "Dismisses the half sheet UI if showed.")
|
||||
fun dismissHalfSheet() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue