Add debug log to investigate bug 4905749
Change-Id: I1cfe12b0150490ec08caa02332bcca88521ff5fd
This commit is contained in:
parent
94c002349f
commit
d8a2e33998
|
@ -31,6 +31,7 @@ import com.android.emailcommon.provider.Mailbox;
|
|||
import com.android.emailcommon.provider.ProviderUnavailableException;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
|
@ -58,10 +59,13 @@ import android.widget.Toast;
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
@ -1104,4 +1108,11 @@ public class Utility {
|
|||
? new StrictMode.VmPolicy.Builder().detectAll().build()
|
||||
: StrictMode.VmPolicy.LAX);
|
||||
}
|
||||
|
||||
public static String dumpFragment(Fragment f) {
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter w = new PrintWriter(sw);
|
||||
f.dump("", new FileDescriptor(), w, new String[0]);
|
||||
return sw.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,16 +16,6 @@
|
|||
|
||||
package com.android.email.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.android.email.Email;
|
||||
import com.android.email.MessageListContext;
|
||||
import com.android.email.R;
|
||||
|
@ -37,8 +27,19 @@ import com.android.emailcommon.provider.EmailContent.Message;
|
|||
import com.android.emailcommon.provider.HostAuth;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -310,7 +311,16 @@ abstract class UIControllerBase implements MailboxListFragment.Callback,
|
|||
return;
|
||||
}
|
||||
if (!mRemovedFragments.contains(fragment)) {
|
||||
ft.remove(fragment);
|
||||
// STOPSHIP Remove log/catch. b/4905749.
|
||||
Log.d(Logging.LOG_TAG, "Removing " + fragment);
|
||||
try {
|
||||
ft.remove(fragment);
|
||||
} catch (RuntimeException ex) {
|
||||
Log.e(Logging.LOG_TAG, "Got RuntimeException trying to remove fragment: "
|
||||
+ fragment, ex);
|
||||
Log.e(Logging.LOG_TAG, Utility.dumpFragment(fragment));
|
||||
throw ex;
|
||||
}
|
||||
addFragmentToRemovalList(fragment);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue