@@ -998,6 +998,10 @@ public void enablePackageCaches() {
998998 private static ThreadPriorityBooster sThreadPriorityBooster = new ThreadPriorityBooster (
999999 Process .THREAD_PRIORITY_FOREGROUND , LockGuard .INDEX_PACKAGES );
10001000
1001+ private static final String VELVET_PACKAGE = "com.google.android.googlequicksearchbox" ;
1002+ private static final String VELVET_NEW_SEARCH_CLASS = VELVET_PACKAGE + ".OneSearchAimActivity" ;
1003+ private static final String VELVET_SEARCH_MODIFY_PROP = "persist.sys.velvet.force_onesearch" ;
1004+
10011005 /**
10021006 * Boost the priority of the thread before holding PM traced lock.
10031007 * @hide
@@ -4038,6 +4042,18 @@ private void setEnabledSettings(List<ComponentEnabledSetting> settings, int user
40384042 + setting .getComponentName () + " to " + newState );
40394043 }
40404044 }
4045+ if (setting .getPackageName ().equals (VELVET_PACKAGE ) && setting .isComponent ()) {
4046+ ComponentName velvetComponent = setting .getComponentName ();
4047+ if (velvetComponent .getClassName ().equals (VELVET_NEW_SEARCH_CLASS )
4048+ && SystemProperties .getBoolean (VELVET_SEARCH_MODIFY_PROP , true )) {
4049+ final int newState = setting .getEnabledState ();
4050+ if (newState != COMPONENT_ENABLED_STATE_ENABLED
4051+ && newState != COMPONENT_ENABLED_STATE_DEFAULT ) {
4052+ Slog .w (TAG , "Blocking disable of component: " + velvetComponent .flattenToString ());
4053+ updateAllowed [i ] = false ;
4054+ }
4055+ }
4056+ }
40414057 pkgSettings .put (packageName , pkgSetting );
40424058 }
40434059 // Checks for target components
0 commit comments