Merge "Add @WorkerThread Annotations to RPC calling methods in QsbContainerView." into udc-dev

This commit is contained in:
Stefan Andonian
2023-04-07 23:13:20 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 0 deletions
@@ -38,6 +38,7 @@ import android.util.Log;
import android.util.Xml;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import com.android.launcher3.LauncherProvider.SqlArguments;
import com.android.launcher3.LauncherSettings.Favorites;
@@ -531,6 +532,7 @@ public class AutoInstallsLayout {
protected class SearchWidgetParser extends PendingWidgetParser {
@Override
@Nullable
@WorkerThread
public ComponentName getComponentName(XmlPullParser parser) {
return QsbContainerView.getSearchComponentName(mContext);
}
@@ -40,6 +40,7 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherAppState;
@@ -65,6 +66,7 @@ public class QsbContainerView extends FrameLayout {
* @param context
* @return String
*/
@WorkerThread
@Nullable
public static String getSearchWidgetPackageName(@NonNull Context context) {
String providerPkg = Settings.Global.getString(context.getContentResolver(),
@@ -84,6 +86,7 @@ public class QsbContainerView extends FrameLayout {
* @param context
* @return AppWidgetProviderInfo
*/
@WorkerThread
@Nullable
public static AppWidgetProviderInfo getSearchWidgetProviderInfo(@NonNull Context context) {
String providerPkg = getSearchWidgetPackageName(context);
@@ -110,6 +113,7 @@ public class QsbContainerView extends FrameLayout {
/**
* returns componentName for searchWidget if package name is known.
*/
@WorkerThread
@Nullable
public static ComponentName getSearchComponentName(@NonNull Context context) {
AppWidgetProviderInfo providerInfo =
@@ -317,6 +321,7 @@ public class QsbContainerView extends FrameLayout {
* If widgetCategory is not supported, or no such widget is found, returns the first widget
* provided by the package.
*/
@WorkerThread
protected AppWidgetProviderInfo getSearchWidgetProvider() {
return getSearchWidgetProviderInfo(getContext());
}