Loading packages/MtpDocumentsProvider/src/com/android/mtp/DocumentLoader.java +3 −1 Original line number Diff line number Diff line Loading @@ -276,7 +276,7 @@ class DocumentLoader implements AutoCloseable { static final int STATE_ERROR = 2; final MtpDatabase mDatabase; int[] mOperationsSupported; final int[] mOperationsSupported; final Identifier mIdentifier; final int[] mObjectHandles; Date mLastNotified; Loading @@ -285,6 +285,8 @@ class DocumentLoader implements AutoCloseable { LoaderTask(MtpDatabase database, int[] operationsSupported, Identifier identifier, int[] objectHandles) { Preconditions.checkNotNull(operationsSupported); Preconditions.checkNotNull(objectHandles); mDatabase = database; mOperationsSupported = operationsSupported; mIdentifier = identifier; Loading packages/MtpDocumentsProvider/src/com/android/mtp/MtpManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,12 @@ class MtpManager { throws IOException { final MtpDevice device = getDevice(deviceId); synchronized (device) { return device.getObjectHandles(storageId, 0 /* all format */, parentObjectHandle); final int[] handles = device.getObjectHandles(storageId, 0 /* all format */, parentObjectHandle); if (handles == null) { throw new IOException("Failed to fetch object handles."); } return handles; } } Loading packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpDocumentsProviderTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ public class MtpDocumentsProviderTest extends AndroidTestCase { 0, "Device A", "device key", true /* unopened */, true /* opened */, new MtpRoot[] { new MtpRoot( 0 /* deviceId */, Loading @@ -606,7 +606,7 @@ public class MtpDocumentsProviderTest extends AndroidTestCase { 2048 /* total space */, "" /* no volume identifier */) }, null, OPERATIONS_SUPPORTED, null)); final String[] names = strings("Directory A", "Directory B", "Directory C"); Loading packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestMtpManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class TestMtpManager extends MtpManager { mDevices.put( deviceId, new MtpDeviceRecord(device.deviceId, device.name, device.deviceKey, false, device.roots, null, null)); device.roots, device.operationsSupported, device.eventsSupported)); } @Override Loading Loading
packages/MtpDocumentsProvider/src/com/android/mtp/DocumentLoader.java +3 −1 Original line number Diff line number Diff line Loading @@ -276,7 +276,7 @@ class DocumentLoader implements AutoCloseable { static final int STATE_ERROR = 2; final MtpDatabase mDatabase; int[] mOperationsSupported; final int[] mOperationsSupported; final Identifier mIdentifier; final int[] mObjectHandles; Date mLastNotified; Loading @@ -285,6 +285,8 @@ class DocumentLoader implements AutoCloseable { LoaderTask(MtpDatabase database, int[] operationsSupported, Identifier identifier, int[] objectHandles) { Preconditions.checkNotNull(operationsSupported); Preconditions.checkNotNull(objectHandles); mDatabase = database; mOperationsSupported = operationsSupported; mIdentifier = identifier; Loading
packages/MtpDocumentsProvider/src/com/android/mtp/MtpManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -143,7 +143,12 @@ class MtpManager { throws IOException { final MtpDevice device = getDevice(deviceId); synchronized (device) { return device.getObjectHandles(storageId, 0 /* all format */, parentObjectHandle); final int[] handles = device.getObjectHandles(storageId, 0 /* all format */, parentObjectHandle); if (handles == null) { throw new IOException("Failed to fetch object handles."); } return handles; } } Loading
packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpDocumentsProviderTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ public class MtpDocumentsProviderTest extends AndroidTestCase { 0, "Device A", "device key", true /* unopened */, true /* opened */, new MtpRoot[] { new MtpRoot( 0 /* deviceId */, Loading @@ -606,7 +606,7 @@ public class MtpDocumentsProviderTest extends AndroidTestCase { 2048 /* total space */, "" /* no volume identifier */) }, null, OPERATIONS_SUPPORTED, null)); final String[] names = strings("Directory A", "Directory B", "Directory C"); Loading
packages/MtpDocumentsProvider/tests/src/com/android/mtp/TestMtpManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class TestMtpManager extends MtpManager { mDevices.put( deviceId, new MtpDeviceRecord(device.deviceId, device.name, device.deviceKey, false, device.roots, null, null)); device.roots, device.operationsSupported, device.eventsSupported)); } @Override Loading