From 2703eb717e542ff225611cb9e0217815ee14661c Mon Sep 17 00:00:00 2001 From: Luis Vidal Date: Mon, 21 Mar 2016 10:08:14 -0700 Subject: Add Weather Content Provider [2/5] Introduce a new entry in the settings menu to select the available weather provider services. This entry will be parked in the System category between Date&Time and Accessibility Change-Id: Ida230f3be72eb575a2b09504c99eaa16851c99f8 --- src/com/android/settings/SettingsActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/com/android/settings/SettingsActivity.java') diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 8e0bb98..dfef1a4 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -84,6 +84,7 @@ import com.android.settings.bluetooth.BluetoothSettings; import com.android.settings.contributors.ContributorsCloudFragment; import com.android.settings.cyanogenmod.DisplayRotation; import com.android.settings.cyanogenmod.LiveLockScreenSettings; +import com.android.settings.cyanogenmod.WeatherServiceSettings; import com.android.settings.dashboard.DashboardCategory; import com.android.settings.dashboard.DashboardSummary; import com.android.settings.dashboard.DashboardTile; @@ -137,6 +138,7 @@ import com.android.settings.wifi.SavedAccessPointsWifiSettings; import com.android.settings.wifi.WifiSettings; import com.android.settings.wifi.p2p.WifiP2pSettings; +import cyanogenmod.app.CMContextConstants; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -377,7 +379,8 @@ public class SettingsActivity extends Activity ProfilesSettings.class.getName(), ContributorsCloudFragment.class.getName(), NotificationManagerSettings.class.getName(), - LiveLockScreenSettings.class.getName() + LiveLockScreenSettings.class.getName(), + WeatherServiceSettings.class.getName() }; @@ -1328,6 +1331,11 @@ public class SettingsActivity extends Activity if (!hasDeviceKeys) { removeTile = true; } + } else if (id == R.id.weather_settings) { + if (!getPackageManager().hasSystemFeature( + CMContextConstants.Features.WEATHER_SERVICES)) { + removeTile = true; + } } if (UserHandle.MU_ENABLED && UserHandle.myUserId() != 0 -- cgit v1.1