Reloading workspace when the shortcuts permission changes

> Check for permission on every onResume
> If the permission is different than last known permission,
reload and rebind workspace.

Bug: 30789422
Change-Id: Idfa445815e29e2336505779545507d106b33a253
This commit is contained in:
Sunny Goyal
2016-08-10 16:09:29 -07:00
parent ea5bcba847
commit 95f3d6ba2c
3 changed files with 51 additions and 5 deletions
@@ -224,4 +224,16 @@ public class DeepShortcutManager {
return Collections.EMPTY_LIST;
}
}
@TargetApi(25)
public boolean hasHostPermission() {
if (Utilities.isNycMR1OrAbove()) {
try {
return mLauncherApps.hasShortcutHostPermission();
} catch (SecurityException|IllegalStateException e) {
Log.e(TAG, "Failed to make shortcut manager call", e);
}
}
return false;
}
}