aboutsummaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorJan-Felix Schmakeit <jfschmakeit@google.com>2017-03-07 06:25:57 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-07 06:25:57 +0000
commit17b9c242ab79d7c96298980a001d020b8ae13067 (patch)
treebce01c2b1cbc3123df7a9166878448b14e736eea /admin
parentb97df9f2d59727ced77732b50578c88284cbd3df (diff)
parentec172cb3888d3bd9094df4a9675a4c3de79486be (diff)
downloadandroid-17b9c242ab79d7c96298980a001d020b8ae13067.tar.gz
Small update to NfcProvisioning sample for API 25. am: 85221b673e am: 678feccda5 am: 1218d7715d
am: ec172cb388 Change-Id: I8d5c45d309df362b25836e4fe3418a173f13fe00
Diffstat (limited to 'admin')
-rw-r--r--admin/NfcProvisioning/Application/src/main/AndroidManifest.xml4
-rw-r--r--admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/ProvisioningValuesLoader.java8
-rw-r--r--admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/TextWatcherWrapper.java2
-rw-r--r--admin/NfcProvisioning/template-params.xml13
4 files changed, 11 insertions, 16 deletions
diff --git a/admin/NfcProvisioning/Application/src/main/AndroidManifest.xml b/admin/NfcProvisioning/Application/src/main/AndroidManifest.xml
index 1db70d74..ddfdec6b 100644
--- a/admin/NfcProvisioning/Application/src/main/AndroidManifest.xml
+++ b/admin/NfcProvisioning/Application/src/main/AndroidManifest.xml
@@ -15,6 +15,7 @@
limitations under the License.
-->
<manifest
+ xmlns:tools="http://schemas.android.com/tools"
package="com.example.android.nfcprovisioning"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
@@ -28,7 +29,8 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
- android:theme="@style/AppTheme">
+ android:theme="@style/AppTheme"
+ tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:name=".MainActivity"
diff --git a/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/ProvisioningValuesLoader.java b/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/ProvisioningValuesLoader.java
index 4e59d09e..f627609f 100644
--- a/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/ProvisioningValuesLoader.java
+++ b/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/ProvisioningValuesLoader.java
@@ -112,9 +112,7 @@ public class ProvisioningValuesLoader extends AsyncTaskLoader<Map<String, String
}
private void loadFromFile(HashMap<String, String> values, File file) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(file));
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line;
while (null != (line = reader.readLine())) {
if (line.startsWith("#")) {
@@ -129,10 +127,6 @@ public class ProvisioningValuesLoader extends AsyncTaskLoader<Map<String, String
values.put(key, value);
Log.d(TAG, key + "=" + value);
}
- } finally {
- if (reader != null) {
- reader.close();
- }
}
}
diff --git a/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/TextWatcherWrapper.java b/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/TextWatcherWrapper.java
index d36936e8..e9fbce7b 100644
--- a/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/TextWatcherWrapper.java
+++ b/admin/NfcProvisioning/Application/src/main/java/com/example/android/nfcprovisioning/TextWatcherWrapper.java
@@ -49,7 +49,7 @@ public class TextWatcherWrapper implements TextWatcher {
}
public interface OnTextChangedListener {
- public void onTextChanged(int id, String s);
+ void onTextChanged(int id, String s);
}
}
diff --git a/admin/NfcProvisioning/template-params.xml b/admin/NfcProvisioning/template-params.xml
index 1152caee..445a523f 100644
--- a/admin/NfcProvisioning/template-params.xml
+++ b/admin/NfcProvisioning/template-params.xml
@@ -20,7 +20,6 @@
<package>com.example.android.nfcprovisioning</package>
<minSdk>21</minSdk>
- <targetSdkVersion>22</targetSdkVersion>
<strings>
<intro>
@@ -68,13 +67,13 @@ unprovisioned peer device and tells it to set up the specified device owner app.
NFC Provisioning app is nothing but an ordinary Android Beam app that just sends out provisioning
values to the peer device. This sample uses the values below.
-* [EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME] - The package name of the mobile device management
+* `EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME` - The package name of the mobile device management
application that will be set as the profile owner or device owner.
-* [EXTRA_PROVISIONING_LOCALE] - The Locale that the device will be set to.
-* [EXTRA_PROVISIONING_TIME_ZONE] - The time zone AlarmManager that the device will be set to.
-* [EXTRA_PROVISIONING_WIFI_SSID] - The ssid of the wifi network that should be used during nfc
+* `EXTRA_PROVISIONING_LOCALE` - The Locale that the device will be set to.
+* `EXTRA_PROVISIONING_TIME_ZONE` - The time zone AlarmManager that the device will be set to.
+* `EXTRA_PROVISIONING_WIFI_SSID` - The ssid of the wifi network that should be used during nfc
device owner provisioning for downloading the mobile device management application.
-* [EXTRA_PROVISIONING_WIFI_PASSWORD] - The password of the wifi network in
+* `EXTRA_PROVISIONING_WIFI_PASSWORD` - The password of the wifi network in
EXTRA_PROVISIONING_WIFI_SSID.
Store values in an instance of Properties. Get a byte array representation of the Properties using
@@ -83,7 +82,7 @@ ByteArrayOutputStream. Create an NdefRecord with the MIME type of
the NdefMessage as the message to be sent.
[1]: https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#MIME_TYPE_PROVISIONING_NFC
-[2]: http://developer.android.com/reference/android/nfc/NfcAdapter.html#setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, android.app.Activity...)
+[2]: http://developer.android.com/reference/android/nfc/NfcAdapter.html#setNdefPushMessage(android.nfc.NdefMessage,%20android.app.Activity,%20android.app.Activity...)
]]>
</intro>
</metadata>