Update preference screen title.
- Add missing title to preference screen xml so that they will be used to set the activity title when the fragment is launched. - Also updated some incorrect preference screen titles. - Overrides getTitle() in preference fragments that do not use the preference screen xml. Bug: 64564191 Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
This commit is contained in:
@@ -21,9 +21,7 @@ import android.app.ActivityManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AppGlobals;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -38,7 +36,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
@@ -48,7 +45,6 @@ import android.text.TextUtils;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
@@ -80,7 +76,9 @@ public class ZenAccessSettings extends EmptyTextSettings {
|
||||
mContext = getActivity();
|
||||
mPkgMan = mContext.getPackageManager();
|
||||
mNoMan = mContext.getSystemService(NotificationManager.class);
|
||||
setPreferenceScreen(getPreferenceManager().createPreferenceScreen(mContext));
|
||||
if (!usePreferenceScreenTitle()) {
|
||||
setPreferenceScreen(getPreferenceManager().createPreferenceScreen(mContext));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,6 +87,11 @@ public class ZenAccessSettings extends EmptyTextSettings {
|
||||
setEmptyText(R.string.zen_access_empty_text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.zen_access_settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
Reference in New Issue
Block a user