summaryrefslogtreecommitdiffstats
path: root/media/tests
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-11-20 12:28:27 -0500
committerMike Lockwood <lockwood@android.com>2010-11-23 10:30:31 -0500
commita31560598af25d5116effc2a6af0d9be12a0628d (patch)
tree2dc63726586ff8ae3351d227f714408a3aaf443f /media/tests
parent57914381a80c9f19cf5227b4af9e822fa0c74ea9 (diff)
downloadframeworks_base-a31560598af25d5116effc2a6af0d9be12a0628d.zip
frameworks_base-a31560598af25d5116effc2a6af0d9be12a0628d.tar.gz
frameworks_base-a31560598af25d5116effc2a6af0d9be12a0628d.tar.bz2
Rename android.provider.Mtp to android.provider.Ptp
We are only supporting the PTP subset of MTP in host mode and have no plans for full MTP, so calling it Mtp was misleading. Also moved ACTION_MTP_SESSION_END Intent name to android.provider.MediaStore and added it to the public API. Change-Id: Ie35d15864d5972e65a39b982aa51316ecca3725a Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/tests')
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java10
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java10
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java38
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java8
4 files changed, 33 insertions, 33 deletions
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java
index c04873a..0942d1f 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java
@@ -24,7 +24,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
-import android.provider.Mtp;
+import android.provider.Ptp;
import android.util.Log;
import android.view.View;
import android.widget.ListAdapter;
@@ -58,7 +58,7 @@ public class CameraBrowser extends ListActivity {
}
private static final String[] DEVICE_COLUMNS =
- new String[] { Mtp.Device._ID, Mtp.Device.MANUFACTURER, Mtp.Device.MODEL };
+ new String[] { Ptp.Device._ID, Ptp.Device.MANUFACTURER, Ptp.Device.MODEL };
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -71,7 +71,7 @@ public class CameraBrowser extends ListActivity {
protected void onResume() {
super.onResume();
- Cursor c = getContentResolver().query(Mtp.Device.CONTENT_URI,
+ Cursor c = getContentResolver().query(Ptp.Device.CONTENT_URI,
DEVICE_COLUMNS, null, null, null);
Log.d(TAG, "query returned " + c);
startManagingCursor(c);
@@ -80,12 +80,12 @@ public class CameraBrowser extends ListActivity {
// Map Cursor columns to views defined in simple_list_item_2.xml
mAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_2, c,
- new String[] { Mtp.Device.MANUFACTURER, Mtp.Device.MODEL },
+ new String[] { Ptp.Device.MANUFACTURER, Ptp.Device.MODEL },
new int[] { android.R.id.text1, android.R.id.text2 });
setListAdapter(mAdapter);
// register for changes to the device list
- mResolver.registerContentObserver(Mtp.Device.CONTENT_URI, true, mDeviceObserver);
+ mResolver.registerContentObserver(Ptp.Device.CONTENT_URI, true, mDeviceObserver);
}
@Override
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
index 2060657..40c5978 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
@@ -25,7 +25,7 @@ import android.graphics.BitmapFactory;
import android.media.MtpConstants;
import android.net.Uri;
import android.os.Bundle;
-import android.provider.Mtp;
+import android.provider.Ptp;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
@@ -49,7 +49,7 @@ public class ObjectBrowser extends ListActivity {
private DeviceDisconnectedReceiver mDisconnectedReceiver;
private static final String[] OBJECT_COLUMNS =
- new String[] { Mtp.Object._ID, Mtp.Object.NAME, Mtp.Object.FORMAT, Mtp.Object.THUMB };
+ new String[] { Ptp.Object._ID, Ptp.Object.NAME, Ptp.Object.FORMAT, Ptp.Object.THUMB };
static final int ID_COLUMN = 0;
static final int NAME_COLUMN = 1;
@@ -74,9 +74,9 @@ public class ObjectBrowser extends ListActivity {
Cursor c;
Uri uri;
if (mObjectID == 0) {
- uri = Mtp.Object.getContentUriForStorageChildren(mDeviceID, mStorageID);
+ uri = Ptp.Object.getContentUriForStorageChildren(mDeviceID, mStorageID);
} else {
- uri = Mtp.Object.getContentUriForObjectChildren(mDeviceID, mObjectID);
+ uri = Ptp.Object.getContentUriForObjectChildren(mDeviceID, mObjectID);
}
Log.d(TAG, "query " + uri);
c = getContentResolver().query(uri, OBJECT_COLUMNS, null, null, null);
@@ -99,7 +99,7 @@ public class ObjectBrowser extends ListActivity {
protected void onListItemClick(ListView l, View v, int position, long id) {
long rowID = mAdapter.getItemId(position);
Cursor c = getContentResolver().query(
- Mtp.Object.getContentUri(mDeviceID, rowID),
+ Ptp.Object.getContentUri(mDeviceID, rowID),
OBJECT_COLUMNS, null, null, null);
Log.d(TAG, "query returned " + c + " count: " + c.getCount());
long format = 0;
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
index 4e63128..3a6c6a4 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
@@ -24,7 +24,7 @@ import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
-import android.provider.Mtp;
+import android.provider.Ptp;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@@ -51,21 +51,21 @@ public class ObjectViewer extends Activity implements View.OnClickListener {
private DeviceDisconnectedReceiver mDisconnectedReceiver;
private static final String[] OBJECT_COLUMNS =
- new String[] { Mtp.Object._ID,
- Mtp.Object.NAME,
- Mtp.Object.SIZE,
- Mtp.Object.THUMB_WIDTH,
- Mtp.Object.THUMB_HEIGHT,
- Mtp.Object.THUMB_SIZE,
- Mtp.Object.IMAGE_WIDTH,
- Mtp.Object.IMAGE_HEIGHT,
- Mtp.Object.IMAGE_DEPTH,
- Mtp.Object.SEQUENCE_NUMBER,
- Mtp.Object.DATE_CREATED,
- Mtp.Object.DATE_MODIFIED,
- Mtp.Object.KEYWORDS,
- Mtp.Object.THUMB,
- Mtp.Object.FORMAT,
+ new String[] { Ptp.Object._ID,
+ Ptp.Object.NAME,
+ Ptp.Object.SIZE,
+ Ptp.Object.THUMB_WIDTH,
+ Ptp.Object.THUMB_HEIGHT,
+ Ptp.Object.THUMB_SIZE,
+ Ptp.Object.IMAGE_WIDTH,
+ Ptp.Object.IMAGE_HEIGHT,
+ Ptp.Object.IMAGE_DEPTH,
+ Ptp.Object.SEQUENCE_NUMBER,
+ Ptp.Object.DATE_CREATED,
+ Ptp.Object.DATE_MODIFIED,
+ Ptp.Object.KEYWORDS,
+ Ptp.Object.THUMB,
+ Ptp.Object.FORMAT,
};
@Override
@@ -91,7 +91,7 @@ public class ObjectViewer extends Activity implements View.OnClickListener {
if (mDeviceID != 0 && mObjectID != 0) {
Cursor c = getContentResolver().query(
- Mtp.Object.getContentUri(mDeviceID, mObjectID),
+ Ptp.Object.getContentUri(mDeviceID, mObjectID),
OBJECT_COLUMNS, null, null, null);
c.moveToFirst();
TextView view = (TextView)findViewById(R.id.name);
@@ -147,7 +147,7 @@ public class ObjectViewer extends Activity implements View.OnClickListener {
dest.mkdirs();
dest = new File(dest, mFileName);
- Uri requestUri = Mtp.Object.getContentUriForImport(mDeviceID, mObjectID,
+ Uri requestUri = Ptp.Object.getContentUriForImport(mDeviceID, mObjectID,
dest.getAbsolutePath());
Uri resultUri = getContentResolver().insert(requestUri, new ContentValues());
Log.d(TAG, "save returned " + resultUri);
@@ -162,7 +162,7 @@ public class ObjectViewer extends Activity implements View.OnClickListener {
}
private void deleteObject() {
- Uri uri = Mtp.Object.getContentUri(mDeviceID, mObjectID);
+ Uri uri = Ptp.Object.getContentUri(mDeviceID, mObjectID);
Log.d(TAG, "deleting " + uri);
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
index 4da88d6..62187b0 100644
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
+++ b/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
@@ -21,7 +21,7 @@ import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
-import android.provider.Mtp;
+import android.provider.Ptp;
import android.util.Log;
import android.view.View;
import android.widget.ListAdapter;
@@ -40,7 +40,7 @@ public class StorageBrowser extends ListActivity {
private DeviceDisconnectedReceiver mDisconnectedReceiver;
private static final String[] STORAGE_COLUMNS =
- new String[] { Mtp.Storage._ID, Mtp.Storage.DESCRIPTION };
+ new String[] { Ptp.Storage._ID, Ptp.Storage.DESCRIPTION };
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -54,7 +54,7 @@ public class StorageBrowser extends ListActivity {
super.onResume();
if (mDeviceID != 0) {
- Cursor c = getContentResolver().query(Mtp.Storage.getContentUri(mDeviceID),
+ Cursor c = getContentResolver().query(Ptp.Storage.getContentUri(mDeviceID),
STORAGE_COLUMNS, null, null, null);
Log.d(TAG, "query returned " + c);
startManagingCursor(c);
@@ -62,7 +62,7 @@ public class StorageBrowser extends ListActivity {
// Map Cursor columns to views defined in simple_list_item_1.xml
mAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, c,
- new String[] { Mtp.Storage.DESCRIPTION },
+ new String[] { Ptp.Storage.DESCRIPTION },
new int[] { android.R.id.text1, android.R.id.text2 });
setListAdapter(mAdapter);
}