String mainFileName = Helpers.getExpansionAPKFileName(
this
,
true
,
1
);
boolean
fileExists = Helpers.doesFileExist(
this
, mainFileName, 179039558L ,
false
);
if
(!fileExists) {
Intent launcher = getIntent();
Intent fromNotification =
new
Intent(
this
, getClass());
fromNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
fromNotification.setAction(launcher.getAction());
if
(launcher.getCategories() !=
null
) {
for
(String cat : launcher.getCategories()) {
fromNotification.addCategory(cat);
}
}
PendingIntent pendingIntent = PendingIntent.getActivity(
this
,
0
, fromNotification, PendingIntent.FLAG_UPDATE_CURRENT);
try
{
int
result = DownloaderClientMarshaller.startDownloadServiceIfRequired(
this
, pendingIntent, ExpansionFileDownloaderService.
class
);
if
(DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED != result) {
Log.d(
"myLog"
,
"다운로드 중..."
);
return
;
}
}
catch
(NameNotFoundException e) {
Log.e(
"apk-expansion-files"
,
"NameNotFoundException occurred. "
+ e.getMessage(), e);
}
}