This commit is contained in:
Jon Atkins 2013-11-10 21:40:37 +00:00
commit 3f15535f48
2 changed files with 6 additions and 7 deletions

View File

@ -43,7 +43,6 @@ import java.util.Stack;
public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeListener, LocationListener {
private static final int REQUEST_LOGIN = 1;
public static final int REQUEST_UPDATE_FINISHED = 2;
private IITC_WebView mIitcWebView;
private final String mIntelUrl = "https://www.ingress.com/intel";
@ -120,7 +119,7 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
mBackStack.clear();
// receive downloadManagers downloadComplete intent
// afterwards install iitc update and clean up after installation
// afterwards install iitc update
registerReceiver(mBroadcastReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
handleIntent(getIntent(), true);
@ -588,9 +587,6 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
// authentication activity has returned. mLogin will continue authentication
mLogin.onActivityResult(resultCode, data);
break;
case REQUEST_UPDATE_FINISHED:
// clean up update apk
deleteUpdateFile();
default:
super.onActivityResult(requestCode, resultCode, data);
}
@ -658,7 +654,7 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
request.allowScanningByMediaScanner();
Uri fileUri = Uri.parse("file://" + getExternalFilesDir(null).toString() + "/iitcUpdate.apk");
request.setDestinationUri(fileUri);
// remove old files (iitcm cleans up after installation, but you never know...)
// remove old update file...we don't want to spam the external storage
deleteUpdateFile();
// get download service and enqueue file
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
@ -669,7 +665,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
String iitcUpdatePath = getExternalFilesDir(null).toString() + "/iitcUpdate.apk";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(iitcUpdatePath)), "application/vnd.android.package-archive");
startActivityForResult(intent, REQUEST_UPDATE_FINISHED);
startActivity(intent);
// finish app, because otherwise it gets killed on update
finish();
}
/**

View File

@ -196,6 +196,7 @@ public class IITC_WebViewClient extends WebViewClient {
Log.d("iitcm", "Login requested: " + realm + " " + account + " " + args);
Log.d("iitcm", "logging in...updating caching mode");
((IITC_WebView) view).updateCaching(true);
mIitcInjected = false;
//((IITC_Mobile) mContext).onReceivedLoginRequest(this, view, realm, account, args);
}