From 35e1bfad098f65db344d4d6fd7abb5830d8aa7a2 Mon Sep 17 00:00:00 2001 From: Ang Li Date: Fri, 11 Jan 2019 12:51:57 -0800 Subject: Migrate to androidx packages (#105) --- .../android/mobly/snippet/bundled/NetworkingSnippet.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/android/mobly/snippet/bundled/NetworkingSnippet.java') diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/NetworkingSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/NetworkingSnippet.java index e89fc12..636c0fd 100644 --- a/src/main/java/com/google/android/mobly/snippet/bundled/NetworkingSnippet.java +++ b/src/main/java/com/google/android/mobly/snippet/bundled/NetworkingSnippet.java @@ -23,7 +23,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.net.Uri; import android.os.Environment; -import android.support.test.InstrumentationRegistry; +import androidx.test.platform.app.InstrumentationRegistry; import com.google.android.mobly.snippet.Snippet; import com.google.android.mobly.snippet.bundled.utils.Utils; import com.google.android.mobly.snippet.rpc.Rpc; @@ -44,7 +44,7 @@ public class NetworkingSnippet implements Snippet { private volatile long mReqid = 0; public NetworkingSnippet() { - mContext = InstrumentationRegistry.getContext(); + mContext = InstrumentationRegistry.getInstrumentation().getContext(); mDownloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); } @@ -78,10 +78,9 @@ public class NetworkingSnippet implements Snippet { } @Rpc( - description = - "Download a file using HTTP. Return content Uri (file remains on device). " - + "The Uri should be treated as an opaque handle for further operations." - ) + description = + "Download a file using HTTP. Return content Uri (file remains on device). " + + "The Uri should be treated as an opaque handle for further operations.") public String networkHttpDownload(String url) throws IllegalArgumentException, NetworkingSnippetException { -- cgit v1.2.3