diff --git a/res/xml/security_dashboard_settings.xml b/res/xml/security_dashboard_settings.xml index b7829d4a85c..9626a29ac3d 100644 --- a/res/xml/security_dashboard_settings.xml +++ b/res/xml/security_dashboard_settings.xml @@ -62,47 +62,6 @@ settings:keywords="@string/keywords_biometric_settings" /> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java b/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java index f2a94ba7440..107df5fc50f 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java @@ -26,8 +26,10 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; +import android.net.Uri; import android.os.RemoteException; import android.os.ServiceManager; +import android.provider.DeviceConfig; import android.text.TextUtils; import android.util.Log; @@ -39,6 +41,8 @@ import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceScreen; import com.android.settings.R; +import com.android.settings.core.SettingsUIDeviceConfig; +import com.android.settings.overlay.FeatureFactory; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.core.lifecycle.Lifecycle; @@ -179,6 +183,18 @@ public class BluetoothDetailsCompanionAppsController extends BluetoothDetailsCon */ public void updatePreferences(Context context, String address, PreferenceCategory container) { + // If the device is FastPair, remove CDM companion apps. + final BluetoothFeatureProvider bluetoothFeatureProvider = FeatureFactory.getFactory(context) + .getBluetoothFeatureProvider(context); + final boolean sliceEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI, + SettingsUIDeviceConfig.BT_SLICE_SETTINGS_ENABLED, true); + final Uri settingsUri = bluetoothFeatureProvider.getBluetoothDeviceSettingsUri( + mCachedDevice.getDevice()); + if (sliceEnabled && settingsUri != null) { + container.removeAll(); + return; + } + Set addedPackages = new HashSet<>(); for (String packageName : getPreferencesNeedToShow(address, container)) { diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java index 40297551152..de3ee517779 100644 --- a/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java +++ b/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java @@ -18,6 +18,8 @@ package com.android.settings.password; import android.app.KeyguardManager; import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; import android.os.UserManager; import android.util.Log; import android.view.MenuItem; @@ -163,11 +165,14 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi @Override public void onDestroy() { super.onDestroy(); - // Force a garbage collection immediately to remove remnant of user password shards - // from memory. - System.gc(); - System.runFinalization(); - System.gc(); + // Force a garbage collection to remove remnant of user password shards from memory. + // Execute this with a slight delay to allow the activity lifecycle to complete and + // the instance to become gc-able. + new Handler(Looper.myLooper()).postDelayed(() -> { + System.gc(); + System.runFinalization(); + System.gc(); + }, 5000); } @Override diff --git a/src/com/android/settings/password/ConfirmLockPassword.java b/src/com/android/settings/password/ConfirmLockPassword.java index 0278941e797..de32f139594 100644 --- a/src/com/android/settings/password/ConfirmLockPassword.java +++ b/src/com/android/settings/password/ConfirmLockPassword.java @@ -25,6 +25,8 @@ import android.graphics.Typeface; import android.os.AsyncTask; import android.os.Bundle; import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Looper; import android.os.SystemClock; import android.os.UserManager; import android.os.storage.StorageManager; @@ -216,11 +218,14 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity { public void onDestroy() { super.onDestroy(); mPasswordEntry.setText(null); - // Force a garbage collection immediately to remove remnant of user password shards - // from memory. - System.gc(); - System.runFinalization(); - System.gc(); + // Force a garbage collection to remove remnant of user password shards from memory. + // Execute this with a slight delay to allow the activity lifecycle to complete and + // the instance to become gc-able. + new Handler(Looper.myLooper()).postDelayed(() -> { + System.gc(); + System.runFinalization(); + System.gc(); + }, 5000); } private int getDefaultHeader() {