Files
Lawnchair/src/com/android/launcher3/shortcuts/ShortcutKey.java
T
Sunny Goyal 860538df1d Fixing missing user check when updating shortcuts for an app
Change-Id: I889c555d3402fd71098af29b78eb6d959a071080
2016-07-20 15:04:23 -07:00

25 lines
762 B
Java

package com.android.launcher3.shortcuts;
import android.content.ComponentName;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.util.ComponentKey;
/**
* A key that uniquely identifies a shortcut using its package, id, and user handle.
*/
public class ShortcutKey extends ComponentKey {
final String id;
public ShortcutKey(String packageName, UserHandleCompat user, String id) {
// Use the id as the class name.
super(new ComponentName(packageName, id), user);
this.id = id;
}
public static ShortcutKey fromInfo(ShortcutInfoCompat shortcutInfo) {
return new ShortcutKey(shortcutInfo.getPackage(), shortcutInfo.getUserHandle(),
shortcutInfo.getId());
}
}