summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-02-27 20:14:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-02-27 20:14:47 +0000
commitf000cf2a1b85f978d673c6673f1470b1f22a756d (patch)
tree1ce4aa869347cd914e5398a1dc968750729dd4d3
parent713c00f9e0907d97a75e3854e00fccb30bc668c5 (diff)
parent8047943dfaae973139c0a4baacd58e8a6d9dd333 (diff)
downloadcts-f000cf2a1b85f978d673c6673f1470b1f22a756d.tar.gz
Merge "Snap for 4624340 from f247fa98171dc4078786ba6367d6e08861cf6310 to oreo-cts-release" into oreo-cts-releaseandroid-cts-8.0_r7
-rw-r--r--apps/CtsVerifier/res/layout/ca_boot_notify.xml17
-rw-r--r--apps/CtsVerifier/res/layout/uap_buttons_panel.xml18
-rwxr-xr-xapps/CtsVerifier/res/values/strings.xml5
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java5
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java30
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java5
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java5
-rw-r--r--apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java4
-rw-r--r--hostsidetests/services/activityandwindowmanager/windowmanager/frametestapp/src/android/server/frametestapp/DialogTestActivity.java40
-rw-r--r--hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java2
10 files changed, 49 insertions, 82 deletions
diff --git a/apps/CtsVerifier/res/layout/ca_boot_notify.xml b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
index 262c6ad6a07..52df1f157db 100644
--- a/apps/CtsVerifier/res/layout/ca_boot_notify.xml
+++ b/apps/CtsVerifier/res/layout/ca_boot_notify.xml
@@ -47,6 +47,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caboot_if_not_installed" />
+ <TextView
+ android:id="@+id/need_to_install_cert_instructions"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cacert_install_cert" />
<Button
android:id="@+id/install"
@@ -55,6 +60,18 @@
android:text="@string/caboot_install_cert" />
<TextView
+ android:id="@+id/remove_screen_lock_description"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cacert_remove_screen_lock" />
+
+ <Button
+ android:id="@+id/remove_screen_lock"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/caboot_remove_screen_lock" />
+
+ <TextView
android:id="@+id/reboot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/uap_buttons_panel.xml b/apps/CtsVerifier/res/layout/uap_buttons_panel.xml
index 3da72476569..4fdc75782e1 100644
--- a/apps/CtsVerifier/res/layout/uap_buttons_panel.xml
+++ b/apps/CtsVerifier/res/layout/uap_buttons_panel.xml
@@ -82,24 +82,6 @@
<Space
android:layout_width="match_parent"
android:layout_height="5dp"/>
-
- <TextView
- android:text="@string/uapButtonsBtnDLbl"
- android:id="@+id/uap_buttonsBtnDLabelTx"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
-
- <TextView
- android:text="@string/uapButtonsNotRecognized"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/uap_buttonsBtnDStatusTx"
- android:paddingLeft="16dp"/>
-
- <Space
- android:layout_width="match_parent"
- android:layout_height="5dp"/>
</LinearLayout>
<TextView
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 8e18c9cd939..80dedb94d6f 100755
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -1656,10 +1656,11 @@
<string name="caboot_test">CA Cert Notification on Boot test</string>
<string name="caboot_info">This test is to confirm that when the user has installed a trusted credential, the system notifies the user when it boots.</string>
- <string name="caboot_check_cert_installed">Please check here to see whether a certificate is already installed. (If this button does nothing, pass the test and move on.)</string>
+ <string name="caboot_check_cert_installed">Please check here to see whether a certificate is already installed. If this button does nothing, pass the test and move on.</string>
<string name="caboot_check_creds">Check Credentials</string>
- <string name="caboot_if_not_installed">Only if there is no credential currently installed, install one. (If this button does nothing, pass the test and move on.)</string>
+ <string name="caboot_if_not_installed">Only if there is no credential currently installed, install one.</string>
<string name="caboot_install_cert">Install credential</string>
+ <string name="caboot_remove_screen_lock">Remove screen lock</string>
<string name="caboot_reboot_desc">Please reboot the device and return to this test.</string>
<string name="caboot_after_boot">AFTER REBOOTING: Check that there is a notification that the network may be monitored. Opening that notification should show a dialog box giving more information, with a button to check trusted credentials. This should open up the same view of trusted credentials that you get via the "Check credentials" button.</string>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
index 871c2a070be..83e68e46438 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
@@ -170,8 +170,7 @@ public class USBAudioPeripheralAttributesActivity extends USBAudioPeripheralActi
} else {
mTestStatusTx.setText("No Peripheral or No Matching Profile.");
}
- // Headset not publicly available, violates CTS Verifier additional equipment guidelines.
- // Allow skipping test. See b/67777923 for details.
- getPassButton().setEnabled(true /*outPass && inPass*/);
+
+ getPassButton().setEnabled(outPass && inPass);
}
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
index 50742b35759..98a7d186d30 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
@@ -34,18 +34,15 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
private boolean mHasBtnA;
private boolean mHasBtnB;
private boolean mHasBtnC;
- private boolean mHasBtnD;
// Widgets
private TextView mBtnALabelTxt;
private TextView mBtnBLabelTxt;
private TextView mBtnCLabelTxt;
- private TextView mBtnDLabelTxt;
private TextView mBtnAStatusTxt;
private TextView mBtnBStatusTxt;
private TextView mBtnCStatusTxt;
- private TextView mBtnDStatusTxt;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -57,12 +54,10 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
mBtnALabelTxt = (TextView)findViewById(R.id.uap_buttonsBtnALabelTx);
mBtnBLabelTxt = (TextView)findViewById(R.id.uap_buttonsBtnBLabelTx);
mBtnCLabelTxt = (TextView)findViewById(R.id.uap_buttonsBtnCLabelTx);
- mBtnDLabelTxt = (TextView)findViewById(R.id.uap_buttonsBtnDLabelTx);
mBtnAStatusTxt = (TextView)findViewById(R.id.uap_buttonsBtnAStatusTx);
mBtnBStatusTxt = (TextView)findViewById(R.id.uap_buttonsBtnBStatusTx);
mBtnCStatusTxt = (TextView)findViewById(R.id.uap_buttonsBtnCStatusTx);
- mBtnDStatusTxt = (TextView)findViewById(R.id.uap_buttonsBtnDStatusTx);
setPassFailButtonClickListeners();
setInfoResources(R.string.usbaudio_buttons_test, R.string.usbaudio_buttons_info, -1);
@@ -93,13 +88,6 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
mBtnCLabelTxt.setTextColor(Color.WHITE);
mBtnCStatusTxt.setTextColor(Color.WHITE);
}
- if (!mButtonAttributes.mHasBtnD) {
- mBtnDLabelTxt.setTextColor(Color.GRAY);
- mBtnDStatusTxt.setTextColor(Color.GRAY);
- } else {
- mBtnDLabelTxt.setTextColor(Color.WHITE);
- mBtnDStatusTxt.setTextColor(Color.WHITE);
- }
} else {
mBtnALabelTxt.setTextColor(Color.GRAY);
mBtnAStatusTxt.setTextColor(Color.GRAY);
@@ -107,8 +95,6 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
mBtnBStatusTxt.setTextColor(Color.GRAY);
mBtnCLabelTxt.setTextColor(Color.GRAY);
mBtnCStatusTxt.setTextColor(Color.GRAY);
- mBtnDLabelTxt.setTextColor(Color.GRAY);
- mBtnDStatusTxt.setTextColor(Color.GRAY);
}
}
@@ -118,8 +104,6 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
mHasBtnB ? R.string.uapButtonsRecognized : R.string.uapButtonsNotRecognized));
mBtnCStatusTxt.setText(getString(
mHasBtnC ? R.string.uapButtonsRecognized : R.string.uapButtonsNotRecognized));
- mBtnDStatusTxt.setText(getString(
- mHasBtnD ? R.string.uapButtonsRecognized : R.string.uapButtonsNotRecognized));
}
private void calculateMatch() {
@@ -135,15 +119,10 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
if (match && mButtonAttributes.mHasBtnC != mHasBtnC) {
match = false;
}
- if (match && mButtonAttributes.mHasBtnD != mHasBtnD) {
- match = false;
- }
Log.i(TAG, "match:" + match);
getPassButton().setEnabled(match);
} else {
- // Headset not publicly available, violates CTS Verifier additional equipment
- // guidelines. Allow skipping test. See b/67777923 for details.
- getPassButton().setEnabled(true /*false*/);
+ getPassButton().setEnabled(false);
}
}
@@ -165,11 +144,6 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
case KeyEvent.KEYCODE_VOLUME_DOWN:
mHasBtnC = true;
break;
-
- // Function D control event
- case KeyEvent.KEYCODE_VOICE_ASSIST:
- mHasBtnD = true;
- break;
}
showButtonsState();
@@ -182,7 +156,7 @@ public class USBAudioPeripheralButtonsActivity extends USBAudioPeripheralActivit
// USBAudioPeripheralActivity
//
public void updateConnectStatus() {
- mHasBtnA = mHasBtnB = mHasBtnC = mHasBtnD = false;
+ mHasBtnA = mHasBtnB = mHasBtnC = false;
showButtonsState();
calculateMatch();
}
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
index b4b0999a1fc..5389afbefa4 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
@@ -50,10 +50,9 @@ public class USBAudioPeripheralPlayActivity extends USBAudioPeripheralPlayerActi
//
// USBAudioPeripheralActivity
- // Headset not publicly available, violates CTS Verifier additional equipment guidelines.
- // Allow skipping test. See b/67777923 for details.
+ //
public void updateConnectStatus() {
- getPassButton().setEnabled(true /*mOutputDevInfo != null*/);
+ getPassButton().setEnabled(mOutputDevInfo != null);
}
public class LocalClickListener implements View.OnClickListener {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
index e878c824c67..f05bc9e67f0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
@@ -134,10 +134,9 @@ public class USBAudioPeripheralRecordActivity extends USBAudioPeripheralPlayerAc
//
// USBAudioPeripheralActivity
- // Headset not publicly available, violates CTS Verifier additional equipment guidelines.
- // Allow skipping test. See b/67777923 for details.
+ //
public void updateConnectStatus() {
- getPassButton().setEnabled(true /*mOutputDevInfo != null*/);
+ getPassButton().setEnabled(mOutputDevInfo != null);
}
public class LocalClickListener implements View.OnClickListener {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
index 5537b15d10c..a4f63adb392 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
@@ -1,5 +1,6 @@
package com.android.cts.verifier.security;
+import android.app.admin.DevicePolicyManager;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
@@ -32,6 +33,9 @@ public class CANotifyOnBootActivity extends PassFailButtons.Activity {
Button installButton = (Button) view.findViewById(R.id.install);
checkCredsButton.setOnClickListener(new OpenTrustedCredentials());
installButton.setOnClickListener(new InstallCert());
+ Button removeScreenLockButton = (Button) view.findViewById(R.id.remove_screen_lock);
+ removeScreenLockButton.setOnClickListener(
+ v -> startActivity(new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD)));
setContentView(view);
diff --git a/hostsidetests/services/activityandwindowmanager/windowmanager/frametestapp/src/android/server/frametestapp/DialogTestActivity.java b/hostsidetests/services/activityandwindowmanager/windowmanager/frametestapp/src/android/server/frametestapp/DialogTestActivity.java
index e765a7871a3..593cf34907c 100644
--- a/hostsidetests/services/activityandwindowmanager/windowmanager/frametestapp/src/android/server/frametestapp/DialogTestActivity.java
+++ b/hostsidetests/services/activityandwindowmanager/windowmanager/frametestapp/src/android/server/frametestapp/DialogTestActivity.java
@@ -19,38 +19,26 @@ package android.server.FrameTestApp;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
-import android.graphics.Rect;
import android.os.Bundle;
-import android.view.View;
-import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.Window;
import android.view.Gravity;
-public class DialogTestActivity extends Activity implements View.OnApplyWindowInsetsListener{
+public class DialogTestActivity extends Activity {
AlertDialog mDialog;
- private Rect mOutsets = new Rect();
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
- View content = new View(this);
- content.setOnApplyWindowInsetsListener(this);
- setContentView(content);
}
protected void onStop() {
super.onStop();
mDialog.dismiss();
}
-
- public WindowInsets onApplyWindowInsets(View v, WindowInsets in) {
- if (in.isRound()) {
- mOutsets = new Rect(in.getSystemWindowInsetLeft(), in.getSystemWindowInsetTop(),
- in.getSystemWindowInsetRight(), in.getSystemWindowInsetBottom());
- }
+ protected void onResume() {
+ super.onResume();
setupTest(getIntent());
- return in;
}
private void setupTest(Intent intent) {
@@ -141,23 +129,23 @@ public class DialogTestActivity extends Activity implements View.OnApplyWindowIn
private void testExplicitSize() {
doLayoutParamTest((WindowManager.LayoutParams params) -> {
- params.width = 200 - mOutsets.left - mOutsets.right;
- params.height = 200 - mOutsets.bottom - mOutsets.top;
+ params.width = 200;
+ params.height = 200;
});
}
private void testExplicitSizeTopLeftGravity() {
doLayoutParamTest((WindowManager.LayoutParams params) -> {
- params.width = 200 - mOutsets.left - mOutsets.right;
- params.height = 200 - mOutsets.bottom - mOutsets.top;
+ params.width = 200;
+ params.height = 200;
params.gravity = Gravity.TOP | Gravity.LEFT;
});
}
private void testExplicitSizeBottomRightGravity() {
doLayoutParamTest((WindowManager.LayoutParams params) -> {
- params.width = 200 - mOutsets.left - mOutsets.right;
- params.height = 200 - mOutsets.bottom - mOutsets.top;
+ params.width = 200;
+ params.height = 200;
params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
});
}
@@ -182,6 +170,8 @@ public class DialogTestActivity extends Activity implements View.OnApplyWindowIn
doLayoutParamTest((WindowManager.LayoutParams params) -> {
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.MATCH_PARENT;
+ params.x = 100;
+ params.y = 100;
});
}
@@ -191,6 +181,8 @@ public class DialogTestActivity extends Activity implements View.OnApplyWindowIn
params.height = WindowManager.LayoutParams.MATCH_PARENT;
params.gravity = Gravity.LEFT | Gravity.TOP;
params.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
+ params.x = 100;
+ params.y = 100;
});
}
@@ -204,9 +196,9 @@ public class DialogTestActivity extends Activity implements View.OnApplyWindowIn
doLayoutParamTest((WindowManager.LayoutParams params) -> {
params.gravity = Gravity.LEFT | Gravity.TOP;
params.horizontalMargin = .25f;
- params.verticalMargin = .25f;
- params.width = 200 - mOutsets.left - mOutsets.right;
- params.height = 200 - mOutsets.bottom - mOutsets.top;
+ params.verticalMargin = .35f;
+ params.width = 200;
+ params.height = 200;
params.x = 0;
params.y = 0;
});
diff --git a/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java b/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
index 9125a99b988..c99f00126c7 100644
--- a/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
+++ b/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
@@ -190,7 +190,7 @@ public class DialogFrameTests extends ParentChildTestBase {
public void testMarginsArePercentagesOfContentFrame() throws Exception {
float horizontalMargin = .25f;
- float verticalMargin = .25f;
+ float verticalMargin = .35f;
doParentChildTest("WithMargins",
(WindowState parent, WindowState dialog) -> {
Rectangle frame = parent.getContentFrame();