AppWidgetServiceImpl: add mWidgetPackages lock

JobScheduler calls isBoundWidgetPackage(), but this can be extremely
slow while AppWidgetService is doing any meaningful work, causing
problems for the rest of the system. Remove that serialization by
moving mWidgetPackages behind its own lock.

Test: atest CtsAppWidgetTestCases
Bug: 161866124

Change-Id: Idae7d16d375dfd41f802ad193fa1ec939093c67a
1 file changed