public abstract class

WeatherProviderService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ lineageos.weatherservice.WeatherProviderService

Class Overview

This is the base class for implementing a weather provider service. A weather provider service can handle weather update requests and update the weather content provider data by processing a ServiceRequest A weather provider service is declared as any other service in an AndroidManifest.xml but it must also specify that in handles the Intent with action lineageos.weatherservice.WeatherProviderService. Failure to declare this intent will cause the system to ignore the weather provider service. Additionally, a weather provider service must request the BIND_WEATHER_PROVIDER_SERVICE permission to ensure that only the system can bind to it. Failure to request this permission will cause the system to ignore this weather provider service. Following is an example declaration:

    <service android:name=".MyWeatherProviderService"
          android:permission="lineageos.permission.BIND_WEATHER_PROVIDER_SERVICE">
      <intent-filter>
          <action android:name="lineageos.weatherservice.WeatherProviderService" />
      <intent-filter>
      . . .
    </service>
 

Summary

Constants
String SERVICE_INTERFACE The Intent action that must be declared as handled by a service in its manifest for the system to recognize it as a weather provider service
String SERVICE_META_DATA Name under which a WeatherProviderService publishes information about itself.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
WeatherProviderService()
Public Methods
final IBinder onBind(Intent intent)
Protected Methods
final void attachBaseContext(Context base)
void onConnected()
The system has connected to this service.
void onDisconnected()
The system has disconnected from this service.
abstract void onRequestCancelled(ServiceRequest request)
Called when the system is not interested on this request anymore.
abstract void onRequestSubmitted(ServiceRequest request)
A new request has been submitted to this service
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Constants

public static final String SERVICE_INTERFACE

added in API level 5

The Intent action that must be declared as handled by a service in its manifest for the system to recognize it as a weather provider service

Constant Value: "lineageos.weatherservice.WeatherProviderService"

public static final String SERVICE_META_DATA

added in API level 5

Name under which a WeatherProviderService publishes information about itself. This meta-data must reference an XML resource containing a <weather-provider-service> tag.

Constant Value: "lineageos.weatherservice"

Public Constructors

public WeatherProviderService ()

added in API level 5

Public Methods

public final IBinder onBind (Intent intent)

added in API level 5

Parameters
intent Intent
Returns
IBinder

Protected Methods

protected final void attachBaseContext (Context base)

added in API level 5

Parameters
base Context

protected void onConnected ()

added in API level 5

The system has connected to this service.

protected void onDisconnected ()

added in API level 5

The system has disconnected from this service.

protected abstract void onRequestCancelled (ServiceRequest request)

added in API level 5

Called when the system is not interested on this request anymore. Note that the service has marked the request as cancelled and you must stop any ongoing operation (such as pulling data from internet) that this service could've been performing to honor the request.

Parameters
request ServiceRequest: The request cancelled by the system

protected abstract void onRequestSubmitted (ServiceRequest request)

added in API level 5

A new request has been submitted to this service

Parameters
request ServiceRequest: The service request to be processed by this service