Follow framework refactoring.
Jeff Sharkey [Wed, 6 Jan 2016 17:10:54 +0000 (10:10 -0700)]
Bug: 22958127
Change-Id: I314a9bdd21988bf7e6cc79a2ae842bed29c96f17

tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java
tests/src/com/android/providers/downloads/AbstractPublicApiTest.java

index 7633941..82fa934 100644 (file)
@@ -51,7 +51,7 @@ public class PublicApiAccessTest extends AndroidTestCase {
     protected void setUp() throws Exception {
         super.setUp();
         mContentResolver = getContext().getContentResolver();
-        mManager = new DownloadManager(mContentResolver, getContext().getPackageName());
+        mManager = new DownloadManager(getContext());
     }
 
     @Override
index 2846c7a..c0a1108 100644 (file)
@@ -22,6 +22,8 @@ import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
 import static android.text.format.DateUtils.SECOND_IN_MILLIS;
 
 import android.app.DownloadManager;
+import android.content.ContentResolver;
+import android.content.ContextWrapper;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.ParcelFileDescriptor;
@@ -217,7 +219,17 @@ public abstract class AbstractPublicApiTest extends AbstractDownloadProviderFunc
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        mManager = new DownloadManager(mResolver, PACKAGE_NAME);
+        mManager = new DownloadManager(new ContextWrapper(mContext) {
+            @Override
+            public ContentResolver getContentResolver() {
+                return mResolver;
+            }
+
+            @Override
+            public String getPackageName() {
+                return PACKAGE_NAME;
+            }
+        });
     }
 
     protected DownloadManager.Request getRequest()