Add loading screen for Device details fragment to avoid ANR

BUG: 343317785
Test: local tested
Flag: com.android.settings.flags.enable_bluetooth_device_details_polish
Change-Id: Iad57fc2fe4cb0a3f90e8d01310b9c7ad20d02233
This commit is contained in:
Haijie Hong
2024-11-28 23:25:00 +08:00
parent 9e3f075c3a
commit 67ac0faf3d
9 changed files with 186 additions and 197 deletions

View File

@@ -52,7 +52,6 @@ import androidx.fragment.app.FragmentTransaction;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.bluetooth.ui.model.FragmentTypeModel;
import com.android.settings.bluetooth.ui.view.DeviceDetailsFragmentFormatter;
import com.android.settings.flags.Flags;
import com.android.settings.testutils.FakeFeatureFactory;
@@ -122,10 +121,7 @@ public class BluetoothDeviceDetailsFragmentTest {
removeInputDeviceWithMatchingBluetoothAddress();
FakeFeatureFactory fakeFeatureFactory = FakeFeatureFactory.setupForTest();
when(fakeFeatureFactory.mBluetoothFeatureProvider.getDeviceDetailsFragmentFormatter(any(),
any(), any(), eq(mCachedDevice))).thenReturn(mFormatter);
when(mFormatter.getVisiblePreferenceKeys(
FragmentTypeModel.DeviceDetailsMainFragment.INSTANCE))
.thenReturn(null);
any(), any(), eq(mCachedDevice), any())).thenReturn(mFormatter);
mFragment = setupFragment();
mFragment.onAttach(mContext);