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:
parent
9c47f56f03
commit
ab709e171a
@ -55,7 +55,6 @@ public class ApkDownloader implements AsyncDownloader.Listener {
|
||||
public static final String EVENT_ERROR = "apkDownloadError";
|
||||
|
||||
public static final String ACTION_STATUS = "apkDownloadStatus";
|
||||
public static final String EXTRA_TYPE = "apkDownloadStatusType";
|
||||
public static final String EXTRA_URL = "apkDownloadUrl";
|
||||
|
||||
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.putExtras(event.getData());
|
||||
intent.putExtra(EXTRA_TYPE, event.type);
|
||||
intent.putExtra(EXTRA_URL, Utils.getApkUrl(repoAddress, curApk));
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
|
||||
}
|
||||
|
@ -279,18 +279,8 @@ public class SwapAppsView extends ListView implements
|
||||
// apkToInstall. This way, we can wait until we receive an incoming intent (if
|
||||
// at all) and then lazily load the apk to install.
|
||||
String broadcastUrl = intent.getStringExtra(ApkDownloader.EXTRA_URL);
|
||||
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();
|
||||
break;
|
||||
if (TextUtils.equals(Utils.getApkUrl(apk.repoAddress, apk), broadcastUrl)) {
|
||||
resetView();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user