From 8589b41994d2d08307fa4a8d9e86a06a47fa13e5 Mon Sep 17 00:00:00 2001 From: Chaohui Wang Date: Tue, 26 Jul 2022 12:53:24 +0800 Subject: [PATCH] Clean up unused bluetooth resources Bug: 234570979 Test: make Settings app Change-Id: I23d5a3dc27fe5df5ba45b8593c9f2ad3d7c25cbc --- res/values/strings.xml | 61 ------------------- res/xml/bluetooth_settings.xml | 43 ------------- res/xml/bluetooth_settings_obsolete.xml | 21 ------- .../BluetoothPermissionActivity.java | 3 - .../bluetooth/BluetoothPairingDialogTest.java | 8 --- 5 files changed, 136 deletions(-) delete mode 100644 res/xml/bluetooth_settings.xml delete mode 100644 res/xml/bluetooth_settings_obsolete.xml diff --git a/res/values/strings.xml b/res/values/strings.xml index 1aa6d13aed6..eb5bddec147 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -115,27 +115,10 @@ Not visible to other Bluetooth devices Only visible to paired devices - - Visibility timeout - - Lock voice dialing - - - Prevent use of the bluetooth dialer when the screen is locked - Bluetooth devices Device name - - Device settings - - Profile settings - - No name set, using account name - - Scan for devices Rename this device @@ -148,10 +131,6 @@ Your tablet will disconnect from "%1$s." Your device will disconnect from "%1$s." - - Disconnect - - You don\u2019t have permission to change Bluetooth settings. Pair new device @@ -170,8 +149,6 @@ Related - - %1$s is visible to nearby devices while Bluetooth settings is open. Phone\'s Bluetooth address: %1$s @@ -179,11 +156,6 @@ Device\'s Bluetooth address: %1$s - - Disconnect %1$s? - - Broadcasting - Unnamed Bluetooth device @@ -196,8 +168,6 @@ Pairing request Tap to pair with %1$s. - - Received files Bluetooth is off @@ -266,37 +236,12 @@ "Bluetooth connection request" - - "Tap to connect to \u0022%1$s\u0022." - - - "Do you want to connect to \u0022%1$s\u0022?" - "Phone book access request" - - - %1$s wants to access your contacts and call history. Give access to %2$s? - - - - Don\u2019t ask again - - Don\u2019t ask again - "Message access request" - - %1$s wants to access your messages. Give access to %2$s? - - - "SIM access request" - - - %1$s wants to access your SIM card. Granting access to the SIM card will disable data connectivity on your device for the duration of the connection. Give access to %2$s? - Visible as \u201C^1\u201D to other devices @@ -306,12 +251,6 @@ Your devices Pair new device - - Allow your tablet to communicate with nearby Bluetooth devices - - Allow your device to communicate with nearby Bluetooth devices - - Allow your phone to communicate with nearby Bluetooth devices Disable Bluetooth A2DP hardware offload diff --git a/res/xml/bluetooth_settings.xml b/res/xml/bluetooth_settings.xml deleted file mode 100644 index 86d6d01ee31..00000000000 --- a/res/xml/bluetooth_settings.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/res/xml/bluetooth_settings_obsolete.xml b/res/xml/bluetooth_settings_obsolete.xml deleted file mode 100644 index 55a099cb19e..00000000000 --- a/res/xml/bluetooth_settings_obsolete.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index c8f71c400b9..7c5eb6b15bd 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -151,13 +151,10 @@ public class BluetoothPermissionActivity extends AlertActivity implements public void onBackPressed() { /*we need an answer so ignore back button presses during auth */ if(DEBUG) Log.i(TAG, "Back button pressed! ignoring"); - return; } // TODO(edjee): createConnectionDialogView, createPhonebookDialogView and createMapDialogView // are similar. Refactor them into one method. - // Also, the string resources bluetooth_remember_choice and bluetooth_pb_remember_choice should - // be removed. private View createConnectionDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java index a53e693976e..bdcf742012a 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java @@ -368,14 +368,6 @@ public class BluetoothPairingDialogTest { assertThat(message.getVisibility()).isEqualTo(View.GONE); } - @Test - public void pairingStringIsFormattedCorrectly() { - final String device = "test_device"; - final Context context = RuntimeEnvironment.application; - assertThat(context.getString(R.string.bluetooth_pb_acceptance_dialog_text, device, device)) - .contains(device); - } - @Test public void pairingDialogDismissedOnPositiveClick() { // set the dialog variant to confirmation/consent