Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54d07094 authored by Weng Su's avatar Weng Su
Browse files

Refresh title in the Network details header

- Since the title information may be updated later, it needs to be refreshed continuously to display the latest results.

Bug: 299514568
Test: manual test
atest -c WifiDetailPreferenceController2Test

Change-Id: I4634c152b550c59bd9854cde1b91da44442aa879
parent 2c114331
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.net.NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVIT
import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;

import static com.android.settingslib.wifi.WifiUtils.getHotspotIconResource;

import android.app.Activity;
@@ -428,8 +429,6 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
        ImageView iconView = headerPref.findViewById(R.id.entity_header_icon);

        iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);

        mEntityHeaderController.setLabel(mWifiEntry.getTitle());
    }

    private String getExpiryTimeSummary() {
@@ -465,6 +464,7 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle

    private void refreshEntityHeader() {
        mEntityHeaderController
                .setLabel(mWifiEntry.getTitle())
                .setSummary(mWifiEntry.getSummary())
                .setSecondSummary(getExpiryTimeSummary())
                .done(true /* rebind */);
+2 −0
Original line number Diff line number Diff line
@@ -305,6 +305,8 @@ public class WifiDetailPreferenceController2Test {

        ShadowEntityHeaderController.setUseMock(mMockHeaderController);
        // builder pattern
        when(mMockHeaderController.setLabel(any(CharSequence.class)))
                .thenReturn(mMockHeaderController);
        when(mMockHeaderController.setSummary(nullable(String.class)))
                .thenReturn(mMockHeaderController);
        when(mMockHeaderController.setSecondSummary(nullable(String.class)))