feat: Add option to clear home screen in settings (#6125)
Signed-off-by: abhixv <abhi.sharma1@hotmail.com>
This commit is contained in:
committed by
Pun Butrach
parent
9898749619
commit
5f3a03f4fb
@@ -15,15 +15,12 @@
|
||||
*/
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_HIDE_FROM_PICKER;
|
||||
|
||||
import android.appwidget.AppWidgetProviderInfo;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
|
||||
@@ -85,30 +82,13 @@ public class WidgetUtils {
|
||||
|
||||
/**
|
||||
* Creates a {@link AppWidgetProviderInfo} for the provided component name
|
||||
*
|
||||
* @param cn component name of the appwidget provider
|
||||
* @param hideFromPicker indicates if the widget should appear in widget picker
|
||||
*/
|
||||
public static AppWidgetProviderInfo createAppWidgetProviderInfo(ComponentName cn,
|
||||
boolean hideFromPicker) {
|
||||
public static AppWidgetProviderInfo createAppWidgetProviderInfo(ComponentName cn) {
|
||||
ActivityInfo activityInfo = new ActivityInfo();
|
||||
activityInfo.applicationInfo = new ApplicationInfo();
|
||||
activityInfo.applicationInfo.uid = Process.myUid();
|
||||
AppWidgetProviderInfo info = new AppWidgetProviderInfo();
|
||||
if (hideFromPicker) {
|
||||
info.widgetFeatures = WIDGET_FEATURE_HIDE_FROM_PICKER;
|
||||
}
|
||||
info.providerInfo = activityInfo;
|
||||
info.provider = cn;
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link AppWidgetProviderInfo} for the provided component name
|
||||
*
|
||||
* @param cn component name of the appwidget provider
|
||||
*/
|
||||
public static AppWidgetProviderInfo createAppWidgetProviderInfo(ComponentName cn) {
|
||||
return createAppWidgetProviderInfo(cn, /*hideFromPicker=*/ false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user