mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Showing a permission dialog when a restored widget is not yet bound, and launcher
does not has the permission to bind the widget Change-Id: I51d32b9958f82671b928d559105129261fb8f268
This commit is contained in:
@@ -189,9 +189,19 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView implemen
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A pending widget is ready for setup after the provider is installed and
|
||||
* 1) Widget id is not valid: the widget id is not yet bound to the provider, probably
|
||||
* because the launcher doesn't have appropriate permissions.
|
||||
* Note that we would still have an allocated id as that does not
|
||||
* require any permissions and can be done during view inflation.
|
||||
* 2) UI is not ready: the id is valid and the bound. But the widget has a configure activity
|
||||
* which needs to be called once.
|
||||
*/
|
||||
public boolean isReadyForClickSetup() {
|
||||
return (mInfo.restoreStatus & LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY) == 0
|
||||
&& (mInfo.restoreStatus & LauncherAppWidgetInfo.FLAG_UI_NOT_READY) != 0;
|
||||
return !mInfo.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
|
||||
&& (mInfo.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_UI_NOT_READY)
|
||||
|| mInfo.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_ID_NOT_VALID));
|
||||
}
|
||||
|
||||
private void updateDrawableBounds() {
|
||||
|
||||
Reference in New Issue
Block a user