am fb68b0ad
: Merge "Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties" into mnc-dev
* commit 'fb68b0ad344edbba15b961dc444cb24dcfc29995': Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties
This commit is contained in:
@ -1106,7 +1106,7 @@ public class AssistStructure implements Parcelable {
|
||||
@Override
|
||||
public void setAssistBlocked(boolean state) {
|
||||
mNode.mFlags = (mNode.mFlags&~ViewNode.FLAGS_ASSIST_BLOCKED)
|
||||
| (state ? 0 : ViewNode.FLAGS_ASSIST_BLOCKED);
|
||||
| (state ? ViewNode.FLAGS_ASSIST_BLOCKED : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1412,6 +1412,9 @@ public class AssistStructure implements Parcelable {
|
||||
if (extras != null) {
|
||||
Log.i(TAG, prefix + " Extras: " + extras);
|
||||
}
|
||||
if (node.isAssistBlocked()) {
|
||||
Log.i(TAG, prefix + " BLOCKED");
|
||||
}
|
||||
final int NCHILDREN = node.getChildCount();
|
||||
if (NCHILDREN > 0) {
|
||||
Log.i(TAG, prefix + " Children:");
|
||||
|
@ -2658,6 +2658,16 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
return disabled;
|
||||
}
|
||||
|
||||
boolean isSecureLocked(WindowState w) {
|
||||
if ((w.mAttrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
|
||||
return true;
|
||||
}
|
||||
if (isScreenCaptureDisabledLocked(UserHandle.getUserId(w.mOwnerUid))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mScreenCaptureDisabled for specific user
|
||||
*/
|
||||
@ -3169,6 +3179,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
boolean wallpaperMayMove = win.mViewVisibility != viewVisibility
|
||||
&& (win.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0;
|
||||
wallpaperMayMove |= (flagChanges & FLAG_SHOW_WALLPAPER) != 0;
|
||||
if ((flagChanges & FLAG_SECURE) != 0 && winAnimator.mSurfaceControl != null) {
|
||||
winAnimator.mSurfaceControl.setSecure(isSecureLocked(win));
|
||||
}
|
||||
|
||||
win.mRelayoutCalled = true;
|
||||
final int oldVisibility = win.mViewVisibility;
|
||||
|
@ -788,11 +788,7 @@ class WindowStateAnimator {
|
||||
int flags = SurfaceControl.HIDDEN;
|
||||
final WindowManager.LayoutParams attrs = w.mAttrs;
|
||||
|
||||
if ((attrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
|
||||
flags |= SurfaceControl.SECURE;
|
||||
}
|
||||
|
||||
if (mService.isScreenCaptureDisabledLocked(UserHandle.getUserId(mWin.mOwnerUid))) {
|
||||
if (mService.isSecureLocked(w)) {
|
||||
flags |= SurfaceControl.SECURE;
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,12 @@
|
||||
android:text="@string/start"
|
||||
/>
|
||||
|
||||
<CheckBox android:id="@+id/secure"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/secure"
|
||||
/>
|
||||
|
||||
<com.android.test.voiceinteraction.AsyncStructure
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -17,6 +17,7 @@
|
||||
<resources>
|
||||
|
||||
<string name="start">Start</string>
|
||||
<string name="secure">Secure</string>
|
||||
<string name="tree">Tree</string>
|
||||
<string name="text">Text</string>
|
||||
<string name="asyncStructure">(Async structure goes here)</string>
|
||||
|
@ -21,6 +21,8 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CheckBox;
|
||||
|
||||
public class VoiceInteractionMain extends Activity {
|
||||
|
||||
@ -30,6 +32,7 @@ public class VoiceInteractionMain extends Activity {
|
||||
|
||||
setContentView(R.layout.main);
|
||||
findViewById(R.id.start).setOnClickListener(mStartListener);
|
||||
findViewById(R.id.secure).setOnClickListener(mSecureListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,4 +55,14 @@ public class VoiceInteractionMain extends Activity {
|
||||
showAssist(null);
|
||||
}
|
||||
};
|
||||
|
||||
View.OnClickListener mSecureListener = new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
if (((CheckBox)v).isChecked()) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user