From 0e39e4015b3c57ae7089cab50b06f0ef1586c06c Mon Sep 17 00:00:00 2001 From: ligi Date: Sat, 23 Aug 2014 14:24:27 +0200 Subject: [PATCH] use AXT method here --- .../ui/ExtractURLAsIphoneActivity.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/ligi/passandroid/ui/ExtractURLAsIphoneActivity.java b/src/main/java/org/ligi/passandroid/ui/ExtractURLAsIphoneActivity.java index 7e6d5a6b..2fd02d75 100644 --- a/src/main/java/org/ligi/passandroid/ui/ExtractURLAsIphoneActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/ExtractURLAsIphoneActivity.java @@ -2,9 +2,7 @@ package org.ligi.passandroid.ui; import android.app.Activity; import android.app.ProgressDialog; -import android.content.ComponentName; import android.content.Intent; -import android.content.pm.PackageManager; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; @@ -13,6 +11,7 @@ import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.ResponseBody; +import org.ligi.axt.AXT; import org.ligi.passandroid.Tracker; import java.io.IOException; @@ -31,7 +30,6 @@ public class ExtractURLAsIphoneActivity extends Activity { progressDialog = new ProgressDialog(this); progressDialog.show(); - Tracker.get().trackEvent("quirk_fix", "unpack_attempt", getIntent().getData().getHost(), null); new DownloadExtractAndStartImportTask().execute(); @@ -48,7 +46,7 @@ public class ExtractURLAsIphoneActivity extends Activity { requestBuilder.header("User-Agent", InputStreamProvider.IPHONE_USER_AGENT); final ResponseBody body = client.newCall(requestBuilder.build()).execute().body(); - String bodyString = body.string(); + final String bodyString = body.string(); final Pattern p = Pattern.compile("href=\"(.*\\.pkpass.*?)\""); final Matcher m = p.matcher(bodyString); @@ -73,14 +71,7 @@ public class ExtractURLAsIphoneActivity extends Activity { protected void onPostExecute(String s) { super.onPostExecute(s); if (s == null) { - final ComponentName component = new ComponentName(ExtractURLAsIphoneActivity.this, ExtractURLAsIphoneActivity.class); - getPackageManager().setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); - final Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(getIntent().getData()); - - startActivity(intent); - getPackageManager().setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); - + AXT.at(ExtractURLAsIphoneActivity.this).rethrowIntentExcludingSelf(); tearDown(); return; }