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

Commit f154e133 authored by Elektroschmock's avatar Elektroschmock
Browse files

Settings: Fix automatic hotspot turn off summary

Change-Id: I066cf2c1d757a4bfb8a84094969710f58e444422
parent 9d0198fe
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -305,11 +305,21 @@ public class TetherSettings extends RestrictedSettingsFragment
    }

    private void updateHotspotTimeoutSummary(WifiConfiguration wifiConfig) {
        mHotspotInactivityTimeout.setValue(
                (wifiConfig == null) ? "0" : Long.toString(wifiConfig.wifiApInactivityTimeout));
        if (wifiConfig == null) {
            mHotspotInactivityTimeout.setValue("0");
            mHotspotInactivityTimeout.setSummary(
                    getString(R.string.hotstpot_inactivity_timeout_never_summary_text));
        } else {
            mHotspotInactivityTimeout.setValue(Long.toString(wifiConfig.wifiApInactivityTimeout));
            if (wifiConfig.wifiApInactivityTimeout > 0) {
                mHotspotInactivityTimeout.setSummary(String.format(
                        getString(R.string.hotstpot_inactivity_timeout_summary_text,
                                mHotspotInactivityTimeout.getEntry())));
            } else {
                mHotspotInactivityTimeout.setSummary(
                        getString(R.string.hotstpot_inactivity_timeout_never_summary_text));
            }
        }
    }

    @Override