[Settings] Hide some Preference entries when no mobile data support

Hide some Preference which requires mobile data on device didn't support
it.

Bug: 221999174
Test: local
Change-Id: I7dd6e13aea0ed4467c7c7edeada564e42ea78349
This commit is contained in:
Bonian Chen
2022-05-10 01:13:47 +08:00
parent 9fb3262a1a
commit 8b06c96fe9
4 changed files with 16 additions and 4 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License
*/
package com.android.settings.network;
package com.android.settings.network.telephony;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
@@ -74,7 +74,10 @@ public class DataDuringCallsPreferenceControllerTest {
when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
mSwitchPreference = new SwitchPreference(mContext);
when(mPreferenceScreen.findPreference(PREF_KEY)).thenReturn(mSwitchPreference);
mController = new DataDuringCallsPreferenceController(mContext, PREF_KEY);
mController = new DataDuringCallsPreferenceController(mContext, PREF_KEY) {
@Override
protected boolean hasMobileData() { return true; }
};
mController.init(mLifecycle, SUB_ID_1);
}