Android 8.1 删除Launcher桌面搜索框
最近接到项目反馈,要求删除Launcher桌面的搜索框,具体修改参照如下:
/vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/config/BaseFlags.java
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
- public static final boolean QSB_ON_FIRST_SCREEN = true;+ public static final boolean QSB_IN_HOTSEAT = false;
- public static final boolean QSB_IN_HOTSEAT = true;
/vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/provider/ImportDataTask.java
private void importWorkspaceItems(long firsetScreenId, LongSparseArray<Long> screenIdMap) throws Exception {String profileId = Long.toString(UserManagerCompat.getInstance(mContext).getSerialNumberForUser(Process.myUserHandle()));boolean createEmptyRowOnFirstScreen;if (FeatureFlags.QSB_ON_FIRST_SCREEN) {try (Cursor c = mContext.getContentResolver().query(mOtherFavoritesUri, null,// get items on the first row of the first screen"profileId = ? AND container = -100 AND screen = ? AND cellY = 0",new String[]{profileId, Long.toString(firsetScreenId)},null)) {// First row of first screen is not emptycreateEmptyRowOnFirstScreen = c.moveToNext();}
+ } else {
+ createEmptyRowOnFirstScreen = false;}
重新编译验证,修改生效,Launcher桌面的搜索框已删除