Add logging when launch fragment name is null.
Change-Id: I118c22a46eb794b21f9808978a68afd86b596e4e Fix: 35203478 Test: Manual
This commit is contained in:
@@ -236,6 +236,7 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
private DashboardFeatureProvider mDashboardFeatureProvider;
|
private DashboardFeatureProvider mDashboardFeatureProvider;
|
||||||
private Intent mResultIntentData;
|
private Intent mResultIntentData;
|
||||||
private ComponentName mCurrentSuggestion;
|
private ComponentName mCurrentSuggestion;
|
||||||
|
private final StringBuffer mDebugData = new StringBuffer();
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
String mSearchQuery;
|
String mSearchQuery;
|
||||||
@@ -436,6 +437,9 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!mIsShowingDashboard) {
|
if (!mIsShowingDashboard) {
|
||||||
|
if (initialFragmentName == null) {
|
||||||
|
logFragmentData(intent, className, isSubSettings);
|
||||||
|
}
|
||||||
mDisplaySearch = false;
|
mDisplaySearch = false;
|
||||||
// UP will be shown only if it is a sub settings
|
// UP will be shown only if it is a sub settings
|
||||||
if (mIsShortcut) {
|
if (mIsShortcut) {
|
||||||
@@ -701,6 +705,7 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
String startingFragment = getStartingFragmentClass(superIntent);
|
String startingFragment = getStartingFragmentClass(superIntent);
|
||||||
// This is called from super.onCreate, isMultiPane() is not yet reliable
|
// This is called from super.onCreate, isMultiPane() is not yet reliable
|
||||||
// Do not use onIsHidingHeaders either, which relies itself on this method
|
// Do not use onIsHidingHeaders either, which relies itself on this method
|
||||||
|
log("getIntent() startingFragment", startingFragment);
|
||||||
if (startingFragment != null) {
|
if (startingFragment != null) {
|
||||||
Intent modIntent = new Intent(superIntent);
|
Intent modIntent = new Intent(superIntent);
|
||||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
|
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
|
||||||
@@ -722,9 +727,11 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
* returns the class name to load as a fragment.
|
* returns the class name to load as a fragment.
|
||||||
*/
|
*/
|
||||||
private String getStartingFragmentClass(Intent intent) {
|
private String getStartingFragmentClass(Intent intent) {
|
||||||
|
log("getStartingFragmentClass() mFragmentClass", mFragmentClass);
|
||||||
if (mFragmentClass != null) return mFragmentClass;
|
if (mFragmentClass != null) return mFragmentClass;
|
||||||
|
|
||||||
String intentClass = intent.getComponent().getClassName();
|
String intentClass = intent.getComponent().getClassName();
|
||||||
|
log("getStartingFragmentClass() intentClass", intentClass);
|
||||||
if (intentClass.equals(getClass().getName())) return null;
|
if (intentClass.equals(getClass().getName())) return null;
|
||||||
|
|
||||||
if ("com.android.settings.ManageApplications".equals(intentClass)
|
if ("com.android.settings.ManageApplications".equals(intentClass)
|
||||||
@@ -1154,4 +1161,37 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
}
|
}
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void logFragmentData(Intent intent, String className, boolean isSubSettings) {
|
||||||
|
if (intent != null) {
|
||||||
|
logBundleData(intent.getExtras(), "Intent extra");
|
||||||
|
logBundleData(intent.getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS), "Fragment args");
|
||||||
|
} else {
|
||||||
|
log("Intent data", "NULL");
|
||||||
|
}
|
||||||
|
log("Fragment", mFragmentClass);
|
||||||
|
log("Shortcut", mIsShortcut);
|
||||||
|
log("Class Name", className);
|
||||||
|
log("Show dashboard", mIsShowingDashboard);
|
||||||
|
log("Sub setting", isSubSettings);
|
||||||
|
log("Title", mInitialTitle);
|
||||||
|
Log.d(LOG_TAG, mDebugData.toString());
|
||||||
|
mDebugData.delete(0, mDebugData.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void logBundleData(Bundle data, String name) {
|
||||||
|
if (data != null) {
|
||||||
|
final Set<String> keys = data.keySet();
|
||||||
|
mDebugData.append(name).append(": ");
|
||||||
|
for (String key : keys) {
|
||||||
|
log(key, data.get(key));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log(name, "NULL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void log(String key, Object data) {
|
||||||
|
mDebugData.append(key).append("=").append(data).append(", ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user