From 50c85944bf5e949ad5116fec9564318b3be90f24 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 7 Feb 2012 16:23:25 -0800 Subject: Match INetworkPolicyListener changes. Change-Id: I78b6b0380a42b28f42334f93e0538ba7f32bc66d --- src/com/android/providers/downloads/DownloadThread.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index 6e111339..197af664 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -16,8 +16,6 @@ package com.android.providers.downloads; -import static android.Manifest.permission.MANAGE_NETWORK_POLICY; - import android.content.ContentValues; import android.content.Context; import android.content.Intent; @@ -47,7 +45,6 @@ import java.io.InputStream; import java.io.SyncFailedException; import java.net.URI; import java.net.URISyntaxException; -import java.util.Locale; /** * Runs an actual download @@ -959,9 +956,7 @@ public class DownloadThread extends Thread { private INetworkPolicyListener mPolicyListener = new INetworkPolicyListener.Stub() { @Override public void onUidRulesChanged(int uid, int uidRules) { - // only someone like NPMS should only be calling us - mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, Constants.TAG); - + // caller is NPMS, since we only register with them if (uid == mInfo.mUid) { mPolicyDirty = true; } @@ -969,9 +964,13 @@ public class DownloadThread extends Thread { @Override public void onMeteredIfacesChanged(String[] meteredIfaces) { - // only someone like NPMS should only be calling us - mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, Constants.TAG); + // caller is NPMS, since we only register with them + mPolicyDirty = true; + } + @Override + public void onRestrictBackgroundChanged(boolean restrictBackground) { + // caller is NPMS, since we only register with them mPolicyDirty = true; } }; -- cgit v1.2.3