am fa3d71ad: am 14e1cbb9: CtsVerifier Test Info Dialogs

Merge commit 'fa3d71add5751d877d84bb5d4062b7d4afe4b8bc' into gingerbread-plus-aosp

* commit 'fa3d71add5751d877d84bb5d4062b7d4afe4b8bc':
  CtsVerifier Test Info Dialogs
diff --git a/apps/CtsVerifier/res/layout/pass_fail_buttons.xml b/apps/CtsVerifier/res/layout/pass_fail_buttons.xml
index cbd1fa4..5c64e31 100644
--- a/apps/CtsVerifier/res/layout/pass_fail_buttons.xml
+++ b/apps/CtsVerifier/res/layout/pass_fail_buttons.xml
@@ -26,6 +26,14 @@
             android:onClick="passFailButtonsClickHandler"
             android:text="@string/pass_button_text"/>
             
+    <Button android:id="@+id/info_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:drawableTop="@drawable/fs_indeterminate"
+            android:visibility="gone"
+            android:text="@string/info_button_text"/>
+
     <Button android:id="@+id/fail_button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 5a97b7b..ba82f6e 100644
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -19,6 +19,7 @@
     <string name="continue_button_text">Continue</string>
 
     <string name="pass_button_text">Pass</string>
+    <string name="info_button_text">Info</string>
     <string name="fail_button_text">Fail</string>
 
     <!-- Strings for TestResultsReport -->
@@ -41,6 +42,7 @@
 
     <!-- Strings for FeatureSummaryActivity -->
     <string name="feature_summary">Hardware/Software Feature Summary</string>
+    <string name="feature_summary_info">This is a test for...</string>
     <string name="fs_disallowed">WARNING: device reports a disallowed feature name</string>
     <string name="fs_missing_wifi_telephony">WARNING: device reports neither WiFi nor telephony</string>
     <string name="fs_no_data">No data.</string>
@@ -48,10 +50,13 @@
 
     <!-- Strings for AccelerometerTestActivity and MagnetometerTestActivity -->
     <string name="snsr_accel_test">Accelerometer Test</string>
+    <string name="snsr_accel_test_info">This is a test for...</string>
     <string name="snsr_mag_test">Magnetometer Test</string>
+    <string name="snsr_mag_test_info">This is a test for...</string>
 
     <!-- Strings for SuidFilesActivity -->
-    <string name="suid_files">SUID Files</string>
+    <string name="suid_files">SUID File Scanner</string>
+    <string name="suid_files_info">This test will attempt to find unauthorized SUID binaries, but it is not comprehensive due to permission restrictions.\n\nAuthorized SUID binaries will appear green, while unauthorized SUID binaries will appear red.\n\nPress OK to start the scan...</string>
     <string name="scanning_directory">Scanning directory...</string>
     <string name="file_status">User: %1$s\nGroup: %2$s\nPermissions: %3$s\nPath: %4$s</string>
     <string name="no_file_status">Could not stat file...</string>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
index f2a1c2d..6b55c72 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/PassFailButtons.java
@@ -16,7 +16,14 @@
 
 package com.android.cts.verifier;
 
+import android.app.AlertDialog;
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnCancelListener;
+import android.database.Cursor;
 import android.view.View;
+import android.view.View.OnClickListener;
 
 /**
  * {@link Activity}s to handle clicks to the pass and fail buttons of the pass fail buttons layout.
@@ -27,22 +34,120 @@
  *     </li>
  *     <li>Extend one of the activities to get the click handler for the buttons.</li>
  *     <li>Make sure to call setResult(RESULT_CANCEL) in your Activity initially.</li>
+ *     <li>Optionally call setInfoTextResources to add an info button that will show a
+ *         dialog with instructional text.</li>
  * </ol>
  */
 public class PassFailButtons {
 
-    public static class Activity extends android.app.Activity {
+    // Interface mostly for making documentation and refactoring easier...
+    private interface PassFailActivity {
+
+        /**
+         * Adds an initial informational dialog that appears when entering the test activity for
+         * the first time. Also enables the visibility of an "Info" button between the "Pass" and
+         * "Fail" buttons that can be clicked to show the information dialog again.
+         * <p>
+         * Call from {@link Activity#onCreate} after {@link Activity #setContentView(int)}.
+         *
+         * @param titleId for the text shown in the dialog title area
+         * @param messageId for the text shown in the dialog's body area
+         */
+        void setInfoTextResources(int titleId, int messageId);
+
+        /**
+         * Click handler for the pass and fail buttons. No need to call this ever as the XML
+         * view layout will bind to this automatically.
+         */
+        void passFailButtonsClickHandler(View target);
+    }
+
+    public static class Activity extends android.app.Activity implements PassFailActivity {
+
+        public void setInfoTextResources(int titleId, int messageId) {
+            setInfoText(this, titleId, messageId);
+        }
+
         public void passFailButtonsClickHandler(View target) {
             setTestResultAndFinish(this, target);
         }
     }
 
-    public static class ListActivity extends android.app.ListActivity {
+    public static class ListActivity extends android.app.ListActivity implements PassFailActivity {
+
+        public void setInfoTextResources(int titleId, int messageId) {
+            setInfoText(this, titleId, messageId);
+        }
+
         public void passFailButtonsClickHandler(View target) {
             setTestResultAndFinish(this, target);
         }
     }
 
+    private static void setInfoText(final android.app.Activity activity, final int titleId,
+            final int messageId) {
+        // Show the middle "info" button and make it show the info dialog when clicked.
+        View infoButton = activity.findViewById(R.id.info_button);
+        infoButton.setVisibility(View.VISIBLE);
+        infoButton.setOnClickListener(new OnClickListener() {
+            public void onClick(View view) {
+                showInfoDialog(activity, titleId, messageId);
+            }
+        });
+
+        // Show the info dialog if the user has never seen it before.
+        if (!hasSeenInfoDialog(activity)) {
+            showInfoDialog(activity, titleId, messageId);
+        }
+    }
+
+    private static boolean hasSeenInfoDialog(android.app.Activity activity) {
+        ContentResolver resolver = activity.getContentResolver();
+        Cursor cursor = null;
+        try {
+            cursor = resolver.query(
+                    TestResultsProvider.getTestNameUri(activity.getClass().getName()),
+                    new String[] {TestResultsProvider.COLUMN_TEST_INFO_SEEN}, null, null, null);
+            return cursor.moveToFirst() && cursor.getInt(0) > 0;
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+    }
+
+    private static void showInfoDialog(final android.app.Activity activity, int titleId,
+            int messageId) {
+        new AlertDialog.Builder(activity)
+                .setIcon(android.R.drawable.ic_dialog_info)
+                .setTitle(titleId)
+                .setMessage(messageId)
+                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+                    public void onClick(DialogInterface dialog, int which) {
+                        markSeenInfoDialog(activity);
+                    }
+                })
+                .setOnCancelListener(new OnCancelListener() {
+                    public void onCancel(DialogInterface dialog) {
+                        markSeenInfoDialog(activity);
+                    }
+                })
+                .show();
+    }
+
+    private static void markSeenInfoDialog(android.app.Activity activity) {
+        ContentResolver resolver = activity.getContentResolver();
+        ContentValues values = new ContentValues(2);
+        values.put(TestResultsProvider.COLUMN_TEST_NAME, activity.getClass().getName());
+        values.put(TestResultsProvider.COLUMN_TEST_INFO_SEEN, 1);
+        int numUpdated = resolver.update(
+                TestResultsProvider.getTestNameUri(activity.getClass().getName()),
+                values, null, null);
+        if (numUpdated == 0) {
+            resolver.insert(TestResultsProvider.RESULTS_CONTENT_URI, values);
+        }
+    }
+
     /** Set the test result corresponding to the button clicked and finish the activity. */
     private static void setTestResultAndFinish(android.app.Activity activity, View target) {
         switch (target.getId()) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
index 8bc92f0..8509edb 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestListActivity.java
@@ -46,7 +46,7 @@
 
         TestResultContentObserver observer = new TestResultContentObserver(adapter);
         ContentResolver resolver = getContentResolver();
-        resolver.registerContentObserver(TestResultsProvider.CONTENT_URI, true, observer);
+        resolver.registerContentObserver(TestResultsProvider.RESULTS_CONTENT_URI, true, observer);
     }
 
     /** Launch the activity when its {@link ListView} item is clicked. */
@@ -89,12 +89,12 @@
             values.put(TestResultsProvider.COLUMN_TEST_NAME, testResult.getName());
 
             ContentResolver resolver = getContentResolver();
-            int numUpdated = resolver.update(TestResultsProvider.CONTENT_URI, values,
+            int numUpdated = resolver.update(TestResultsProvider.RESULTS_CONTENT_URI, values,
                     TestResultsProvider.COLUMN_TEST_NAME + " = ?",
                     new String[] {testResult.getName()});
 
             if (numUpdated == 0) {
-                resolver.insert(TestResultsProvider.CONTENT_URI, values);
+                resolver.insert(TestResultsProvider.RESULTS_CONTENT_URI, values);
             }
         }
     }
@@ -124,7 +124,7 @@
 
     private void handleClearItemSelected() {
         ContentResolver resolver = getContentResolver();
-        resolver.delete(TestResultsProvider.CONTENT_URI, "1", null);
+        resolver.delete(TestResultsProvider.RESULTS_CONTENT_URI, "1", null);
         Toast.makeText(this, R.string.test_results_cleared, Toast.LENGTH_SHORT).show();
     }
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
index a7284f0..420408e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
@@ -219,7 +219,7 @@
         ContentResolver resolver = context.getContentResolver();
         Cursor cursor = null;
         try {
-            cursor = resolver.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
+            cursor = resolver.query(TestResultsProvider.RESULTS_CONTENT_URI,
                     TestResultsProvider.ALL_COLUMNS, null, null, null);
             if (cursor.moveToFirst()) {
                 do {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestResultsProvider.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestResultsProvider.java
index 8d07b13..a41cb43 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestResultsProvider.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestResultsProvider.java
@@ -33,7 +33,12 @@
 
     public static final String AUTHORITY = "com.android.cts.verifier.testresultsprovider";
     public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY);
-    public static final Uri RESULTS_ALL_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, RESULTS_PATH);
+    public static final Uri RESULTS_CONTENT_URI =
+            Uri.withAppendedPath(CONTENT_URI, RESULTS_PATH);
+
+    public static Uri getTestNameUri(String testName) {
+        return Uri.withAppendedPath(RESULTS_CONTENT_URI, testName);
+    }
 
     public static final String _ID = "_id";
 
@@ -43,10 +48,14 @@
     /** Integer test result corresponding to constants in {@link TestResult}. */
     public static final String COLUMN_TEST_RESULT = "testresult";
 
+    /** Boolean indicating whether the test info has been seen. */
+    public static final String COLUMN_TEST_INFO_SEEN = "testinfoseen";
+
     public static final String[] ALL_COLUMNS = {
         _ID,
         COLUMN_TEST_NAME,
-        COLUMN_TEST_RESULT
+        COLUMN_TEST_RESULT,
+        COLUMN_TEST_INFO_SEEN,
     };
 
     private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
@@ -73,7 +82,7 @@
 
         private static final String DATABASE_NAME = "results.db";
 
-        private static final int DATABASE_VERSION = 4;
+        private static final int DATABASE_VERSION = 5;
 
         TestResultsOpenHelper(Context context) {
             super(context, DATABASE_NAME, null, DATABASE_VERSION);
@@ -84,7 +93,8 @@
             db.execSQL("CREATE TABLE " + TABLE_NAME + " ("
                     + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                     + COLUMN_TEST_NAME + " TEXT, "
-                    + COLUMN_TEST_RESULT + " INTEGER);");
+                    + COLUMN_TEST_RESULT + " INTEGER,"
+                    + COLUMN_TEST_INFO_SEEN + " INTEGER DEFAULT 0);");
         }
 
         @Override
@@ -107,12 +117,14 @@
 
             case RESULTS_ID:
                 query.appendWhere(_ID);
-                query.appendWhere(uri.getPathSegments().get(0));
+                query.appendWhere("=");
+                query.appendWhere(uri.getPathSegments().get(1));
                 break;
 
             case RESULTS_TEST_NAME:
                 query.appendWhere(COLUMN_TEST_NAME);
-                query.appendWhere(uri.getPathSegments().get(0));
+                query.appendWhere("=");
+                query.appendWhere("\"" + uri.getPathSegments().get(1) + "\"");
                 break;
 
             default:
@@ -128,13 +140,42 @@
         SQLiteDatabase db = mOpenHelper.getWritableDatabase();
         long id = db.insert(TABLE_NAME, null, values);
         getContext().getContentResolver().notifyChange(uri, null);
-        return Uri.withAppendedPath(CONTENT_URI, "" + id);
+        return Uri.withAppendedPath(RESULTS_CONTENT_URI, "" + id);
 
     }
 
     @Override
     public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
         SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+
+        int match = URI_MATCHER.match(uri);
+        switch (match) {
+            case RESULTS_ALL:
+                break;
+
+            case RESULTS_ID:
+                String idSelection = _ID + "=" + uri.getPathSegments().get(1);
+                if (selection != null && selection.length() > 0) {
+                    selection = idSelection + " AND " + selection;
+                } else {
+                    selection = idSelection;
+                }
+                break;
+
+            case RESULTS_TEST_NAME:
+                String testNameSelection = COLUMN_TEST_NAME + "=\""
+                        + uri.getPathSegments().get(1) + "\"";
+                if (selection != null && selection.length() > 0) {
+                    selection = testNameSelection + " AND " + selection;
+                } else {
+                    selection = testNameSelection;
+                }
+                break;
+
+            default:
+                throw new IllegalArgumentException("Unknown URI: " + uri);
+        }
+
         int numUpdated = db.update(TABLE_NAME, values, selection, selectionArgs);
         if (numUpdated > 0) {
             getContext().getContentResolver().notifyChange(uri, null);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index ee7f972..2277876 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -107,6 +107,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.fs_main);
+        setInfoTextResources(R.string.feature_summary, R.string.feature_summary_info);
         setResult(RESULT_CANCELED);
 
         // some values used to detect warn-able conditions involving multiple features
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
index 0498f58..2c07882 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/AccelerometerTestActivity.java
@@ -49,6 +49,7 @@
         mListener = renderer;
 
         setContentView(R.layout.pass_fail_gl);
+        setInfoTextResources(R.string.snsr_accel_test, R.string.snsr_accel_test_info);
         mGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl_surface_view);
         mGLSurfaceView.setRenderer(renderer);
     }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
index ec09394..f5ad701 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/MagnetometerTestActivity.java
@@ -48,6 +48,7 @@
         mListener = renderer;
 
         setContentView(R.layout.pass_fail_gl);
+        setInfoTextResources(R.string.snsr_mag_test, R.string.snsr_mag_test_info);
         mGLSurfaceView = (GLSurfaceView) findViewById(R.id.gl_surface_view);
         mGLSurfaceView.setRenderer(renderer);
     }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/suid/SuidFilesActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/suid/SuidFilesActivity.java
index 4188b58..4a7224b 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/suid/SuidFilesActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/suid/SuidFilesActivity.java
@@ -27,6 +27,7 @@
 import android.app.ProgressDialog;
 import android.content.DialogInterface;
 import android.content.DialogInterface.OnCancelListener;
+import android.content.DialogInterface.OnClickListener;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
@@ -67,6 +68,29 @@
         mAdapter = new SuidFilesAdapter();
         setListAdapter(mAdapter);
 
+        new AlertDialog.Builder(this)
+            .setIcon(android.R.drawable.ic_dialog_info)
+            .setTitle(R.string.suid_files)
+            .setMessage(R.string.suid_files_info)
+            .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+                public void onClick(DialogInterface dialog, int which) {
+                    startScan();
+                }
+            })
+            .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+                public void onClick(DialogInterface dialog, int which) {
+                    finish();
+                }
+            })
+            .setOnCancelListener(new OnCancelListener() {
+                public void onCancel(DialogInterface dialog) {
+                    finish();
+                }
+            })
+            .show();
+    }
+
+    private void startScan() {
         mProgressDialog = new ProgressDialog(this);
         mProgressDialog.setTitle(getString(R.string.scanning_directory));
         mProgressDialog.setOnCancelListener(new OnCancelListener() {
@@ -130,6 +154,9 @@
             TextView view = (TextView) super.getView(position, convertView, parent);
             File file = getItem(position);
             view.setText(file.getName());
+            view.setBackgroundResource(WHITELIST.contains(file.getName())
+                    ? R.drawable.test_pass_gradient
+                    : R.drawable.test_fail_gradient);
             return view;
         }
     }
@@ -195,8 +222,7 @@
             private final FileStatus status = new FileStatus();
 
             public boolean accept(File pathname) {
-                if (!WHITELIST.contains(pathname.getName())
-                        && FileUtils.getFileStatus(pathname.getPath(), status, true)) {
+                if (FileUtils.getFileStatus(pathname.getPath(), status, true)) {
                     return !status.isDirectory()
                             && !status.isSymbolicLink()
                             && status.isSetUid();
@@ -210,24 +236,27 @@
         @Override
         protected void onPostExecute(Set<File> results) {
             super.onPostExecute(results);
-            mProgressDialog.hide();
+            mProgressDialog.dismiss();
 
-            // Task could be cancled and results could be null but don't bother doing anything.
+            // Task could be cancelled and results could be null but don't bother doing anything.
             if (results != null) {
+                boolean passed = true;
                 for (File result : results) {
+                    if (!WHITELIST.contains(result.getName())) {
+                        passed = false;
+                    }
                     mAdapter.add(result);
                 }
 
                 // Alert the user that nothing was found rather than showing an empty list view.
-                if (results.isEmpty()) {
+                if (passed) {
+                    TestResult.setPassedResult(SuidFilesActivity.this);
                     new AlertDialog.Builder(SuidFilesActivity.this)
                             .setTitle(R.string.congratulations)
                             .setMessage(R.string.no_suid_files)
-                            .setOnCancelListener(new OnCancelListener() {
-                                public void onCancel(DialogInterface dialog) {
-                                    // No reason to hang around if there were no offending files.
-                                    TestResult.setPassedResult(SuidFilesActivity.this);
-                                    finish();
+                            .setPositiveButton(android.R.string.ok, new OnClickListener() {
+                                public void onClick(DialogInterface dialog, int which) {
+                                    dialog.dismiss();
                                 }
                             })
                             .show();
diff --git a/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestListActivityTest.java b/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestListActivityTest.java
index 5d0f918..8961c16 100644
--- a/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestListActivityTest.java
+++ b/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestListActivityTest.java
@@ -62,9 +62,9 @@
         runTestOnUiThread(new Runnable() {
             public void run() {
                 ContentResolver resolver = mActivity.getContentResolver();
-                resolver.delete(TestResultsProvider.CONTENT_URI, "1", null);
+                resolver.delete(TestResultsProvider.RESULTS_CONTENT_URI, "1", null);
 
-                Cursor cursor = resolver.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
+                Cursor cursor = resolver.query(TestResultsProvider.RESULTS_CONTENT_URI,
                         TestResultsProvider.ALL_COLUMNS, null, null, null);
                 assertEquals(0, cursor.getCount());
                 cursor.close();
@@ -93,7 +93,7 @@
         mInstrumentation.waitForIdleSync();
 
         ContentResolver resolver = mActivity.getContentResolver();
-        Cursor cursor = resolver.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
+        Cursor cursor = resolver.query(TestResultsProvider.RESULTS_CONTENT_URI,
                 TestResultsProvider.ALL_COLUMNS, null, null, null);
         assertEquals(1, cursor.getCount());
         cursor.close();
diff --git a/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestResultsProviderTest.java b/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestResultsProviderTest.java
index 0b90061..9999125 100644
--- a/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestResultsProviderTest.java
+++ b/apps/CtsVerifier/tests/src/com/android/cts/verifier/TestResultsProviderTest.java
@@ -24,17 +24,17 @@
     }
 
     public void testInsertUpdateDeleteByTestName() {
-        Cursor cursor = mProvider.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
+        Cursor cursor = mProvider.query(TestResultsProvider.RESULTS_CONTENT_URI,
                 TestResultsProvider.ALL_COLUMNS, null, null, null);
         assertEquals(0, cursor.getCount());
 
         ContentValues values = new ContentValues(2);
         values.put(TestResultsProvider.COLUMN_TEST_NAME, FOO_TEST_NAME);
         values.put(TestResultsProvider.COLUMN_TEST_RESULT, TestResult.TEST_RESULT_FAILED);
-        assertNotNull(mProvider.insert(TestResultsProvider.CONTENT_URI, values));
+        assertNotNull(mProvider.insert(TestResultsProvider.RESULTS_CONTENT_URI, values));
 
-        cursor = mProvider.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
-                TestResultsProvider.ALL_COLUMNS, null, null, null);
+        cursor = mProvider.query(TestResultsProvider.RESULTS_CONTENT_URI, TestResultsProvider.ALL_COLUMNS,
+                null, null, null);
         assertEquals(1, cursor.getCount());
         assertTrue(cursor.moveToFirst());
         assertEquals(FOO_TEST_NAME, cursor.getString(1));
@@ -44,12 +44,12 @@
         values = new ContentValues();
         values.put(TestResultsProvider.COLUMN_TEST_NAME, BAR_TEST_NAME);
         values.put(TestResultsProvider.COLUMN_TEST_RESULT, TestResult.TEST_RESULT_PASSED);
-        int numUpdated = mProvider.update(TestResultsProvider.CONTENT_URI, values,
+        int numUpdated = mProvider.update(TestResultsProvider.RESULTS_CONTENT_URI, values,
                 TestResultsProvider.COLUMN_TEST_NAME + " = ?", new String[] {BAR_TEST_NAME});
         assertEquals(0, numUpdated);
 
-        cursor = mProvider.query(Uri.withAppendedPath(TestResultsProvider.CONTENT_URI, "results"),
-                TestResultsProvider.ALL_COLUMNS, null, null, null);
+        cursor = mProvider.query(TestResultsProvider.RESULTS_CONTENT_URI, TestResultsProvider.ALL_COLUMNS,
+                null, null, null);
         assertEquals(1, cursor.getCount());
         assertTrue(cursor.moveToFirst());
         assertEquals(FOO_TEST_NAME, cursor.getString(1));
@@ -58,23 +58,23 @@
 
         values = new ContentValues(1);
         values.put(TestResultsProvider.COLUMN_TEST_RESULT, TestResult.TEST_RESULT_PASSED);
-        numUpdated = mProvider.update(TestResultsProvider.CONTENT_URI, values,
+        numUpdated = mProvider.update(TestResultsProvider.RESULTS_CONTENT_URI, values,
                 TestResultsProvider.COLUMN_TEST_NAME + " = ?", new String[] {FOO_TEST_NAME});
         assertEquals(1, numUpdated);
 
-        cursor = mProvider.query(Uri.withAppendedPath(TestResultsProvider.CONTENT_URI, "results"),
-                TestResultsProvider.ALL_COLUMNS, null, null, null);
+        cursor = mProvider.query(TestResultsProvider.RESULTS_CONTENT_URI, TestResultsProvider.ALL_COLUMNS,
+                null, null, null);
         assertEquals(1, cursor.getCount());
         assertTrue(cursor.moveToFirst());
         assertEquals(FOO_TEST_NAME, cursor.getString(1));
         assertEquals(TestResult.TEST_RESULT_PASSED, cursor.getInt(2));
         cursor.close();
 
-        int numDeleted = mProvider.delete(TestResultsProvider.CONTENT_URI, "1", null);
+        int numDeleted = mProvider.delete(TestResultsProvider.RESULTS_CONTENT_URI, "1", null);
         assertEquals(1, numDeleted);
 
-        cursor = mProvider.query(TestResultsProvider.RESULTS_ALL_CONTENT_URI,
-                TestResultsProvider.ALL_COLUMNS, null, null, null);
+        cursor = mProvider.query(TestResultsProvider.RESULTS_CONTENT_URI, TestResultsProvider.ALL_COLUMNS,
+                null, null, null);
         assertEquals(0, cursor.getCount());
         cursor.close();
     }