Loading .gitlab-ci.yml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,7 @@ stages: before_script: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew - chmod +x ./gradlew - sed -i -e 's/<string name="default_key"><\/string>/<string name="default_key">'${DEFAULT_OWM_KEY}'<\/string>/g' app/src/main/res/values/strings.xml cache: cache: key: ${CI_PROJECT_ID} key: ${CI_PROJECT_ID} Loading app/src/main/java/org/lineageos/openweathermapprovider/OpenWeatherMapProviderService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class OpenWeatherMapProviderService extends WeatherProviderService final SharedPreferences preferences final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(this); preferences.registerOnSharedPreferenceChangeListener(this); final String mApiId = preferences.getString(API_KEY, null); final String mApiId = preferences.getString(API_KEY, getString(R.string.default_key)); mOpenWeatherMapService.setApiKey(mApiId); mOpenWeatherMapService.setApiKey(mApiId); } } Loading Loading @@ -146,7 +146,7 @@ public class OpenWeatherMapProviderService extends WeatherProviderService public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equals(API_KEY)) { if (key.equals(API_KEY)) { Logging.logd("API key has changed"); Logging.logd("API key has changed"); final String mApiKey = sharedPreferences.getString(key, null); final String mApiKey = sharedPreferences.getString(key, getString(R.string.default_key)); mOpenWeatherMapService.setApiKey(mApiKey); mOpenWeatherMapService.setApiKey(mApiKey); } } } } Loading app/src/main/res/values/strings.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,4 +37,6 @@ <string name="prefscreen_disclaimer_summary">The information provided by this application is provided for general information purposes only</string> <string name="prefscreen_disclaimer_summary">The information provided by this application is provided for general information purposes only</string> <string name="copyright_title">Copyright</string> <string name="copyright_title">Copyright</string> <string name="copyright_summary">OpenWeatherMap is a registered trademark of OpenWeatherMap Inc, both in the United States and internationally</string> <string name="copyright_summary">OpenWeatherMap is a registered trademark of OpenWeatherMap Inc, both in the United States and internationally</string> <string name="default_key"></string> </resources> </resources> No newline at end of file app/src/main/res/xml/preferences.xml +1 −1 File changed.Contains only whitespace changes. Show changes Loading
.gitlab-ci.yml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,7 @@ stages: before_script: before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew - chmod +x ./gradlew - sed -i -e 's/<string name="default_key"><\/string>/<string name="default_key">'${DEFAULT_OWM_KEY}'<\/string>/g' app/src/main/res/values/strings.xml cache: cache: key: ${CI_PROJECT_ID} key: ${CI_PROJECT_ID} Loading
app/src/main/java/org/lineageos/openweathermapprovider/OpenWeatherMapProviderService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class OpenWeatherMapProviderService extends WeatherProviderService final SharedPreferences preferences final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); = PreferenceManager.getDefaultSharedPreferences(this); preferences.registerOnSharedPreferenceChangeListener(this); preferences.registerOnSharedPreferenceChangeListener(this); final String mApiId = preferences.getString(API_KEY, null); final String mApiId = preferences.getString(API_KEY, getString(R.string.default_key)); mOpenWeatherMapService.setApiKey(mApiId); mOpenWeatherMapService.setApiKey(mApiId); } } Loading Loading @@ -146,7 +146,7 @@ public class OpenWeatherMapProviderService extends WeatherProviderService public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equals(API_KEY)) { if (key.equals(API_KEY)) { Logging.logd("API key has changed"); Logging.logd("API key has changed"); final String mApiKey = sharedPreferences.getString(key, null); final String mApiKey = sharedPreferences.getString(key, getString(R.string.default_key)); mOpenWeatherMapService.setApiKey(mApiKey); mOpenWeatherMapService.setApiKey(mApiKey); } } } } Loading
app/src/main/res/values/strings.xml +2 −0 Original line number Original line Diff line number Diff line Loading @@ -37,4 +37,6 @@ <string name="prefscreen_disclaimer_summary">The information provided by this application is provided for general information purposes only</string> <string name="prefscreen_disclaimer_summary">The information provided by this application is provided for general information purposes only</string> <string name="copyright_title">Copyright</string> <string name="copyright_title">Copyright</string> <string name="copyright_summary">OpenWeatherMap is a registered trademark of OpenWeatherMap Inc, both in the United States and internationally</string> <string name="copyright_summary">OpenWeatherMap is a registered trademark of OpenWeatherMap Inc, both in the United States and internationally</string> <string name="default_key"></string> </resources> </resources> No newline at end of file
app/src/main/res/xml/preferences.xml +1 −1 File changed.Contains only whitespace changes. Show changes