Disable regulatory info directly, not priority.
Instead of using priority, offer to launch anyone handling the action, and use the boolean to control if Settings offers the UI. Bug: 13340779 Change-Id: Idb3f85c434414911f8911b7511b3a7a8029a8e06
This commit is contained in:
@@ -1727,8 +1727,9 @@
|
|||||||
<activity android:name="RegulatoryInfoDisplayActivity"
|
<activity android:name="RegulatoryInfoDisplayActivity"
|
||||||
android:label="@string/regulatory_information"
|
android:label="@string/regulatory_information"
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:excludeFromRecents="true">
|
android:excludeFromRecents="true"
|
||||||
<intent-filter android:priority="50">
|
android:enabled="@bool/config_show_regulatory_info">
|
||||||
|
<intent-filter>
|
||||||
<action android:name="android.settings.SHOW_REGULATORY_INFO" />
|
<action android:name="android.settings.SHOW_REGULATORY_INFO" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
@@ -28,6 +28,7 @@ import android.os.UserHandle;
|
|||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -152,9 +153,14 @@ public class DeviceInfoSettings extends RestrictedSettingsFragment {
|
|||||||
removePreferenceIfBoolFalse(KEY_UPDATE_SETTING,
|
removePreferenceIfBoolFalse(KEY_UPDATE_SETTING,
|
||||||
R.bool.config_additional_system_update_setting_enable);
|
R.bool.config_additional_system_update_setting_enable);
|
||||||
|
|
||||||
// Remove regulatory information if not enabled.
|
// Remove regulatory information if none present.
|
||||||
removePreferenceIfBoolFalse(KEY_REGULATORY_INFO,
|
final Intent intent = new Intent(Settings.ACTION_SHOW_REGULATORY_INFO);
|
||||||
R.bool.config_show_regulatory_info);
|
if (getPackageManager().queryIntentActivities(intent, 0).isEmpty()) {
|
||||||
|
Preference pref = findPreference(KEY_REGULATORY_INFO);
|
||||||
|
if (pref != null) {
|
||||||
|
getPreferenceScreen().removePreference(pref);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user