Preventing infinite call of dismissMoreKeysPanel
Bug: 5514583 Change-Id: Idf8dd1ebba0afdb768e538c2626b60770421d4be
This commit is contained in:
parent
720baf0cb3
commit
0cf7a45ac5
2 changed files with 16 additions and 7 deletions
|
@ -27,7 +27,6 @@ import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
|
||||||
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
|
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A view that renders a virtual {@link MiniKeyboard}. It handles rendering of keys and detecting
|
* A view that renders a virtual {@link MiniKeyboard}. It handles rendering of keys and detecting
|
||||||
* key presses and touch movements.
|
* key presses and touch movements.
|
||||||
|
@ -115,7 +114,7 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DrawingProxy getDrawingProxy() {
|
public DrawingProxy getDrawingProxy() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -174,9 +173,15 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean mIsDismissing;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dismissMoreKeysPanel() {
|
public boolean dismissMoreKeysPanel() {
|
||||||
return mController.dismissMoreKeysPanel();
|
if (mIsDismissing) return false;
|
||||||
|
mIsDismissing = true;
|
||||||
|
final boolean dismissed = mController.dismissMoreKeysPanel();
|
||||||
|
mIsDismissing = false;
|
||||||
|
return dismissed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,7 +35,6 @@ import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
|
||||||
import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler;
|
import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler;
|
||||||
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
|
import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
|
* A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
|
||||||
* key presses and touch movements.
|
* key presses and touch movements.
|
||||||
|
@ -125,7 +124,7 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DrawingProxy getDrawingProxy() {
|
public DrawingProxy getDrawingProxy() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -180,10 +179,15 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean mIsDismissing;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dismissMoreKeysPanel() {
|
public boolean dismissMoreKeysPanel() {
|
||||||
if (mController == null) return false;
|
if (mIsDismissing) return false;
|
||||||
return mController.dismissMoreKeysPanel();
|
mIsDismissing = true;
|
||||||
|
final boolean dismissed = mController.dismissMoreKeysPanel();
|
||||||
|
mIsDismissing = false;
|
||||||
|
return dismissed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue