Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into oc-mr1-dev
This commit is contained in:
@@ -103,6 +103,13 @@ public final class InputChannel implements Parcelable {
|
|||||||
return name != null ? name : "uninitialized";
|
return name != null ? name : "uninitialized";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public boolean isValid() {
|
||||||
|
return mPtr != 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposes the input channel.
|
* Disposes the input channel.
|
||||||
* Explicitly releases the reference this object is holding on the input channel.
|
* Explicitly releases the reference this object is holding on the input channel.
|
||||||
|
|||||||
@@ -713,10 +713,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
// manager, to make sure we do the relayout before receiving
|
// manager, to make sure we do the relayout before receiving
|
||||||
// any other events from the system.
|
// any other events from the system.
|
||||||
requestLayout();
|
requestLayout();
|
||||||
if ((mWindowAttributes.inputFeatures
|
mInputChannel = new InputChannel();
|
||||||
& WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) {
|
|
||||||
mInputChannel = new InputChannel();
|
|
||||||
}
|
|
||||||
mForceDecorViewVisibility = (mWindowAttributes.privateFlags
|
mForceDecorViewVisibility = (mWindowAttributes.privateFlags
|
||||||
& PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0;
|
& PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0;
|
||||||
try {
|
try {
|
||||||
@@ -805,7 +802,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mInputQueueCallback =
|
mInputQueueCallback =
|
||||||
((RootViewSurfaceTaker)view).willYouTakeTheInputQueue();
|
((RootViewSurfaceTaker)view).willYouTakeTheInputQueue();
|
||||||
}
|
}
|
||||||
if (mInputChannel != null) {
|
if (mInputChannel.isValid()) {
|
||||||
if (mInputQueueCallback != null) {
|
if (mInputQueueCallback != null) {
|
||||||
mInputQueue = new InputQueue();
|
mInputQueue = new InputQueue();
|
||||||
mInputQueueCallback.onInputQueueCreated(mInputQueue);
|
mInputQueueCallback.onInputQueueCreated(mInputQueue);
|
||||||
|
|||||||
@@ -1413,8 +1413,13 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean openInputChannels = (outInputChannel != null
|
boolean openInputChannels = (outInputChannel != null
|
||||||
&& (attrs.inputFeatures & INPUT_FEATURE_NO_INPUT_CHANNEL) == 0);
|
&& (attrs.inputFeatures & INPUT_FEATURE_NO_INPUT_CHANNEL) == 0);
|
||||||
|
if (callingUid != SYSTEM_UID) {
|
||||||
|
Slog.e(TAG_WM,
|
||||||
|
"App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring");
|
||||||
|
openInputChannels = true;
|
||||||
|
}
|
||||||
if (openInputChannels) {
|
if (openInputChannels) {
|
||||||
win.openInputChannel(outInputChannel);
|
win.openInputChannel(outInputChannel);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user