Files
app_Settings/res/xml/mobile_network_list.xml
Antony Sargent 482415d37e Protect entry points to add an eSIM when admin restricted
If the DISALLOW_CONFIG_MOBILE_NETWORKS admin policy is set, we were
accidentally still allowing access to the flow where you add an eSIM
subscription via the "plus" button on the Network & internet page. While
fixing this, I also noticed that the mobile networks list page (which
only becomes available if you have multiple subscriptions) has a link at
the bottom to start the flow as well, and that wasn't being protected.

The fix for the plus button on the Network & internet page was just to
make sure not to call setEnabled(true) if the preference was already
disabled by admin policy, since that has the effect of overriding the
admin-disabling.

The fix for the mobile networks list page just needed to add the
relevant tags in the layout XML, and then we get it for free.

Fixes: 137627845
Test: make RunSettingsRoboTests
Change-Id: I896ac248f50aaeecc157791938a0a0a98265aa07
2019-07-31 12:53:39 -07:00

38 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="mobile_network_list_screen"
android:title="@string/network_settings_title">
<com.android.settingslib.RestrictedPreference
android:key="add_more"
settings:isPreferenceVisible="false"
settings:userRestriction="no_config_mobile_networks"
settings:useAdminDisabledSummary="true"
android:title="@string/mobile_network_list_add_more"
android:icon="@drawable/ic_menu_add_activated_tint"
android:order="100" >
<intent android:action="android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION">
<extra android:name="android.telephony.euicc.extra.FORCE_PROVISION"
android:value="true"/>
</intent>
</com.android.settingslib.RestrictedPreference>
</PreferenceScreen>