Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 145b22ff authored by nift4's avatar nift4 Committed by Michael W
Browse files

Dialer: add proper-ish Direct Boot support

This is a terribly important oversight. Direct Boot lockscreens REALLY
should support dialing 112 or whatever emergency number users use
without the Dialer app crashing...

Change-Id: Iaafadf7d29352c53b29ce7db1ebd5bfb651fa49b
parent f97aad06
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class SoundSettingsFragment extends DialerPreferenceFragment
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getPreferenceManager().setStorageDeviceProtected();

    addPreferencesFromResource(R.xml.sound_settings);

+2 −1
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ public class CallRecorderService extends Service {
    // that we need multi process preferences, as the pref is written in a separate
    // process (com.android.dialer vs. com.android.incallui)
    final String prefName = getPackageName() + "_preferences";
    final SharedPreferences prefs = getSharedPreferences(prefName, MODE_MULTI_PROCESS);
    final SharedPreferences prefs = createDeviceProtectedStorageContext()
            .getSharedPreferences(prefName, MODE_MULTI_PROCESS);

    try {
      String value = prefs.getString(getString(R.string.call_recording_format_key), null);
+2 −1
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@ public final class LookupSettings {
  }

  private static SharedPreferences getSharedPreferences(Context context) {
    return context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
    return context.createDeviceProtectedStorageContext()
            .getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
  }

  public static boolean isForwardLookupEnabled(Context context) {
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public class LookupSettingsFragment extends DialerPreferenceFragment
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getPreferenceManager().setStorageDeviceProtected();

    addPreferencesFromResource(R.xml.lookup_settings);

+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ public class InCallDndHandler implements InCallPresenter.InCallStateListener {
  private int userSelectedDndMode;

  public InCallDndHandler(Context context) {
    prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs = PreferenceManager.getDefaultSharedPreferences(
                context.createDeviceProtectedStorageContext());
    notificationManager = context.getSystemService(NotificationManager.class);

    // Save the user's Do Not Disturb mode so that it can be restored when the call ends