remove ApkDownloader.EXTRA_TYPE, it is entirely unused

This constant is wired up, but ultimately does nothing at all, since all
of the cases in the switch do the exact same thing.
This commit is contained in:
Hans-Christoph Steiner 2016-03-29 11:56:17 +02:00
parent 9c47f56f03
commit ab709e171a
2 changed files with 2 additions and 14 deletions

View File

@ -55,7 +55,6 @@ public class ApkDownloader implements AsyncDownloader.Listener {
public static final String EVENT_ERROR = "apkDownloadError"; public static final String EVENT_ERROR = "apkDownloadError";
public static final String ACTION_STATUS = "apkDownloadStatus"; public static final String ACTION_STATUS = "apkDownloadStatus";
public static final String EXTRA_TYPE = "apkDownloadStatusType";
public static final String EXTRA_URL = "apkDownloadUrl"; public static final String EXTRA_URL = "apkDownloadUrl";
public static final int ERROR_HASH_MISMATCH = 101; public static final int ERROR_HASH_MISMATCH = 101;
@ -227,7 +226,6 @@ public class ApkDownloader implements AsyncDownloader.Listener {
Intent intent = new Intent(ACTION_STATUS); Intent intent = new Intent(ACTION_STATUS);
intent.putExtras(event.getData()); intent.putExtras(event.getData());
intent.putExtra(EXTRA_TYPE, event.type);
intent.putExtra(EXTRA_URL, Utils.getApkUrl(repoAddress, curApk)); intent.putExtra(EXTRA_URL, Utils.getApkUrl(repoAddress, curApk));
LocalBroadcastManager.getInstance(context).sendBroadcast(intent); LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
} }

View File

@ -279,18 +279,8 @@ public class SwapAppsView extends ListView implements
// apkToInstall. This way, we can wait until we receive an incoming intent (if // apkToInstall. This way, we can wait until we receive an incoming intent (if
// at all) and then lazily load the apk to install. // at all) and then lazily load the apk to install.
String broadcastUrl = intent.getStringExtra(ApkDownloader.EXTRA_URL); String broadcastUrl = intent.getStringExtra(ApkDownloader.EXTRA_URL);
if (!TextUtils.equals(Utils.getApkUrl(apk.repoAddress, apk), broadcastUrl)) { if (TextUtils.equals(Utils.getApkUrl(apk.repoAddress, apk), broadcastUrl)) {
return;
}
switch (intent.getStringExtra(ApkDownloader.EXTRA_TYPE)) {
// Fallthrough for each of these "downloader no longer going" events...
case ApkDownloader.EVENT_APK_DOWNLOAD_COMPLETE:
case ApkDownloader.EVENT_APK_DOWNLOAD_CANCELLED:
case ApkDownloader.EVENT_ERROR:
case ApkDownloader.EVENT_DATA_ERROR_TYPE:
resetView(); resetView();
break;
} }
} }
}; };