Merge "Define a new config key for the recommendation provider app."

This commit is contained in:
TreeHugger Robot
2017-02-16 02:58:50 +00:00
committed by Android (Google) Code Review
4 changed files with 12 additions and 21 deletions

View File

@@ -1286,6 +1286,16 @@
<item>com.android.networkrecommendation</item>
</string-array>
<!-- The package name of the default network recommendation app.
A network recommendation provider must:
* Be granted the SCORE_NETWORKS permission.
* Include a Service for the android.net.scoring.RECOMMEND_NETWORKS action
protected by the BIND_NETWORK_RECOMMENDATION_SERVICE permission.
This must be set to a valid network recommendation app.
-->
<string name="config_defaultNetworkRecommendationProviderPackage" translatable="false">com.android.networkrecommendation</string>
<!-- Whether to enable Hardware FLP overlay which allows Hardware FLP to be
replaced by an app at run-time. When disabled, only the
config_hardwareFlpPackageName package will be searched for Hardware Flp,

View File

@@ -2790,6 +2790,7 @@
<!-- Network Recommendation -->
<java-symbol type="array" name="config_networkRecommendationPackageNames" />
<java-symbol type="string" name="config_defaultNetworkRecommendationProviderPackage" />
<!-- Whether allow 3rd party apps on internal storage. -->
<java-symbol type="bool" name="config_allow3rdPartyAppOnInternal" />

View File

@@ -227,7 +227,4 @@
<!-- default setting for Settings.System.END_BUTTON_BEHAVIOR : END_BUTTON_BEHAVIOR_SLEEP -->
<integer name="def_end_button_behavior">0x2</integer>
<!--Default settings for network recommendations. -->
<string name="def_network_recommendations_package" translatable="false">com.android.networkrecommendation</string>
</resources>

View File

@@ -3182,24 +3182,7 @@ public class SettingsProvider extends ContentProvider {
}
if (currentVersion == 138) {
// Version 139: Applying the default to NETWORK_RECOMMENDATIONS_PACKAGE
if (userId == UserHandle.USER_SYSTEM) {
final SettingsState globalSettings = getGlobalSettingsLocked();
final String defaultAppPackage = getContext().getResources()
.getString(R.string.def_network_recommendations_package);
// Set the network recommendations package name
globalSettings.insertSettingLocked(
Global.NETWORK_RECOMMENDATIONS_PACKAGE,
defaultAppPackage, null, true,
SettingsState.SYSTEM_PACKAGE_NAME);
// Clear the scorer setting since it's no longer needed.
globalSettings.insertSettingLocked(
Global.NETWORK_SCORER_APP,
null, null, true,
SettingsState.SYSTEM_PACKAGE_NAME);
}
// Version 139: Removed.
currentVersion = 139;
}