Removing unused constructors
Change-Id: I03fb104a46a18fc56cb0ee9a03a018e212f3db00
This commit is contained in:
@@ -17,12 +17,8 @@ package com.android.launcher3.util;
|
||||
*/
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.launcher3.compat.UserManagerCompat;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ComponentKey {
|
||||
@@ -41,29 +37,6 @@ public class ComponentKey {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new component key from an encoded component key string in the form of
|
||||
* [flattenedComponentString#userId]. If the userId is not present, then it defaults
|
||||
* to the current user.
|
||||
*/
|
||||
public ComponentKey(Context context, String componentKeyStr) {
|
||||
int userDelimiterIndex = componentKeyStr.indexOf("#");
|
||||
if (userDelimiterIndex != -1) {
|
||||
String componentStr = componentKeyStr.substring(0, userDelimiterIndex);
|
||||
Long componentUser = Long.valueOf(componentKeyStr.substring(userDelimiterIndex + 1));
|
||||
componentName = ComponentName.unflattenFromString(componentStr);
|
||||
user = UserManagerCompat.getInstance(context)
|
||||
.getUserForSerialNumber(componentUser.longValue());
|
||||
} else {
|
||||
// No user provided, default to the current user
|
||||
componentName = ComponentName.unflattenFromString(componentKeyStr);
|
||||
user = Process.myUserHandle();
|
||||
}
|
||||
Preconditions.assertNotNull(componentName);
|
||||
Preconditions.assertNotNull(user);
|
||||
mHashCode = Arrays.hashCode(new Object[] {componentName, user});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return mHashCode;
|
||||
|
||||
Reference in New Issue
Block a user