Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
android_packages_apps_OpenWeatherMapProvider
Commits
9d8b1ca4
Commit
9d8b1ca4
authored
Jan 21, 2018
by
Michael Bestas
Browse files
Rebrand for Lineage SDK
Change-Id: I4f70fa62db38f29a279d8cc3082b61aa08ab48fd
parent
9754959f
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
9d8b1ca4
...
...
@@ -24,7 +24,7 @@ android {
}
dependencies
{
compile
'org.
cyanogenmod
:platform.sdk:
5
.+'
compile
'org.
lineageos
:platform.sdk:
8
.+'
compile
'com.google.code.gson:gson:2.7'
compile
'com.squareup.retrofit2:retrofit:2.0.1'
compile
'com.squareup.retrofit2:converter-gson:2.0.1'
...
...
app/src/main/AndroidManifest.xml
View file @
9d8b1ca4
...
...
@@ -16,9 +16,9 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"org.lineageos.openweathermapprovider"
>
<uses-permission
android:name=
"
cyanogenmod
.permission.ACCESS_WEATHER_MANAGER"
/>
<uses-permission
android:name=
"
lineageos
.permission.ACCESS_WEATHER_MANAGER"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-feature
android:name=
"org.
cyanogenmod
.weather"
android:required=
"true"
/>
<uses-feature
android:name=
"org.
lineageos
.weather"
android:required=
"true"
/>
<application
android:allowBackup=
"true"
...
...
@@ -31,12 +31,12 @@
android:name=
"org.lineageos.openweathermapprovider.OpenWeatherMapProviderService"
android:label=
"@string/app_name"
android:exported=
"true"
android:permission=
"
cyanogenmod
.permission.BIND_WEATHER_PROVIDER_SERVICE"
>
android:permission=
"
lineageos
.permission.BIND_WEATHER_PROVIDER_SERVICE"
>
<intent-filter>
<action
android:name=
"
cyanogenmod
.weatherservice.WeatherProviderService"
/>
<action
android:name=
"
lineageos
.weatherservice.WeatherProviderService"
/>
</intent-filter>
<meta-data
android:name=
"
cyanogenmod
.weatherservice"
android:name=
"
lineageos
.weatherservice"
android:resource=
"@xml/openweathermap"
/>
</service>
...
...
app/src/main/java/org/lineageos/openweathermapprovider/OpenWeatherMapProviderService.java
View file @
9d8b1ca4
...
...
@@ -29,13 +29,13 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
cyanogenmod
.weather.
CM
WeatherManager
;
import
cyanogenmod
.weather.RequestInfo
;
import
cyanogenmod
.weather.WeatherInfo
;
import
cyanogenmod
.weather.WeatherLocation
;
import
cyanogenmod
.weatherservice.ServiceRequest
;
import
cyanogenmod
.weatherservice.ServiceRequestResult
;
import
cyanogenmod
.weatherservice.WeatherProviderService
;
import
lineageos
.weather.
Lineage
WeatherManager
;
import
lineageos
.weather.RequestInfo
;
import
lineageos
.weather.WeatherInfo
;
import
lineageos
.weather.WeatherLocation
;
import
lineageos
.weatherservice.ServiceRequest
;
import
lineageos
.weatherservice.ServiceRequestResult
;
import
lineageos
.weatherservice.WeatherProviderService
;
public
class
OpenWeatherMapProviderService
extends
WeatherProviderService
implements
SharedPreferences
.
OnSharedPreferenceChangeListener
{
...
...
@@ -90,7 +90,7 @@ public class OpenWeatherMapProviderService extends WeatherProviderService
||
(
requestType
==
RequestInfo
.
TYPE_WEATHER_BY_WEATHER_LOCATION_REQ
&&
isSameWeatherLocation
(
requestInfo
.
getWeatherLocation
(),
mLastWeatherLocation
)))
&&
wasRequestSubmittedTooSoon
())
{
request
.
reject
(
CM
WeatherManager
.
RequestStatus
.
SUBMITTED_TOO_SOON
);
request
.
reject
(
Lineage
WeatherManager
.
RequestStatus
.
SUBMITTED_TOO_SOON
);
return
;
}
...
...
app/src/main/java/org/lineageos/openweathermapprovider/openweathermap/CurrentWeatherResponse.java
View file @
9d8b1ca4
...
...
@@ -21,7 +21,7 @@ import com.google.gson.annotations.SerializedName;
import
java.io.Serializable
;
import
java.util.List
;
import
cyanogenmod
.providers.WeatherContract
;
import
lineageos
.providers.WeatherContract
;
public
class
CurrentWeatherResponse
implements
Serializable
{
@SerializedName
(
"cod"
)
...
...
app/src/main/java/org/lineageos/openweathermapprovider/openweathermap/ForecastResponse.java
View file @
9d8b1ca4
...
...
@@ -23,7 +23,7 @@ import java.io.Serializable;
import
java.util.ArrayList
;
import
java.util.List
;
import
cyanogenmod
.providers.WeatherContract
;
import
lineageos
.providers.WeatherContract
;
public
class
ForecastResponse
implements
Serializable
{
...
...
app/src/main/java/org/lineageos/openweathermapprovider/openweathermap/OpenWeatherMapService.java
View file @
9d8b1ca4
...
...
@@ -32,10 +32,10 @@ import java.util.List;
import
java.util.Locale
;
import
java.util.Set
;
import
cyanogenmod
.providers.
CM
Settings
;
import
cyanogenmod
.providers.WeatherContract
;
import
cyanogenmod
.weather.WeatherInfo
;
import
cyanogenmod
.weather.WeatherLocation
;
import
lineageos
.providers.
Lineage
Settings
;
import
lineageos
.providers.WeatherContract
;
import
lineageos
.weather.WeatherInfo
;
import
lineageos
.weather.WeatherLocation
;
import
okhttp3.OkHttpClient
;
import
retrofit2.Call
;
import
retrofit2.Response
;
...
...
@@ -535,10 +535,10 @@ public class OpenWeatherMapService {
private
int
getTempUnitFromSettings
()
{
try
{
final
int
tempUnit
=
CM
Settings
.
Global
.
getInt
(
mContext
.
getContentResolver
(),
CM
Settings
.
Global
.
WEATHER_TEMPERATURE_UNIT
);
final
int
tempUnit
=
Lineage
Settings
.
Global
.
getInt
(
mContext
.
getContentResolver
(),
Lineage
Settings
.
Global
.
WEATHER_TEMPERATURE_UNIT
);
return
tempUnit
;
}
catch
(
CM
Settings
.
CM
SettingNotFoundException
e
)
{
}
catch
(
Lineage
Settings
.
Lineage
SettingNotFoundException
e
)
{
//Default to metric
return
WeatherContract
.
WeatherColumns
.
TempUnit
.
CELSIUS
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment