Remove both help and search icons from toolbar of wifi calling

On Android S, both help and search icons will be removed from each
toolbar of subsetting page. Using a feature flage to turn on/off these
menu items. After the collaping toolbar feature rolled out, the option
menu of toolbar will be removed entirely.

Bug: 177640645
Test: visual verified
Change-Id: I005fe85f23f8d28b3a6ca273ddb86ad3390ee0da
This commit is contained in:
Mill Chen
2021-01-15 18:44:31 +08:00
parent 78c6656981
commit b126caa0e7

View File

@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.provider.Settings;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -34,6 +35,7 @@ import androidx.fragment.app.FragmentPagerAdapter;
import com.android.internal.util.CollectionUtils;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.network.SubscriptionUtil;
import com.android.settings.network.ims.WifiCallingQueryImsState;
@@ -119,9 +121,12 @@ public class WifiCallingSettings extends InstrumentedFragment implements HelpRes
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setHasOptionsMenu(true);
SearchMenuController.init(this /* host */);
HelpMenuController.init(this /* host */);
// TODO(b/176883483): Remove the option menu if collapsing toolbar feature rolled out
if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
setHasOptionsMenu(true);
SearchMenuController.init(this /* host */);
HelpMenuController.init(this /* host */);
}
// TODO: besides in onCreate, we should also update subList when SIM / Sub status
// changes.