Remove all reference to SmsMirroring in Android Settings.
Test: Robotests Change-Id: I3318c6915cae95522f09838f00a3c567fe9e5fc5
This commit is contained in:
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2017 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0"
|
|
||||||
android:tint="?android:attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M20,2C21.1,2 22,2.9 22,4L22,16C22,17.1 21.1,18 20,18L6,18L2,22L2.01,4C2.01,2.9 2.9,2 4,2L20,2ZM8,8L4,12L8,16L8,13L14,13L14,11L8,11L8,8ZM19.666,7.872L16.038,4.372L16.038,6.997L10,6.997L10,9L16.038,9L16.038,11.372L19.666,7.872Z"/>
|
|
||||||
</vector>
|
|
@@ -8129,9 +8129,6 @@
|
|||||||
and powering other device [CHAR LIMIT=NONE] -->
|
and powering other device [CHAR LIMIT=NONE] -->
|
||||||
<string name="usb_summary_MIDI_power">MIDI and supplying power</string>
|
<string name="usb_summary_MIDI_power">MIDI and supplying power</string>
|
||||||
|
|
||||||
<!-- Settings item title for SMS Mirroring preference [CHAR LIMIT=35] -->
|
|
||||||
<string name="sms_mirroring_pref">SMS Mirroring</string>
|
|
||||||
|
|
||||||
<!-- Settings item title for background check prefs [CHAR LIMIT=35] -->
|
<!-- Settings item title for background check prefs [CHAR LIMIT=35] -->
|
||||||
<string name="background_check_pref">Background check</string>
|
<string name="background_check_pref">Background check</string>
|
||||||
|
|
||||||
|
@@ -42,13 +42,6 @@
|
|||||||
android:icon="@drawable/ic_android"
|
android:icon="@drawable/ic_android"
|
||||||
android:order="-4"/>
|
android:order="-4"/>
|
||||||
|
|
||||||
<Preference
|
|
||||||
android:key="sms_mirroring"
|
|
||||||
android:title="@string/sms_mirroring_pref"
|
|
||||||
android:icon="@drawable/ic_sms_mirroring_24dp"
|
|
||||||
android:summary="@string/summary_placeholder"
|
|
||||||
android:order="-3"/>
|
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="bluetooth_on_while_driving"
|
android:key="bluetooth_on_while_driving"
|
||||||
android:title="@string/bluetooth_on_while_driving_pref"
|
android:title="@string/bluetooth_on_while_driving_pref"
|
||||||
|
@@ -39,13 +39,6 @@
|
|||||||
android:icon="@drawable/ic_android"
|
android:icon="@drawable/ic_android"
|
||||||
android:order="-4"/>
|
android:order="-4"/>
|
||||||
|
|
||||||
<Preference
|
|
||||||
android:key="sms_mirroring"
|
|
||||||
android:title="@string/sms_mirroring_pref"
|
|
||||||
android:icon="@drawable/ic_sms_mirroring_24dp"
|
|
||||||
android:summary="@string/summary_placeholder"
|
|
||||||
android:order="-3"/>
|
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="usb_mode"
|
android:key="usb_mode"
|
||||||
android:title="@string/usb_pref"
|
android:title="@string/usb_pref"
|
||||||
|
@@ -81,11 +81,6 @@ public class AdvancedConnectedDeviceDashboardFragment extends DashboardFragment
|
|||||||
lifecycle.addObserver(bluetoothPreferenceController);
|
lifecycle.addObserver(bluetoothPreferenceController);
|
||||||
controllers.add(bluetoothPreferenceController);
|
controllers.add(bluetoothPreferenceController);
|
||||||
|
|
||||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
|
||||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
|
||||||
AbstractPreferenceController smsMirroringController =
|
|
||||||
smsMirroringFeatureProvider.getController(context);
|
|
||||||
controllers.add(smsMirroringController);
|
|
||||||
controllers.add(new BluetoothFilesPreferenceController(context));
|
controllers.add(new BluetoothFilesPreferenceController(context));
|
||||||
controllers.add(new BluetoothOnWhileDrivingPreferenceController(context));
|
controllers.add(new BluetoothOnWhileDrivingPreferenceController(context));
|
||||||
return controllers;
|
return controllers;
|
||||||
@@ -114,12 +109,6 @@ public class AdvancedConnectedDeviceDashboardFragment extends DashboardFragment
|
|||||||
}
|
}
|
||||||
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
||||||
|
|
||||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
|
||||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
|
||||||
SmsMirroringPreferenceController smsMirroringController =
|
|
||||||
smsMirroringFeatureProvider.getController(context);
|
|
||||||
smsMirroringController.updateNonIndexableKeys(keys);
|
|
||||||
|
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -90,11 +90,6 @@ public class ConnectedDeviceDashboardFragmentOld extends DashboardFragment {
|
|||||||
lifecycle.addObserver(bluetoothPreferenceController);
|
lifecycle.addObserver(bluetoothPreferenceController);
|
||||||
controllers.add(bluetoothPreferenceController);
|
controllers.add(bluetoothPreferenceController);
|
||||||
|
|
||||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
|
||||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
|
||||||
AbstractPreferenceController smsMirroringController =
|
|
||||||
smsMirroringFeatureProvider.getController(context);
|
|
||||||
controllers.add(smsMirroringController);
|
|
||||||
return controllers;
|
return controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,12 +152,6 @@ public class ConnectedDeviceDashboardFragmentOld extends DashboardFragment {
|
|||||||
}
|
}
|
||||||
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
|
||||||
|
|
||||||
SmsMirroringFeatureProvider smsMirroringFeatureProvider =
|
|
||||||
FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
|
||||||
SmsMirroringPreferenceController smsMirroringController =
|
|
||||||
smsMirroringFeatureProvider.getController(context);
|
|
||||||
smsMirroringController.updateNonIndexableKeys(keys);
|
|
||||||
|
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.settings.connecteddevice;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
public interface SmsMirroringFeatureProvider {
|
|
||||||
|
|
||||||
/** Returns whether to show SMS mirroring. */
|
|
||||||
boolean shouldShowSmsMirroring(Context context);
|
|
||||||
|
|
||||||
/** Returns a preference controller for SMS mirroring. */
|
|
||||||
SmsMirroringPreferenceController getController(Context context);
|
|
||||||
}
|
|
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.android.settings.connecteddevice;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
public class SmsMirroringFeatureProviderImpl implements SmsMirroringFeatureProvider {
|
|
||||||
@Override
|
|
||||||
public boolean shouldShowSmsMirroring(Context context) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SmsMirroringPreferenceController getController(Context context) {
|
|
||||||
return new SmsMirroringPreferenceController(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package com.android.settings.connecteddevice;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.android.settings.core.PreferenceControllerMixin;
|
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
|
||||||
import com.android.settingslib.core.AbstractPreferenceController;
|
|
||||||
|
|
||||||
public class SmsMirroringPreferenceController extends AbstractPreferenceController
|
|
||||||
implements PreferenceControllerMixin {
|
|
||||||
|
|
||||||
static final String KEY_SMS_MIRRORING = "sms_mirroring";
|
|
||||||
|
|
||||||
private SmsMirroringFeatureProvider mFeatureProvider;
|
|
||||||
|
|
||||||
public SmsMirroringPreferenceController(Context context) {
|
|
||||||
super(context);
|
|
||||||
mFeatureProvider = FeatureFactory.getFactory(context).getSmsMirroringFeatureProvider();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAvailable() {
|
|
||||||
return mFeatureProvider.shouldShowSmsMirroring(mContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPreferenceKey() {
|
|
||||||
return KEY_SMS_MIRRORING;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -24,7 +24,6 @@ import com.android.settings.R;
|
|||||||
import com.android.settings.accounts.AccountFeatureProvider;
|
import com.android.settings.accounts.AccountFeatureProvider;
|
||||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
||||||
import com.android.settings.connecteddevice.SmsMirroringFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
import com.android.settings.dashboard.DashboardFeatureProvider;
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
||||||
@@ -103,8 +102,6 @@ public abstract class FeatureFactory {
|
|||||||
|
|
||||||
public abstract BluetoothFeatureProvider getBluetoothFeatureProvider(Context context);
|
public abstract BluetoothFeatureProvider getBluetoothFeatureProvider(Context context);
|
||||||
|
|
||||||
public abstract SmsMirroringFeatureProvider getSmsMirroringFeatureProvider();
|
|
||||||
|
|
||||||
public abstract SlicesFeatureProvider getSlicesFeatureProvider();
|
public abstract SlicesFeatureProvider getSlicesFeatureProvider();
|
||||||
|
|
||||||
public abstract AccountFeatureProvider getAccountFeatureProvider();
|
public abstract AccountFeatureProvider getAccountFeatureProvider();
|
||||||
|
@@ -29,8 +29,6 @@ import com.android.settings.applications.ApplicationFeatureProvider;
|
|||||||
import com.android.settings.applications.ApplicationFeatureProviderImpl;
|
import com.android.settings.applications.ApplicationFeatureProviderImpl;
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProviderImpl;
|
import com.android.settings.bluetooth.BluetoothFeatureProviderImpl;
|
||||||
import com.android.settings.connecteddevice.SmsMirroringFeatureProvider;
|
|
||||||
import com.android.settings.connecteddevice.SmsMirroringFeatureProviderImpl;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
import com.android.settings.dashboard.DashboardFeatureProvider;
|
||||||
import com.android.settings.dashboard.DashboardFeatureProviderImpl;
|
import com.android.settings.dashboard.DashboardFeatureProviderImpl;
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
||||||
@@ -75,7 +73,6 @@ public class FeatureFactoryImpl extends FeatureFactory {
|
|||||||
private AssistGestureFeatureProvider mAssistGestureFeatureProvider;
|
private AssistGestureFeatureProvider mAssistGestureFeatureProvider;
|
||||||
private UserFeatureProvider mUserFeatureProvider;
|
private UserFeatureProvider mUserFeatureProvider;
|
||||||
private BluetoothFeatureProvider mBluetoothFeatureProvider;
|
private BluetoothFeatureProvider mBluetoothFeatureProvider;
|
||||||
private SmsMirroringFeatureProvider mSmsMirroringFeatureProvider;
|
|
||||||
private SlicesFeatureProvider mSlicesFeatureProvider;
|
private SlicesFeatureProvider mSlicesFeatureProvider;
|
||||||
private AccountFeatureProvider mAccountFeatureProvider;
|
private AccountFeatureProvider mAccountFeatureProvider;
|
||||||
|
|
||||||
@@ -196,14 +193,6 @@ public class FeatureFactoryImpl extends FeatureFactory {
|
|||||||
return mAssistGestureFeatureProvider;
|
return mAssistGestureFeatureProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SmsMirroringFeatureProvider getSmsMirroringFeatureProvider() {
|
|
||||||
if (mSmsMirroringFeatureProvider == null) {
|
|
||||||
mSmsMirroringFeatureProvider = new SmsMirroringFeatureProviderImpl();
|
|
||||||
}
|
|
||||||
return mSmsMirroringFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SlicesFeatureProvider getSlicesFeatureProvider() {
|
public SlicesFeatureProvider getSlicesFeatureProvider() {
|
||||||
if (mSlicesFeatureProvider == null) {
|
if (mSlicesFeatureProvider == null) {
|
||||||
|
@@ -53,37 +53,15 @@ public class AdvancedConnectedDeviceDashboardFragmentTest {
|
|||||||
private PackageManager mManager;
|
private PackageManager mManager;
|
||||||
|
|
||||||
private FakeFeatureFactory mFeatureFactory;
|
private FakeFeatureFactory mFeatureFactory;
|
||||||
private SmsMirroringFeatureProvider mFeatureProvider;
|
|
||||||
private AdvancedConnectedDeviceDashboardFragment mFragment;
|
private AdvancedConnectedDeviceDashboardFragment mFragment;
|
||||||
private TestSmsMirroringPreferenceController mSmsMirroringPreferenceController;
|
|
||||||
|
|
||||||
private static final class TestSmsMirroringPreferenceController
|
|
||||||
extends SmsMirroringPreferenceController implements PreferenceControllerMixin {
|
|
||||||
|
|
||||||
private boolean mIsAvailable;
|
|
||||||
|
|
||||||
public TestSmsMirroringPreferenceController(Context context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAvailable() {
|
|
||||||
return mIsAvailable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||||
mFeatureProvider = mFeatureFactory.smsMirroringFeatureProvider;
|
|
||||||
|
|
||||||
mFragment = new AdvancedConnectedDeviceDashboardFragment();
|
mFragment = new AdvancedConnectedDeviceDashboardFragment();
|
||||||
when(mContext.getPackageManager()).thenReturn(mManager);
|
when(mContext.getPackageManager()).thenReturn(mManager);
|
||||||
|
|
||||||
mSmsMirroringPreferenceController = new TestSmsMirroringPreferenceController(mContext);
|
|
||||||
when(mFeatureProvider.getController(mContext)).thenReturn(
|
|
||||||
mSmsMirroringPreferenceController);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -123,30 +101,6 @@ public class AdvancedConnectedDeviceDashboardFragmentTest {
|
|||||||
assertThat(keys).doesNotContain(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
assertThat(keys).doesNotContain(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSearchIndexProvider_NoSmsMirroring_KeyAdded() {
|
|
||||||
when(mFeatureProvider.shouldShowSmsMirroring(mContext)).thenReturn(false);
|
|
||||||
mSmsMirroringPreferenceController.mIsAvailable = false;
|
|
||||||
|
|
||||||
final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
|
|
||||||
mContext);
|
|
||||||
|
|
||||||
assertThat(keys).isNotNull();
|
|
||||||
assertThat(keys).contains(mSmsMirroringPreferenceController.getPreferenceKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSearchIndexProvider_SmsMirroring_KeyNotAdded() {
|
|
||||||
when(mFeatureProvider.shouldShowSmsMirroring(mContext)).thenReturn(true);
|
|
||||||
mSmsMirroringPreferenceController.mIsAvailable = true;
|
|
||||||
|
|
||||||
final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
|
|
||||||
mContext);
|
|
||||||
|
|
||||||
assertThat(keys).isNotNull();
|
|
||||||
assertThat(keys).doesNotContain(mSmsMirroringPreferenceController.getPreferenceKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetCategoryKey_returnCategoryDevice() {
|
public void testGetCategoryKey_returnCategoryDevice() {
|
||||||
assertThat(mFragment.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_DEVICE);
|
assertThat(mFragment.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_DEVICE);
|
||||||
|
@@ -60,37 +60,15 @@ public class ConnectedDeviceDashboardFragment2Test {
|
|||||||
private PackageManager mManager;
|
private PackageManager mManager;
|
||||||
|
|
||||||
private FakeFeatureFactory mFeatureFactory;
|
private FakeFeatureFactory mFeatureFactory;
|
||||||
private SmsMirroringFeatureProvider mFeatureProvider;
|
|
||||||
private ConnectedDeviceDashboardFragmentOld mFragment;
|
private ConnectedDeviceDashboardFragmentOld mFragment;
|
||||||
private TestSmsMirroringPreferenceController mSmsMirroringPreferenceController;
|
|
||||||
|
|
||||||
private static final class TestSmsMirroringPreferenceController
|
|
||||||
extends SmsMirroringPreferenceController implements PreferenceControllerMixin {
|
|
||||||
|
|
||||||
private boolean mIsAvailable;
|
|
||||||
|
|
||||||
public TestSmsMirroringPreferenceController(Context context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isAvailable() {
|
|
||||||
return mIsAvailable;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||||
mFeatureProvider = mFeatureFactory.smsMirroringFeatureProvider;
|
|
||||||
|
|
||||||
mFragment = new ConnectedDeviceDashboardFragmentOld();
|
mFragment = new ConnectedDeviceDashboardFragmentOld();
|
||||||
when(mContext.getPackageManager()).thenReturn(mManager);
|
when(mContext.getPackageManager()).thenReturn(mManager);
|
||||||
|
|
||||||
mSmsMirroringPreferenceController = new TestSmsMirroringPreferenceController(mContext);
|
|
||||||
when(mFeatureProvider.getController(mContext)).thenReturn(
|
|
||||||
mSmsMirroringPreferenceController);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -130,30 +108,6 @@ public class ConnectedDeviceDashboardFragment2Test {
|
|||||||
assertThat(keys).doesNotContain(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
assertThat(keys).doesNotContain(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSearchIndexProvider_NoSmsMirroring_KeyAdded() {
|
|
||||||
when(mFeatureProvider.shouldShowSmsMirroring(mContext)).thenReturn(false);
|
|
||||||
mSmsMirroringPreferenceController.mIsAvailable = false;
|
|
||||||
|
|
||||||
final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
|
|
||||||
mContext);
|
|
||||||
|
|
||||||
assertThat(keys).isNotNull();
|
|
||||||
assertThat(keys).contains(mSmsMirroringPreferenceController.getPreferenceKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSearchIndexProvider_SmsMirroring_KeyNotAdded() {
|
|
||||||
when(mFeatureProvider.shouldShowSmsMirroring(mContext)).thenReturn(true);
|
|
||||||
mSmsMirroringPreferenceController.mIsAvailable = true;
|
|
||||||
|
|
||||||
final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
|
|
||||||
mContext);
|
|
||||||
|
|
||||||
assertThat(keys).isNotNull();
|
|
||||||
assertThat(keys).doesNotContain(mSmsMirroringPreferenceController.getPreferenceKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNonIndexableKeys_existInXmlLayout() {
|
public void testNonIndexableKeys_existInXmlLayout() {
|
||||||
final Context context = RuntimeEnvironment.application;
|
final Context context = RuntimeEnvironment.application;
|
||||||
|
@@ -24,7 +24,6 @@ import android.content.Context;
|
|||||||
import com.android.settings.accounts.AccountFeatureProvider;
|
import com.android.settings.accounts.AccountFeatureProvider;
|
||||||
import com.android.settings.applications.ApplicationFeatureProvider;
|
import com.android.settings.applications.ApplicationFeatureProvider;
|
||||||
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
import com.android.settings.bluetooth.BluetoothFeatureProvider;
|
||||||
import com.android.settings.connecteddevice.SmsMirroringFeatureProvider;
|
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
import com.android.settings.dashboard.DashboardFeatureProvider;
|
||||||
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
||||||
@@ -61,7 +60,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
|||||||
public final UserFeatureProvider userFeatureProvider;
|
public final UserFeatureProvider userFeatureProvider;
|
||||||
public final AssistGestureFeatureProvider assistGestureFeatureProvider;
|
public final AssistGestureFeatureProvider assistGestureFeatureProvider;
|
||||||
public final BluetoothFeatureProvider bluetoothFeatureProvider;
|
public final BluetoothFeatureProvider bluetoothFeatureProvider;
|
||||||
public final SmsMirroringFeatureProvider smsMirroringFeatureProvider;
|
|
||||||
public final SlicesFeatureProvider slicesFeatureProvider;
|
public final SlicesFeatureProvider slicesFeatureProvider;
|
||||||
public SearchFeatureProvider searchFeatureProvider;
|
public SearchFeatureProvider searchFeatureProvider;
|
||||||
public final AccountFeatureProvider mAccountFeatureProvider;
|
public final AccountFeatureProvider mAccountFeatureProvider;
|
||||||
@@ -101,7 +99,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
|||||||
userFeatureProvider = mock(UserFeatureProvider.class);
|
userFeatureProvider = mock(UserFeatureProvider.class);
|
||||||
assistGestureFeatureProvider = mock(AssistGestureFeatureProvider.class);
|
assistGestureFeatureProvider = mock(AssistGestureFeatureProvider.class);
|
||||||
bluetoothFeatureProvider = mock(BluetoothFeatureProvider.class);
|
bluetoothFeatureProvider = mock(BluetoothFeatureProvider.class);
|
||||||
smsMirroringFeatureProvider = mock(SmsMirroringFeatureProvider.class);
|
|
||||||
slicesFeatureProvider = mock(SlicesFeatureProvider.class);
|
slicesFeatureProvider = mock(SlicesFeatureProvider.class);
|
||||||
mAccountFeatureProvider = mock(AccountFeatureProvider.class);
|
mAccountFeatureProvider = mock(AccountFeatureProvider.class);
|
||||||
}
|
}
|
||||||
@@ -176,11 +173,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
|||||||
return assistGestureFeatureProvider;
|
return assistGestureFeatureProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SmsMirroringFeatureProvider getSmsMirroringFeatureProvider() {
|
|
||||||
return smsMirroringFeatureProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SlicesFeatureProvider getSlicesFeatureProvider() {
|
public SlicesFeatureProvider getSlicesFeatureProvider() {
|
||||||
return slicesFeatureProvider;
|
return slicesFeatureProvider;
|
||||||
|
@@ -74,7 +74,6 @@ public class UniquePreferenceTest {
|
|||||||
"toggle_bluetooth",
|
"toggle_bluetooth",
|
||||||
"toggle_nfc",
|
"toggle_nfc",
|
||||||
"android_beam_settings",
|
"android_beam_settings",
|
||||||
"sms_mirroring",
|
|
||||||
// Dup keys from About Phone v2 experiment.
|
// Dup keys from About Phone v2 experiment.
|
||||||
"ims_reg_state",
|
"ims_reg_state",
|
||||||
"bt_address",
|
"bt_address",
|
||||||
|
Reference in New Issue
Block a user