Loading android/app/res/menu/receivedfilescontextfinished.xmldeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/transfer_menu_open" android:title="@string/transfer_menu_open" /> </menu> android/app/res/values/strings.xml +0 −3 Original line number Diff line number Diff line Loading @@ -203,9 +203,6 @@ <string name="status_protocol_error">Request can\'t be handled correctly.</string> <string name="status_unknown_error">Unknown error.</string> <!-- Bluetooth OPP Live Folder --> <string name="btopp_live_folder">Bluetooth received</string> <!-- Bluetooth OPP Transfer History --> <string name="opp_notification_group">Bluetooth Share</string> <string name="download_success"> <xliff:g id="file_size">%1$s</xliff:g> Received complete.</string> Loading android/app/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java +6 −23 Original line number Diff line number Diff line Loading @@ -74,31 +74,22 @@ public class BluetoothOppTransferHistory extends Activity mListView = (ListView) findViewById(R.id.list); mListView.setEmptyView(findViewById(R.id.empty)); mShowAllIncoming = getIntent().getBooleanExtra(Constants.EXTRA_SHOW_ALL_FILES, false); String direction; int dir = getIntent().getIntExtra(Constants.EXTRA_DIRECTION, 0); if (dir == BluetoothShare.DIRECTION_OUTBOUND) { setTitle(getText(R.string.outbound_history_title)); direction = "(" + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_OUTBOUND + ")"; } else { if (mShowAllIncoming) { setTitle(getText(R.string.btopp_live_folder)); } else { setTitle(getText(R.string.inbound_history_title)); } direction = "(" + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_INBOUND + ")"; } String selection = BluetoothShare.STATUS + " >= '200' AND " + direction; if (!mShowAllIncoming) { selection = selection + " AND (" + BluetoothShare.VISIBILITY + " IS NULL OR " String selection = BluetoothShare.STATUS + " >= '200' AND " + direction + " AND (" + BluetoothShare.VISIBILITY + " IS NULL OR " + BluetoothShare.VISIBILITY + " == '" + BluetoothShare.VISIBILITY_VISIBLE + "')"; } final String sortOrder = BluetoothShare.TIMESTAMP + " DESC"; mTransferCursor = BluetoothMethodProxy.getInstance().contentResolverQuery( Loading Loading @@ -134,7 +125,7 @@ public class BluetoothOppTransferHistory extends Activity @Override public boolean onCreateOptionsMenu(Menu menu) { if (mTransferCursor != null && !mShowAllIncoming) { if (mTransferCursor != null) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.transferhistory, menu); } Loading @@ -143,9 +134,7 @@ public class BluetoothOppTransferHistory extends Activity @Override public boolean onPrepareOptionsMenu(Menu menu) { if (!mShowAllIncoming) { menu.findItem(R.id.transfer_menu_clear_all).setEnabled(isTransferComplete()); } return super.onPrepareOptionsMenu(menu); } Loading Loading @@ -204,13 +193,7 @@ public class BluetoothOppTransferHistory extends Activity fileName = this.getString(R.string.unknown_file); } menu.setHeaderTitle(fileName); MenuInflater inflater = getMenuInflater(); if (mShowAllIncoming) { inflater.inflate(R.menu.receivedfilescontextfinished, menu); } else { inflater.inflate(R.menu.transferhistorycontextfinished, menu); } getMenuInflater().inflate(R.menu.transferhistorycontextfinished, menu); } } Loading android/app/src/com/android/bluetooth/opp/Constants.java +0 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,6 @@ public class Constants { */ static final String EXTRA_DIRECTION = "android.btopp.intent.extra.DIRECTION"; /** the intent extra to show all received files in the transfer history */ static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; /** the intent that gets sent when clicking an incomplete/failed transfer */ static final String ACTION_LIST = "android.btopp.intent.action.LIST"; Loading android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferHistoryTest.java +1 −20 Original line number Diff line number Diff line Loading @@ -137,28 +137,11 @@ public class BluetoothOppTransferHistoryTest { } @Test public void onCreate_withDirectionInbound_withExtraShowAllFileIsTrue_displayLiveFolder() throws Exception { public void onCreate_withDirectionInbound_displayInboundHistory() { Assume.assumeFalse( mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, true); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); onView(withText(mTargetContext.getText(R.string.btopp_live_folder).toString())).check( matches(isDisplayed())); } @Test public void onCreate_withDirectionInbound_withExtraShowAllFileIsFalse_displayInboundHistory() { Assume.assumeFalse( mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, false); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading @@ -177,7 +160,6 @@ public class BluetoothOppTransferHistoryTest { mCursorMockDataList.set(1, new BluetoothOppTestUtils.CursorMockData(BluetoothShare.DIRECTION, 2, BluetoothShare.DIRECTION_OUTBOUND)); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, true); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_OUTBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading @@ -192,7 +174,6 @@ public class BluetoothOppTransferHistoryTest { @Test public void onOptionsItemSelected_clearAllSelected_promptWarning() { BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, false); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading Loading
android/app/res/menu/receivedfilescontextfinished.xmldeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/transfer_menu_open" android:title="@string/transfer_menu_open" /> </menu>
android/app/res/values/strings.xml +0 −3 Original line number Diff line number Diff line Loading @@ -203,9 +203,6 @@ <string name="status_protocol_error">Request can\'t be handled correctly.</string> <string name="status_unknown_error">Unknown error.</string> <!-- Bluetooth OPP Live Folder --> <string name="btopp_live_folder">Bluetooth received</string> <!-- Bluetooth OPP Transfer History --> <string name="opp_notification_group">Bluetooth Share</string> <string name="download_success"> <xliff:g id="file_size">%1$s</xliff:g> Received complete.</string> Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java +6 −23 Original line number Diff line number Diff line Loading @@ -74,31 +74,22 @@ public class BluetoothOppTransferHistory extends Activity mListView = (ListView) findViewById(R.id.list); mListView.setEmptyView(findViewById(R.id.empty)); mShowAllIncoming = getIntent().getBooleanExtra(Constants.EXTRA_SHOW_ALL_FILES, false); String direction; int dir = getIntent().getIntExtra(Constants.EXTRA_DIRECTION, 0); if (dir == BluetoothShare.DIRECTION_OUTBOUND) { setTitle(getText(R.string.outbound_history_title)); direction = "(" + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_OUTBOUND + ")"; } else { if (mShowAllIncoming) { setTitle(getText(R.string.btopp_live_folder)); } else { setTitle(getText(R.string.inbound_history_title)); } direction = "(" + BluetoothShare.DIRECTION + " == " + BluetoothShare.DIRECTION_INBOUND + ")"; } String selection = BluetoothShare.STATUS + " >= '200' AND " + direction; if (!mShowAllIncoming) { selection = selection + " AND (" + BluetoothShare.VISIBILITY + " IS NULL OR " String selection = BluetoothShare.STATUS + " >= '200' AND " + direction + " AND (" + BluetoothShare.VISIBILITY + " IS NULL OR " + BluetoothShare.VISIBILITY + " == '" + BluetoothShare.VISIBILITY_VISIBLE + "')"; } final String sortOrder = BluetoothShare.TIMESTAMP + " DESC"; mTransferCursor = BluetoothMethodProxy.getInstance().contentResolverQuery( Loading Loading @@ -134,7 +125,7 @@ public class BluetoothOppTransferHistory extends Activity @Override public boolean onCreateOptionsMenu(Menu menu) { if (mTransferCursor != null && !mShowAllIncoming) { if (mTransferCursor != null) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.transferhistory, menu); } Loading @@ -143,9 +134,7 @@ public class BluetoothOppTransferHistory extends Activity @Override public boolean onPrepareOptionsMenu(Menu menu) { if (!mShowAllIncoming) { menu.findItem(R.id.transfer_menu_clear_all).setEnabled(isTransferComplete()); } return super.onPrepareOptionsMenu(menu); } Loading Loading @@ -204,13 +193,7 @@ public class BluetoothOppTransferHistory extends Activity fileName = this.getString(R.string.unknown_file); } menu.setHeaderTitle(fileName); MenuInflater inflater = getMenuInflater(); if (mShowAllIncoming) { inflater.inflate(R.menu.receivedfilescontextfinished, menu); } else { inflater.inflate(R.menu.transferhistorycontextfinished, menu); } getMenuInflater().inflate(R.menu.transferhistorycontextfinished, menu); } } Loading
android/app/src/com/android/bluetooth/opp/Constants.java +0 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,6 @@ public class Constants { */ static final String EXTRA_DIRECTION = "android.btopp.intent.extra.DIRECTION"; /** the intent extra to show all received files in the transfer history */ static final String EXTRA_SHOW_ALL_FILES = "android.btopp.intent.extra.SHOW_ALL"; /** the intent that gets sent when clicking an incomplete/failed transfer */ static final String ACTION_LIST = "android.btopp.intent.action.LIST"; Loading
android/app/tests/unit/src/com/android/bluetooth/opp/BluetoothOppTransferHistoryTest.java +1 −20 Original line number Diff line number Diff line Loading @@ -137,28 +137,11 @@ public class BluetoothOppTransferHistoryTest { } @Test public void onCreate_withDirectionInbound_withExtraShowAllFileIsTrue_displayLiveFolder() throws Exception { public void onCreate_withDirectionInbound_displayInboundHistory() { Assume.assumeFalse( mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, true); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); onView(withText(mTargetContext.getText(R.string.btopp_live_folder).toString())).check( matches(isDisplayed())); } @Test public void onCreate_withDirectionInbound_withExtraShowAllFileIsFalse_displayInboundHistory() { Assume.assumeFalse( mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, false); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading @@ -177,7 +160,6 @@ public class BluetoothOppTransferHistoryTest { mCursorMockDataList.set(1, new BluetoothOppTestUtils.CursorMockData(BluetoothShare.DIRECTION, 2, BluetoothShare.DIRECTION_OUTBOUND)); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, true); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_OUTBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading @@ -192,7 +174,6 @@ public class BluetoothOppTransferHistoryTest { @Test public void onOptionsItemSelected_clearAllSelected_promptWarning() { BluetoothOppTestUtils.setUpMockCursor(mCursor, mCursorMockDataList); mIntent.putExtra(Constants.EXTRA_SHOW_ALL_FILES, false); mIntent.putExtra(Constants.EXTRA_DIRECTION, BluetoothShare.DIRECTION_INBOUND); ActivityScenario<BluetoothOppTransferHistory> scenario = ActivityScenario.launch(mIntent); Loading