Merge "Fix a crash due to absence of no-arg fragment init" into udc-dev am: 3e34c99502

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21958502

Change-Id: I50f9dfb65074976ca9b3ae35cae61abc4bcd7d88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Neil Fuller
2023-03-14 10:30:41 +00:00
committed by Automerger Merge Worker
2 changed files with 3 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ public class LocationTimeZoneDetectionPreferenceController
boolean isLocationEnabled = boolean isLocationEnabled =
timeZoneCapabilitiesAndConfig.getCapabilities().isUseLocationEnabled(); timeZoneCapabilitiesAndConfig.getCapabilities().isUseLocationEnabled();
if (isChecked && !isLocationEnabled) { if (isChecked && !isLocationEnabled) {
new LocationToggleDisabledDialogFragment(mContext) new LocationToggleDisabledDialogFragment()
.show(mFragment.getFragmentManager(), TAG); .show(mFragment.getFragmentManager(), TAG);
// Toggle status is not updated. // Toggle status is not updated.
return false; return false;

View File

@@ -19,7 +19,6 @@ package com.android.settings.datetime;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.settings.SettingsEnums; import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
@@ -32,11 +31,7 @@ import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
*/ */
public class LocationToggleDisabledDialogFragment extends InstrumentedDialogFragment { public class LocationToggleDisabledDialogFragment extends InstrumentedDialogFragment {
private final Context mContext; public LocationToggleDisabledDialogFragment() {}
public LocationToggleDisabledDialogFragment(Context context) {
mContext = context;
}
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
@@ -48,7 +43,7 @@ public class LocationToggleDisabledDialogFragment extends InstrumentedDialogFrag
R.string.location_time_zone_detection_location_is_off_dialog_ok_button, R.string.location_time_zone_detection_location_is_off_dialog_ok_button,
(dialog, which) -> { (dialog, which) -> {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent); getContext().startActivity(intent);
}) })
.setNegativeButton( .setNegativeButton(
R.string.location_time_zone_detection_location_is_off_dialog_cancel_button, R.string.location_time_zone_detection_location_is_off_dialog_cancel_button,