Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger

Bug: 32849428
* goog/cw-f-dev: (122 commits)
  Fixed CTS unit tests
  Fixing layout of several test suites for round screens.
  Fix test case context which is not fully visible on wear.
  Fix build for nyc-dr1-dev
  Check that H.264 is available before checking max frame rate
  DO NOT MERGE: Bump CTS and CTS Verifier to 5.1_r14
  DO NOT MERGE: Bump CTS and CTS Verifier to 6.0_r13
  Run DynamicConfig setup twice
  DO NOT MERGE: Bump CTS and CTS Verifier to 7.0_r4
  Fix UserRestrictionsTest.testUserRestrictions_secondaryProfileOwnerOnly
  Generate and include checksum data with CTS report submissions Test: Used exploratory tests and unit tests in ChecksumReporterTest.java to verify the behavior. * All TestResults are added from an InvocationResult * Able to verify TestResult against previously calculated checksum * CRCs are created for all files in a directory including subdirectories * Checksum integrity is maintained while serializing to/from disk * When possible checksum data is compressed before report submission
  Add retry logic for adoptable storage tests
  Catch case where browser is protected by a permission
  Fix failure due to accessibility node not updated after scrolling.
  Fix DO/PO Wifi CTS
  Test: Fix testFindAll result listener not set issue
  Updating CTS Security patch to 2017-01
  DO NOT MERGE ANYWHERE: bump cts for 201701 security public bulletin
  DO NOT MERGE ANYWHERE: bump cts for 201701 security public bulletin
  CTS Test for security vulnerability fix: Effect command might allow negative indexes
  ...

Change-Id: I07b3bb0249eebcae5760d08c98cdde1ac5b01601
This commit is contained in:
Baligh Uddin
2016-11-22 17:13:49 -08:00

View File

@@ -29,6 +29,7 @@ import android.app.Instrumentation;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.net.NetworkInfo.DetailedState; import android.net.NetworkInfo.DetailedState;
@@ -99,6 +100,8 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
protected WifiManager mWfm; protected WifiManager mWfm;
protected int mUid; protected int mUid;
private String mMeteredWifi; private String mMeteredWifi;
private boolean mHasWatch;
private String mDeviceIdleConstantsSetting;
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
@@ -110,7 +113,13 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
mWfm = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); mWfm = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
mUid = getUid(TEST_APP2_PKG); mUid = getUid(TEST_APP2_PKG);
final int myUid = getUid(mContext.getPackageName()); final int myUid = getUid(mContext.getPackageName());
mHasWatch = mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WATCH);
if (mHasWatch) {
mDeviceIdleConstantsSetting = "device_idle_constants_watch";
} else {
mDeviceIdleConstantsSetting = "device_idle_constants";
}
Log.i(TAG, "Apps status on " + getName() + ":\n" Log.i(TAG, "Apps status on " + getName() + ":\n"
+ "\ttest app: uid=" + myUid + ", state=" + getProcessStateByUid(myUid) + "\n" + "\ttest app: uid=" + myUid + ", state=" + getProcessStateByUid(myUid) + "\n"
+ "\tapp2: uid=" + mUid + ", state=" + getProcessStateByUid(mUid)); + "\tapp2: uid=" + mUid + ", state=" + getProcessStateByUid(mUid));
@@ -726,14 +735,14 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
} }
protected void setPendingIntentWhitelistDuration(int durationMs) throws Exception { protected void setPendingIntentWhitelistDuration(int durationMs) throws Exception {
final String command = String.format( executeSilentShellCommand(String.format(
"settings put global device_idle_constants %s=%d", "settings put global %s %s=%d", mDeviceIdleConstantsSetting,
"notification_whitelist_duration", durationMs); "notification_whitelist_duration", durationMs));
executeSilentShellCommand(command);
} }
protected void resetDeviceIdleSettings() throws Exception { protected void resetDeviceIdleSettings() throws Exception {
executeShellCommand("settings delete global device_idle_constants"); executeShellCommand(String.format("settings delete global %s",
mDeviceIdleConstantsSetting));
} }
protected void startForegroundService() throws Exception { protected void startForegroundService() throws Exception {