Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d140919 authored by Patrick Dubroy's avatar Patrick Dubroy
Browse files

Convert the minWidth and minHeight to device units when calling getInstalledProviders

parent b48fdbe7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -292,7 +292,15 @@ public class AppWidgetManager {
     */
    public List<AppWidgetProviderInfo> getInstalledProviders() {
        try {
            return sService.getInstalledProviders();
            List<AppWidgetProviderInfo> providers = sService.getInstalledProviders();
            for (AppWidgetProviderInfo info : providers) {
                // Converting complex to dp.
                info.minWidth =
                        TypedValue.complexToDimensionPixelSize(info.minWidth, mDisplayMetrics);
                info.minHeight =
                        TypedValue.complexToDimensionPixelSize(info.minHeight, mDisplayMetrics);
            }
            return providers;
        }
        catch (RemoteException e) {
            throw new RuntimeException("system server dead?", e);