* commit '592f6343726b61ad199236ccf6077941ad23aa74': lock out clicks while switching.
This commit is contained in:
@@ -207,9 +207,11 @@ class KeyguardMultiUserAvatar extends FrameLayout {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPressed(boolean pressed) {
|
public void setPressed(boolean pressed) {
|
||||||
super.setPressed(pressed);
|
if (!pressed || isClickable()) {
|
||||||
mFramed.setPressed(pressed);
|
super.setPressed(pressed);
|
||||||
mUserImage.invalidate();
|
mFramed.setPressed(pressed);
|
||||||
|
mUserImage.invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserInfo getUserInfo() {
|
public UserInfo getUserInfo() {
|
||||||
|
|||||||
@@ -110,36 +110,50 @@ public class KeyguardMultiUserSelectorView extends FrameLayout implements View.O
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setAllClickable(boolean clickable)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < mUsersGrid.getChildCount(); i++) {
|
||||||
|
View v = mUsersGrid.getChildAt(i);
|
||||||
|
v.setClickable(clickable);
|
||||||
|
v.setPressed(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (!(v instanceof KeyguardMultiUserAvatar)) return;
|
if (!(v instanceof KeyguardMultiUserAvatar)) return;
|
||||||
final KeyguardMultiUserAvatar avatar = (KeyguardMultiUserAvatar) v;
|
final KeyguardMultiUserAvatar avatar = (KeyguardMultiUserAvatar) v;
|
||||||
if (mActiveUserAvatar == avatar) {
|
if (avatar.isClickable()) { // catch race conditions
|
||||||
// If they click the currently active user, show the unlock hint
|
if (mActiveUserAvatar == avatar) {
|
||||||
mCallback.showUnlockHint();
|
// If they click the currently active user, show the unlock hint
|
||||||
return;
|
mCallback.showUnlockHint();
|
||||||
} else {
|
return;
|
||||||
// Reset the previously active user to appear inactive
|
} else {
|
||||||
mCallback.hideSecurityView(FADE_OUT_ANIMATION_DURATION);
|
// Reset the previously active user to appear inactive
|
||||||
mActiveUserAvatar.setActive(false, true, new Runnable() {
|
mCallback.hideSecurityView(FADE_OUT_ANIMATION_DURATION);
|
||||||
@Override
|
setAllClickable(false);
|
||||||
public void run() {
|
mActiveUserAvatar.setActive(false, true, new Runnable() {
|
||||||
mActiveUserAvatar = avatar;
|
@Override
|
||||||
mActiveUserAvatar.setActive(true, true, new Runnable() {
|
public void run() {
|
||||||
@Override
|
mActiveUserAvatar = avatar;
|
||||||
public void run() {
|
mActiveUserAvatar.setActive(true, true, new Runnable() {
|
||||||
if (this.getClass().getName().contains("internal")) {
|
@Override
|
||||||
try {
|
public void run() {
|
||||||
ActivityManagerNative.getDefault()
|
if (this.getClass().getName().contains("internal")) {
|
||||||
.switchUser(avatar.getUserInfo().id);
|
try {
|
||||||
} catch (RemoteException re) {
|
ActivityManagerNative.getDefault()
|
||||||
Log.e(TAG, "Couldn't switch user " + re);
|
.switchUser(avatar.getUserInfo().id);
|
||||||
|
} catch (RemoteException re) {
|
||||||
|
Log.e(TAG, "Couldn't switch user " + re);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setAllClickable(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user