Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors. Test: We can't test it now. But we will have an integration test later. Bug: 110259478 Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
This commit is contained in:
@@ -17,8 +17,6 @@
|
||||
package com.android.settings.password;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.Dialog;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.Context;
|
||||
@@ -42,6 +40,7 @@ import com.android.setupwizardlib.util.WizardManagerHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog.Builder;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
@@ -133,7 +132,7 @@ public class ChooseLockTypeDialogFragment extends InstrumentedDialogFragment
|
||||
mAdapter = new ScreenLockAdapter(context, locks, mController);
|
||||
builder.setAdapter(mAdapter, this);
|
||||
builder.setTitle(R.string.setup_lock_settings_options_dialog_title);
|
||||
AlertDialog alertDialog = builder.create();
|
||||
Dialog alertDialog = builder.create();
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,7 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
|
||||
}
|
||||
|
||||
private ConfirmDeviceCredentialBaseFragment getFragment() {
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.main_content);
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.main_content);
|
||||
if (fragment != null && fragment instanceof ConfirmDeviceCredentialBaseFragment) {
|
||||
return (ConfirmDeviceCredentialBaseFragment) fragment;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.main_content);
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.main_content);
|
||||
if (fragment != null && fragment instanceof ConfirmLockPasswordFragment) {
|
||||
((ConfirmLockPasswordFragment)fragment).onWindowFocusChanged(hasFocus);
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ import com.android.settings.utils.SettingsDividerItemDecoration;
|
||||
import com.android.setupwizardlib.GlifPreferenceLayout;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric {
|
||||
}
|
||||
|
||||
@Override
|
||||
/* package */ Class<? extends PreferenceFragment> getFragmentClass() {
|
||||
/* package */ Class<? extends PreferenceFragmentCompat> getFragmentClass() {
|
||||
return SetupChooseLockGenericFragment.class;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user