AOSP_去除桌面不能删除的搜索框

修改以下文件:

packages/apps/Launcher3/src/com/android/launcher3/Launcher.java

加一个public,加哪里你应该知道

public static boolean isQsbDisabled(){
    return true;
}

搜索mQsbContainer

你可以设置他的属性,你平常怎么设置控件属性一个道理

if(isQsbDisabled())mQsbContainer.setVisibility(View.GONE);

packages/apps/Launcher3/src/com/android/launcher3/Workspace.java

-        if (!firstPage.addViewToCellLayout(qsb, 0, getEmbeddedQsbId(), lp, true)) {
+        if (!Launcher.isQsbDisabled() && !firstPage.addViewToCellLayout(qsb, 0, getEmbeddedQsbId(), lp, true)) {
             Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");
         }
public static final boolean isQsbContainerPage(int pageNo) {
-        return pageNo == 0;
+        return !Launcher.isQsbDisabled() && pageNo == 0;
     }

看得懂+-什么意思吧

packages/apps/Launcher3/src/com/android/launcher3/util/MultiStateAlphaController.java

         mTargetView.setAlpha(finalAlpha);
         mTargetView.setVisibility(finalAlpha > 0 ? View.VISIBLE
                 : (mAm.isEnabled() ? View.GONE : View.INVISIBLE));
+        if(com.android.launcher3.R.id.qsb_container == mTargetView.getId() && com.android.launcher3.Launcher.isQsbDisabled()){
+            mTargetView.setVisibility(View.GONE);
+        }

编译

cd  packages/apps/Launcher3/
mma -j16
make snod

烧录

fastboot flash system out/target/product/bullhead/system.img

 

posted @ 2023-03-19 14:20  Z_Chan  阅读(80)  评论(0编辑  收藏  举报