fixed NPE while initializing controllers by commenting out the failure

one for temporal fix

Added @Nullable in parameters of buildPreferenceControllers() to prevent using nullable parameter to functions requires non-nullable.

Bug: 315330037
Test: see developer options preferences show/hide based on the
controllers isAvailable()

Change-Id: If42faea900a2220d9b1f5e38e1befbd5a555e78a
This commit is contained in:
David Liu
2023-12-11 20:58:31 +00:00
parent f04ee0dfab
commit 13c63260a3
3 changed files with 11 additions and 8 deletions

View File

@@ -49,6 +49,7 @@ import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@@ -606,8 +607,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
Activity activity, Lifecycle lifecycle, DevelopmentSettingsDashboardFragment fragment,
BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
@Nullable Activity activity, @Nullable Lifecycle lifecycle,
@Nullable DevelopmentSettingsDashboardFragment fragment,
@Nullable BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new MemoryUsagePreferenceController(context));
controllers.add(new BugReportPreferenceController(context));
@@ -735,7 +737,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
controllers.add(new OverlaySettingsPreferenceController(context));
controllers.add(new StylusHandwritingPreferenceController(context));
controllers.add(new IngressRateLimitPreferenceController((context)));
controllers.add(new BackAnimationPreferenceController(context, fragment));
// controllers.add(new BackAnimationPreferenceController(context, fragment));
controllers.add(new PhantomProcessPreferenceController(context));
controllers.add(new ContrastPreferenceController(
context, context.getSystemService(UiModeManager.class)));