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

Commit 02fbb07f authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Handle onUnlockUser on fg thread" into oc-mr1-dev

parents e41a7c80 37b966d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.appwidget;
import android.content.Context;
import android.content.Context;


import com.android.server.AppWidgetBackupBridge;
import com.android.server.AppWidgetBackupBridge;
import com.android.server.FgThread;
import com.android.server.SystemService;
import com.android.server.SystemService;


/**
/**
@@ -48,7 +49,7 @@ public class AppWidgetService extends SystemService {


    @Override
    @Override
    public void onUnlockUser(int userHandle) {
    public void onUnlockUser(int userHandle) {
        mImpl.onUserUnlocked(userHandle);
        FgThread.getHandler().post(() -> mImpl.onUserUnlocked(userHandle));
    }
    }


    @Override
    @Override
+3 −0
Original line number Original line Diff line number Diff line
@@ -2645,6 +2645,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
            Slog.w(TAG, "User " + userId + " is no longer unlocked - exiting");
            Slog.w(TAG, "User " + userId + " is no longer unlocked - exiting");
            return;
            return;
        }
        }
        long time = SystemClock.elapsedRealtime();
        synchronized (mLock) {
        synchronized (mLock) {
            Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "appwidget ensure");
            Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "appwidget ensure");
            ensureGroupStateLoadedLocked(userId);
            ensureGroupStateLoadedLocked(userId);
@@ -2673,6 +2674,8 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                }
                }
            }
            }
        }
        }
        Slog.i(TAG, "Async processing of onUserUnlocked u" + userId + " took "
                + (SystemClock.elapsedRealtime() - time) + " ms");
    }
    }


    // only call from initialization -- it assumes that the data structures are all empty
    // only call from initialization -- it assumes that the data structures are all empty