[QCM6125][Android10] 系统设置隐藏搜索栏以及右上角的搜索按钮

文章目录

    • 开发平台基本信息
    • 解决方法

开发平台基本信息

芯片: QCM6125
版本: Android 10
kernel: msm-4.14

解决方法

--- a/packages/apps/Settings/res/layout/settings_homepage_container.xml
+++ b/packages/apps/Settings/res/layout/settings_homepage_container.xml
@@ -53,9 +53,9 @@
         </LinearLayout>
     </androidx.core.widget.NestedScrollView>
 
-    <com.google.android.material.appbar.AppBarLayout
+    <!-- <com.google.android.material.appbar.AppBarLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
         <include layout="@layout/search_bar"/>
-    </com.google.android.material.appbar.AppBarLayout>
+    </com.google.android.material.appbar.AppBarLayout> -->
 </androidx.coordinatorlayout.widget.CoordinatorLayout>
--- a/packages/apps/Settings/src/com/android/settings/homepage/SettingsHomepageActivity.java
+++ b/packages/apps/Settings/src/com/android/settings/homepage/SettingsHomepageActivity.java
@@ -48,14 +48,14 @@ public class SettingsHomepageActivity extends FragmentActivity {
         root.setSystemUiVisibility(
                 View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
 
-        setHomepageContainerPaddingTop();
+        // setHomepageContainerPaddingTop();
 
-        final Toolbar toolbar = findViewById(R.id.search_action_bar);
-        FeatureFactory.getFactory(this).getSearchFeatureProvider()
-                .initSearchToolbar(this /* activity */, toolbar, SettingsEnums.SETTINGS_HOMEPAGE);
+        // final Toolbar toolbar = findViewById(R.id.search_action_bar);
+        // FeatureFactory.getFactory(this).getSearchFeatureProvider()
+        //         .initSearchToolbar(this /* activity */, toolbar, SettingsEnums.SETTINGS_HOMEPAGE);
 
-        final ImageView avatarView = findViewById(R.id.account_avatar);
-        getLifecycle().addObserver(new AvatarViewMixin(this, avatarView));
+        // final ImageView avatarView = findViewById(R.id.account_avatar);
+        // getLifecycle().addObserver(new AvatarViewMixin(this, avatarView));
         getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
 
         if (!getSystemService(ActivityManager.class).isLowRamDevice()) {
--- a/packages/apps/Settings/src/com/android/settings/search/actionbar/SearchMenuController.java
+++ b/packages/apps/Settings/src/com/android/settings/search/actionbar/SearchMenuController.java
@@ -61,6 +61,9 @@ public class SearchMenuController implements LifecycleObserver, OnCreateOptionsM
 
     @Override
     public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        if(true){
+            return;
+        }
         final Context context = mHost.getContext();
         final String SettingsIntelligencePkgName = context.getString(

你可能感兴趣的:(Android10,QCM6125,Android10,系统设置,Setting,搜索)