Added TestApi to ActivityInfo.isTranslucentOrFloating

This would be use to determine the right activity state during CTS
test for products that have windowSwipeToDismiss set.

Also, dump ActivityRecord.fullscreen to proto for the same reason.

Bug: 76207986
Bug: 79167358
Test: atest CtsActivityManagerDeviceTestCases:ActivityLifecycleTests
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerAssistantStackTests
Change-Id: Iadc088e9129be088b8a083ebbafd8d20fe26b673
This commit is contained in:
Wale Ogunwale
2018-05-24 18:25:25 -07:00
parent 478923bded
commit 30eab1f430
4 changed files with 5 additions and 0 deletions

View File

@@ -232,6 +232,7 @@ package android.content {
package android.content.pm {
public class ActivityInfo extends android.content.pm.ComponentInfo implements android.os.Parcelable {
method public static boolean isTranslucentOrFloating(android.content.res.TypedArray);
field public static final int RESIZE_MODE_RESIZEABLE = 2; // 0x2
}

View File

@@ -1188,6 +1188,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
* Determines whether the {@link Activity} is considered translucent or floating.
* @hide
*/
@TestApi
public static boolean isTranslucentOrFloating(TypedArray attributes) {
final boolean isTranslucent =
attributes.getBoolean(com.android.internal.R.styleable.Window_windowIsTranslucent,

View File

@@ -117,6 +117,7 @@ message ActivityRecordProto {
optional bool visible = 4;
optional bool front_of_task = 5;
optional int32 proc_id = 6;
optional bool translucent = 7;
}
message KeyguardControllerProto {

View File

@@ -115,6 +115,7 @@ import static com.android.server.am.ActivityRecordProto.FRONT_OF_TASK;
import static com.android.server.am.ActivityRecordProto.IDENTIFIER;
import static com.android.server.am.ActivityRecordProto.PROC_ID;
import static com.android.server.am.ActivityRecordProto.STATE;
import static com.android.server.am.ActivityRecordProto.TRANSLUCENT;
import static com.android.server.am.ActivityRecordProto.VISIBLE;
import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_LEFT;
import static com.android.server.wm.IdentifierProto.HASH_CODE;
@@ -2980,6 +2981,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
if (app != null) {
proto.write(PROC_ID, app.pid);
}
proto.write(TRANSLUCENT, !fullscreen);
proto.end(token);
}
}