Commit Graph

6 Commits

Author SHA1 Message Date
Luis Vidal ad5e5d019f Remove public default constructor from CMWeatherManager.RequestStatus [1/2]
RequestStatus holds only final constants and should not provide
public constructors. This class also should be final.

This patch also fix minor typos on RequestStatus javadoc

Change-Id: I0deb1d6a9b23eed83451dec352bb4c410e2378d6
TICKET: CYNGNOS-2441
2016-04-13 17:52:16 -07:00
Luis Vidal fe1812fd38 Weather API: Delegate the responsability of rejecting back to back requests [1/2]
The Weather Manager Service should not impose rules regarding how
a weather provide service wants to react to back to back weather
update requests, nor impose the time a caller should wait before
a new request can be submitted. These constraints vary between
weather services, so it's up the each implementation to enforce
these constraints.

With this patch, the Weather manager service will pass the requests
as they come from the requester and it will be up to the active service
provider decide whether process or reject the request.

Changes to API:
- Moved the request statuses to new inner class RequestStatus in
 CMWeatherManager
- Pass status arg to onLookupCityRequestCompleted()
- Added reject(int) method to ServiceRequest

Change-Id: I3512490688255e25395e955d506fe42ed52f8fe0
TICKET: CYNGNOS-2430
2016-04-13 15:22:40 -07:00
Luis Vidal 377fffca69 Use temperature unit from CMSettings on weather update requests
Make sure the the weather update requests are using the temperature
unit set by the user in the weather settings

Change-Id: Iac3a891b5afbcf36a87386f828b40bcbd0e1de02
TICKET: CYNGNOS-2429
2016-04-13 14:56:24 -07:00
Luis Vidal ad0d8c53a0 Weather API: Return ID rather than RequestInfo [1/2]
Instead of exposing the RequestInfo object created by the WeatherMgr
return an ID to identify the request. This ID can be later used to
cancel the request if needed. The WeatherProviderService base class
keeps track of the ongoing requests and can map this ID to the
corresponding request

This patch also include the following minor changes:
- Use List instead of ArrayList in API
- Update javadoc to public methods to reflect API changes
- Use UUID random generator in immutable classes to generate the
  hashcode rather than relying solely in the hashcode of the builder
  object.

Change-Id: Ib88dd0ecddd6fdb016b77ac29709fbae092dea29
TICKET: CYNGNOS-2425
TICKET: CYNGNOS-2423
2016-04-13 11:57:38 -07:00
Luis Vidal 343245f4e6 Add API to cancel an active weather request
Add new API cancelRequest to CMWeatherManager. This will allow
clients to cancel a request that was previuosly submitted to
the weather service.

As part of this change, requestWeatherUpdate(weatherLocation),
requestWeatherUpdate(Location) and lookupCity(cityName) will
now return the RequestInfo object created if the request
was successfully submitted to the weather manager service

TICKET: CYNGNOS-2383
TICKET: CYNGNOS-2385

Change-Id: Ic122f91e0ea8a24d81dbed48741ef1e33567b56c
2016-04-07 22:42:43 -07:00
Adnan Begovic 5f6c9f40c7 cmsdk: Move sdk classes under new sdk directory.
TICKET: CYNGNOS-2299
Change-Id: Ia6c6a1ee901f4f94446c379cbceabfdfced651ef
2016-04-01 12:22:14 -07:00