Broadscale logging for Settings

Bug: 26687914
Change-Id: Ida75ccf95376538e2ba95d212d333c40fd2dd6e0
This commit is contained in:
Jason Monk
2016-01-20 14:41:52 -05:00
parent 7368750b4f
commit 31c7c32fcc
38 changed files with 271 additions and 160 deletions

View File

@@ -457,6 +457,21 @@ public class SettingsActivity extends SettingsDrawerActivity
return true;
}
@Override
public SharedPreferences getSharedPreferences(String name, int mode) {
if (name.equals(getPackageName() + "_preferences")) {
String tag = getClass().getName();
if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
tag = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
}
if (tag.startsWith("com.android.settings.")) {
tag = tag.replace("com.android.settings.", "");
}
return new SharedPreferencesLogger(this, tag);
}
return super.getSharedPreferences(name, mode);
}
private static boolean isShortCutIntent(final Intent intent) {
Set<String> categories = intent.getCategories();
return (categories != null) && categories.contains("com.android.settings.SHORTCUT");