From d95a687e5a9820f9859997dc733da9a18afb57c2 Mon Sep 17 00:00:00 2001 From: Trevor Johns Date: Thu, 13 Aug 2015 21:10:42 -0700 Subject: [PATCH] Sync sample prebuilts for mnc-dev Synced to //developers/samples/android commit 89d2da0f4b. Change-Id: I904da8210517922531d1ac1ba1e747f1c7bf00b3 --- .../MainActivity.java | 26 +- .../HomeListenerService.java | 1 - .../AdvertiserFragment.java | 16 + .../Constants.java | 16 + .../MainActivity.java | 28 +- .../ScanResultAdapter.java | 16 + .../ScannerFragment.java | 16 + .../Camera2Basic/AndroidManifest.xml | 10 +- .../layout-land/fragment_camera2_basic.xml | 4 +- .../res/layout/fragment_camera2_basic.xml | 6 +- .../Camera2Basic/res/values/colors.xml | 19 ++ .../Camera2BasicFragment.java | 15 +- .../MainActivity.java | 9 +- .../MainActivity.java | 2 +- .../DataLayerListenerService.java | 5 +- .../MainActivity.java | 5 +- .../MainActivity.java | 11 +- .../SoundAlarmListenerService.java | 1 - .../FindPhoneService.java | 25 +- .../FingerprintDialog/AndroidManifest.xml | 6 +- .../res/layout/fingerprint_dialog_backup.xml | 41 ++- .../res/layout/fingerprint_dialog_content.xml | 6 +- .../FingerprintDialog/res/menu/menu_main.xml | 21 ++ .../FingerprintDialog/res/values/strings.xml | 4 + .../FingerprintDialog/res/xml/preferences.xml | 23 ++ ...ngerprintAuthenticationDialogFragment.java | 48 ++- .../FingerprintModule.java | 14 +- .../FingerprintUiHelper.java | 3 +- .../MainActivity.java | 99 +++++-- .../SettingsActivity.java | 47 +++ .../HomeListenerService.java | 1 - .../HdrViewfinder/AndroidManifest.xml | 9 +- .../HdrViewfinder/res/layout/main.xml | 8 +- .../HdrViewfinder/res/values/strings.xml | 8 + .../CameraOps.java | 2 +- .../HdrViewfinderActivity.java | 279 +++++++++++++----- .../MessagingService/AndroidManifest.xml | 8 +- .../res/layout-land/fragment_message_me.xml | 3 +- .../res/layout/fragment_message_me.xml | 1 - .../MessagingService/res/values/strings.xml | 2 - .../Conversations.java | 1 - .../MessageLogger.java | 7 +- .../MessageReadReceiver.java | 5 +- .../MessagingFragment.java | 4 +- .../MessagingService.java | 66 ++--- .../MainActivity.java | 47 +-- .../QuizListenerService.java | 6 +- .../RuntimePermissions/res/values/strings.xml | 4 +- .../MainActivity.java | 33 ++- .../camera/CameraPreviewFragment.java | 9 +- .../MainActivity.java | 53 ++-- .../WatchFace/Wearable/res/values/color.xml | 1 + .../WatchFace/Wearable/res/values/dimens.xml | 4 +- .../AnalogWatchFaceService.java | 17 +- .../DigitalWatchFaceService.java | 111 ++++--- .../SweepWatchFaceService.java | 17 +- .../TiltWatchFaceService.java | 2 +- .../res/layout/fragment_detail.xml | 123 ++++---- .../Application/res/layout/list_row.xml | 7 +- .../res/transition-v21/shared_move.xml | 26 ++ .../{explode.xml => window_enter.xml} | 10 +- .../res/transition-v21/window_return.xml | 38 +++ .../dimens.xml} | 14 +- .../Application/res/values-sw400dp/dimens.xml | 1 + .../Application/res/values-v21/dimens.xml | 22 ++ .../Application/res/values-v21/styles.xml | 6 +- .../Application/res/values/dimens.xml | 1 + .../ui/AttractionListFragment.java | 2 +- .../ui/DetailFragment.java | 27 +- .../ui/ScaleTransition.java | 46 +++ .../Shared/res/values/colors.xml | 1 + .../Wearable/AndroidManifest.xml | 5 +- .../service/ListenerService.java | 5 +- 73 files changed, 1148 insertions(+), 437 deletions(-) create mode 100644 samples/browseable/Camera2Basic/res/values/colors.xml create mode 100644 samples/browseable/FingerprintDialog/res/menu/menu_main.xml create mode 100644 samples/browseable/FingerprintDialog/res/xml/preferences.xml create mode 100644 samples/browseable/FingerprintDialog/src/com.example.android.fingerprintdialog/SettingsActivity.java create mode 100644 samples/browseable/XYZTouristAttractions/Application/res/transition-v21/shared_move.xml rename samples/browseable/XYZTouristAttractions/Application/res/transition-v21/{explode.xml => window_enter.xml} (77%) create mode 100644 samples/browseable/XYZTouristAttractions/Application/res/transition-v21/window_return.xml rename samples/browseable/XYZTouristAttractions/Application/res/{menu/detail.xml => values-sw400dp-v21/dimens.xml} (59%) create mode 100644 samples/browseable/XYZTouristAttractions/Application/res/values-v21/dimens.xml create mode 100644 samples/browseable/XYZTouristAttractions/Application/src/com.example.android.xyztouristattractions/ui/ScaleTransition.java diff --git a/samples/browseable/AgendaData/Application/src/com.example.android.wearable.agendadata/MainActivity.java b/samples/browseable/AgendaData/Application/src/com.example.android.wearable.agendadata/MainActivity.java index 8e4063d8c..34e327b3a 100644 --- a/samples/browseable/AgendaData/Application/src/com.example.android.wearable.agendadata/MainActivity.java +++ b/samples/browseable/AgendaData/Application/src/com.example.android.wearable.agendadata/MainActivity.java @@ -33,7 +33,6 @@ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; import com.google.android.gms.common.api.ResultCallback; -import com.google.android.gms.common.data.FreezableUtils; import com.google.android.gms.wearable.DataApi; import com.google.android.gms.wearable.DataItem; import com.google.android.gms.wearable.DataItemBuffer; @@ -96,28 +95,29 @@ public class MainActivity extends Activity implements NodeApi.NodeListener, Conn .setResultCallback(new ResultCallback() { @Override public void onResult(DataItemBuffer result) { - if (result.getStatus().isSuccess()) { - deleteDataItems(result); - } else { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "onDeleteEventsClicked(): failed to get Data Items"); + try { + if (result.getStatus().isSuccess()) { + deleteDataItems(result); + } else { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG,"onDeleteEventsClicked(): failed to get Data " + + "Items"); + + } } + } finally { + result.release(); } - result.close(); } }); } else { Log.e(TAG, "Failed to delete data items" - + " - Client disconnected from Google Play Services"); + + " - Client disconnected from Google Play Services"); } } - private void deleteDataItems(DataItemBuffer dataItems) { + private void deleteDataItems(final DataItemBuffer dataItemList) { if (mGoogleApiClient.isConnected()) { - // Store the DataItem URIs in a List and close the buffer. Then use these URIs - // to delete the DataItems. - final List dataItemList = FreezableUtils.freezeIterable(dataItems); - dataItems.close(); for (final DataItem dataItem : dataItemList) { final Uri dataItemUri = dataItem.getUri(); // In a real calendar application, this might delete the corresponding calendar diff --git a/samples/browseable/AgendaData/Wearable/src/com.example.android.wearable.agendadata/HomeListenerService.java b/samples/browseable/AgendaData/Wearable/src/com.example.android.wearable.agendadata/HomeListenerService.java index ef47977e3..0cbda71e8 100644 --- a/samples/browseable/AgendaData/Wearable/src/com.example.android.wearable.agendadata/HomeListenerService.java +++ b/samples/browseable/AgendaData/Wearable/src/com.example.android.wearable.agendadata/HomeListenerService.java @@ -75,7 +75,6 @@ public class HomeListenerService extends WearableListenerService { UpdateNotificationForDataItem(event.getDataItem()); } } - dataEvents.close(); } @Override diff --git a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/AdvertiserFragment.java b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/AdvertiserFragment.java index f8daefb04..f3645fc29 100644 --- a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/AdvertiserFragment.java +++ b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/AdvertiserFragment.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2015 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. + */ + package com.example.android.bluetoothadvertisements; import android.bluetooth.BluetoothAdapter; diff --git a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/Constants.java b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/Constants.java index d3941e2ab..793ac9214 100644 --- a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/Constants.java +++ b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/Constants.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2015 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. + */ + package com.example.android.bluetoothadvertisements; import android.os.ParcelUuid; diff --git a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/MainActivity.java b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/MainActivity.java index f0044a3e8..871935d9d 100644 --- a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/MainActivity.java +++ b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/MainActivity.java @@ -1,18 +1,18 @@ /* -* Copyright 2013 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. -*/ + * Copyright (C) 2015 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. + */ package com.example.android.bluetoothadvertisements; diff --git a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScanResultAdapter.java b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScanResultAdapter.java index 0f905ea7a..f3c141d36 100644 --- a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScanResultAdapter.java +++ b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScanResultAdapter.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2015 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. + */ + package com.example.android.bluetoothadvertisements; import android.bluetooth.le.ScanResult; diff --git a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScannerFragment.java b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScannerFragment.java index b9ad4d966..ebb1ad085 100644 --- a/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScannerFragment.java +++ b/samples/browseable/BluetoothAdvertisements/src/com.example.android.bluetoothadvertisements/ScannerFragment.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2015 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. + */ + package com.example.android.bluetoothadvertisements; import android.bluetooth.BluetoothAdapter; diff --git a/samples/browseable/Camera2Basic/AndroidManifest.xml b/samples/browseable/Camera2Basic/AndroidManifest.xml index 87d9af131..5b0b5b041 100644 --- a/samples/browseable/Camera2Basic/AndroidManifest.xml +++ b/samples/browseable/Camera2Basic/AndroidManifest.xml @@ -15,16 +15,14 @@ limitations under the License. --> - - + package="com.example.android.camera2basic"> - + + +