Fix Settings crash after disabling Settings Suggestion
- Settings Suggestion App is responsible for searching, we can not prevent user disable it. Hide search feature if user disable it. Fixes: 118805907 Fixes: 117921464 Test: manual Change-Id: I61c47c52265a6efd79ef2fa60272bf6513e678b1
This commit is contained in:
@@ -25,9 +25,11 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toolbar;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.search.SearchIndexableResources;
|
||||
|
||||
@@ -64,6 +66,13 @@ public interface SearchFeatureProvider {
|
||||
if (activity == null || toolbar == null) {
|
||||
return;
|
||||
}
|
||||
if (!Utils.isPackageEnabled(activity, getSettingsIntelligencePkgName())) {
|
||||
final ViewGroup parent = (ViewGroup)toolbar.getParent();
|
||||
if (parent != null) {
|
||||
parent.setVisibility(View.GONE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Please forgive me for what I am about to do.
|
||||
//
|
||||
// Need to make the navigation icon non-clickable so that the entire card is clickable
|
||||
|
Reference in New Issue
Block a user