Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65707bcf authored by Luis Vidal's avatar Luis Vidal
Browse files

Initial checking of OpenWeatherMap weather provider service

- Moved the implementation from cLock to a new package
- Refactored the code so this service can function as a
  weather provider service and can be detected by the weather
  manager service

Change-Id: Id353451749dda940cecfd3e706e2662e233f0d2f
TICKET: CYNGNOS-2544
parent 98531e31
Loading
Loading
Loading
Loading

Android.mk

0 → 100644
+27 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2016 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_PACKAGE_NAME := OpenWeatherMapProvider
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := \
    org.cyanogenmod.platform.sdk

include $(BUILD_PACKAGE)
 No newline at end of file

AndroidManifest.xml

0 → 100644
+40 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 The CyanogenMod Project (DvTonder)
     Copyright (C) 2016 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="org.cyanogenmod.openweathermapprovider" >

    <uses-permission android:name="android.permission.INTERNET" />

    <application
            android:label="@string/app_name" android:allowBackup="true">
        <service
                android:name=".OpenWeatherMapProviderService"
                android:label="@string/app_name"
                android:exported="true"
                android:permission="cyanogenmod.permission.BIND_WEATHER_PROVIDER_SERVICE">
            <intent-filter>
                <action android:name="cyanogenmod.weatherservice.WeatherProviderService" />
            </intent-filter>
            <meta-data
                    android:name="cyanogenmod.weatherservice"
                    android:resource="@xml/openweathermap" />
        </service>
        <activity android:name=".SettingsActivity"
                  android:label="@string/app_name"
                  android:exported="true" />
    </application>
</manifest>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources>
    <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
    </style>
</resources>
 No newline at end of file

res/values/dimens.xml

0 → 100644
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
</resources>
 No newline at end of file

res/values/strings.xml

0 → 100644
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name" translatable="false">OpenWeatherMap</string>
    <string name="prefscreen_category_authentication_title">Settings</string>
    <string name="prefscreen_category_about_title">About</string>

    <!-- Authentication strings -->
    <string name="prefscreen_api_key_title">API key</string>
    <string name="prefscreen_api_key_summary">Your private API key to access %1$s weather data</string>
    <string name="prefscreen_create_key_title">Create account</string>
    <string name="prefscreen_create_key_summary">Create an account and generate your API key</string>
    <string name="api_key_not_set_message">You must set a private API key to use %1$s</string>

    <!-- Copyright and disclaimers -->
    <string name="prefscreen_copyright_title">Disclaimer</string>
    <string name="prefscreen_copyright_summary">The information provided by this application is provided for general information purposes only and does not claim to be or constitute legal or other professional advice and shall not be relied upon %1$s nor the provider of this application as such.</string>
    <string name="openweathermap_inc_name" translatable="false">OpenWeatherMap, Inc.</string>
</resources>
 No newline at end of file
Loading