aboutsummaryrefslogtreecommitdiffstats
path: root/cm
diff options
context:
space:
mode:
authorLuis Vidal <lvidal@cyngn.com>2016-04-06 15:39:49 -0700
committerLuis Vidal <lvidal@cyngn.com>2016-04-07 22:42:43 -0700
commit343245f4e6331b1059240150e62e0c9a9d8d3a54 (patch)
tree2a8901d3268646f2576033895e95be7a7aed4410 /cm
parent2eddb5f7c706d37004e06ecd5c39d0f3ab724f55 (diff)
downloadvendor_cmsdk-343245f4e6331b1059240150e62e0c9a9d8d3a54.zip
vendor_cmsdk-343245f4e6331b1059240150e62e0c9a9d8d3a54.tar.gz
vendor_cmsdk-343245f4e6331b1059240150e62e0c9a9d8d3a54.tar.bz2
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
Diffstat (limited to 'cm')
-rw-r--r--cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
index faab108..d34454e 100644
--- a/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
+++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/CMWeatherManagerService.java
@@ -220,6 +220,12 @@ public class CMWeatherManagerService extends SystemService{
}
return null;
}
+
+ @Override
+ public void cancelRequest(RequestInfo info) {
+ enforcePermission();
+ processCancelRequest(info);
+ }
};
private String getComponentLabel(ComponentName componentName) {
@@ -334,6 +340,15 @@ public class CMWeatherManagerService extends SystemService{
}
}
+ private void processCancelRequest(RequestInfo info) {
+ if (mIsWeatherProviderServiceBound) {
+ try {
+ mWeatherProviderService.cancelRequest(info);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
private ServiceConnection mWeatherServiceProviderConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {