From: David A. Velasco Date: Wed, 22 Apr 2015 07:35:37 +0000 (+0200) Subject: Merge branch 'develop' into loging_different_servers_same_pattern X-Git-Tag: test~30^2~2 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/968c535e19e40bee7df8609fd050bc2196ca95e6?hp=-c Merge branch 'develop' into loging_different_servers_same_pattern Conflicts SOLVED in: src/com/owncloud/android/ui/activity/FileActivity.java --- 968c535e19e40bee7df8609fd050bc2196ca95e6 diff --combined src/com/owncloud/android/ui/activity/FileActivity.java index e3af8368,8a5449e7..17aa8c04 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@@ -151,8 -151,6 +151,8 @@@ public class FileActivity extends Sherl mFromNotification = getIntent().getBooleanExtra(FileActivity.EXTRA_FROM_NOTIFICATION, false); } + AccountUtils.updateAccountVersion(this); // best place, before any access to AccountManager or database + setAccount(account, savedInstanceState != null); mOperationsServiceConnection = new OperationsServiceConnection(); @@@ -169,6 -167,17 +169,16 @@@ } - + @Override + protected void onNewIntent (Intent intent) { + Log_OC.v(TAG, "onNewIntent() start"); + Account current = AccountUtils.getCurrentOwnCloudAccount(this); + if (current != null && mAccount != null && !mAccount.name.equals(current.name)) { + mAccount = current; + } + Log_OC.v(TAG, "onNewIntent() stop"); + } + /** * Since ownCloud {@link Account}s can be managed from the system setting menu, * the existence of the {@link Account} associated to the instance must be checked @@@ -176,46 -185,54 +186,54 @@@ */ @Override protected void onRestart() { + Log_OC.v(TAG, "onRestart() start"); super.onRestart(); - boolean validAccount = (mAccount != null && AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), mAccount.name)); + boolean validAccount = (mAccount != null && AccountUtils.exists(mAccount, this)); if (!validAccount) { swapToDefaultAccount(); } + Log_OC.v(TAG, "onRestart() end"); } @Override protected void onStart() { + Log_OC.v(TAG, "onStart() start"); super.onStart(); if (mAccountWasSet) { onAccountSet(mAccountWasRestored); } + Log_OC.v(TAG, "onStart() end"); } @Override protected void onResume() { + Log_OC.v(TAG, "onResume() start"); super.onResume(); if (mOperationsServiceBinder != null) { doOnResumeAndBound(); } - + Log_OC.v(TAG, "onResume() end"); } @Override protected void onPause() { - + Log_OC.v(TAG, "onPause() start"); + if (mOperationsServiceBinder != null) { mOperationsServiceBinder.removeOperationListener(this); } super.onPause(); + Log_OC.v(TAG, "onPause() end"); } @Override protected void onDestroy() { + Log_OC.v(TAG, "onDestroy() start"); if (mOperationsServiceConnection != null) { unbindService(mOperationsServiceConnection); mOperationsServiceBinder = null; @@@ -230,6 -247,7 +248,7 @@@ } super.onDestroy(); + Log_OC.v(TAG, "onDestroy() end"); } @@@ -245,7 -263,8 +264,8 @@@ */ protected void setAccount(Account account, boolean savedAccount) { Account oldAccount = mAccount; - boolean validAccount = (account != null && AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), account.name)); + boolean validAccount = + (account != null && AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), account.name)); if (validAccount) { mAccount = account; mAccountWasSet = true; @@@ -546,7 -565,9 +566,9 @@@ } } - private void onSynchronizeFolderOperationFinish(SynchronizeFolderOperation operation, RemoteOperationResult result) { + private void onSynchronizeFolderOperationFinish( + SynchronizeFolderOperation operation, RemoteOperationResult result + ) { if (!result.isSuccess() && result.getCode() != ResultCode.CANCELLED){ Toast t = Toast.makeText(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), Toast.LENGTH_LONG);