From 48c5eb018b1731bd47caccd43cda2cd36ebc271f Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Sun, 29 Jul 2012 21:23:08 -0700 Subject: DO NOT MERGE. Add package-name-prefix blacklist for location updates. The Settings.Secure value locationPackagePrefixBlacklist and locationPackagePrefixWhitelist contains comma seperated package-name prefixes. Location & geo-fence updates are silently dropped if the receiving package name has a prefix on the blacklist. Status updates are not affected. All other API's work as before. A content observer is used so run-time updates to the blacklist apply immediately. There is both a blacklist and a whitelist. The blacklist applies first, and then exemptions are allowed from the whitelist. In other words, if your package name prefix matches both the black AND white list, then it is allowed. Change-Id: I4ea2ad56fa6bd75d32151bc250ac25c26a5777c4 --- core/java/android/app/ContextImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index b902550..411f6d0 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -361,10 +361,10 @@ class ContextImpl extends Context { return PolicyManager.makeNewLayoutInflater(ctx.getOuterContext()); }}); - registerService(LOCATION_SERVICE, new StaticServiceFetcher() { - public Object createStaticService() { + registerService(LOCATION_SERVICE, new ServiceFetcher() { + public Object createService(ContextImpl ctx) { IBinder b = ServiceManager.getService(LOCATION_SERVICE); - return new LocationManager(ILocationManager.Stub.asInterface(b)); + return new LocationManager(ctx, ILocationManager.Stub.asInterface(b)); }}); registerService(NETWORK_POLICY_SERVICE, new ServiceFetcher() { -- cgit v1.1