use of com.android.launcher3.popup.RemoteActionShortcut in project android_packages_apps_Launcher3 by crdroidandroid.
the class WellbeingModel method getShortcutForApp.
@MainThread
private SystemShortcut getShortcutForApp(String packageName, int userId, BaseDraggingActivity activity, ItemInfo info) {
Preconditions.assertUIThread();
// Work profile apps are not recognized by digital wellbeing.
if (userId != UserHandle.myUserId()) {
if (DEBUG || mIsInTest) {
Log.d(TAG, "getShortcutForApp [" + packageName + "]: not current user");
}
return null;
}
synchronized (mModelLock) {
String actionId = mPackageToActionId.get(packageName);
final RemoteAction action = actionId != null ? mActionIdMap.get(actionId) : null;
if (action == null) {
if (DEBUG || mIsInTest) {
Log.d(TAG, "getShortcutForApp [" + packageName + "]: no action");
}
return null;
}
if (DEBUG || mIsInTest) {
Log.d(TAG, "getShortcutForApp [" + packageName + "]: action: '" + action.getTitle() + "'");
}
return new RemoteActionShortcut(action, activity, info);
}
}
Aggregations