Merge "Increase clip debug string limit" into mnc-dev
diff --git a/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml b/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml
new file mode 100644
index 0000000..070b9a1
--- /dev/null
+++ b/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- Variant of progress_indeterminate_horizontal_material in frameworks/base/core/res, which
+ draws the whole height of the progress bar instead having blank space above and below the
+ bar. -->
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:drawable="@drawable/vector_drawable_progress_indeterminate_horizontal_trimmed" >
+ <target
+ android:name="rect2_grp"
+ android:animation="@*android:anim/progress_indeterminate_horizontal_rect2" />
+ <target
+ android:name="rect1_grp"
+ android:animation="@*android:anim/progress_indeterminate_horizontal_rect1" />
+</animated-vector>
diff --git a/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml b/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml
new file mode 100644
index 0000000..39e3a37
--- /dev/null
+++ b/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- Variant of vector_drawable_progress_indeterminate_horizontal in frameworks/base/core/res, which
+ draws the whole height of the progress bar instead having blank space above and below the
+ bar. -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="10dp"
+ android:width="360dp"
+ android:viewportHeight="10"
+ android:viewportWidth="360" >
+ <group
+ android:name="progress_group"
+ android:translateX="180"
+ android:translateY="5" >
+ <path
+ android:name="background_track"
+ android:pathData="M -180.0,-5.0 l 360.0,0 l 0,10.0 l -360.0,0 Z"
+ android:fillColor="?android:attr/colorControlActivated"
+ android:fillAlpha="?android:attr/disabledAlpha"/>
+ <group
+ android:name="rect2_grp"
+ android:translateX="-197.60001"
+ android:scaleX="0.1" >
+ <path
+ android:name="rect2"
+ android:pathData="M -144.0,-5.0 l 288.0,0 l 0,10.0 l -288.0,0 Z"
+ android:fillColor="?android:attr/colorControlActivated" />
+ </group>
+ <group
+ android:name="rect1_grp"
+ android:translateX="-522.59998"
+ android:scaleX="0.1" >
+ <path
+ android:name="rect1"
+ android:pathData="M -144.0,-5.0 l 288.0,0 l 0,10.0 l -288.0,0 Z"
+ android:fillColor="?android:attr/colorControlActivated" />
+ </group>
+ </group>
+</vector>
diff --git a/res/layout/preference_list_fragment.xml b/res/layout/preference_list_fragment.xml
index 1412381..2e9299c 100644
--- a/res/layout/preference_list_fragment.xml
+++ b/res/layout/preference_list_fragment.xml
@@ -25,7 +25,7 @@
android:background="@android:color/transparent">
<FrameLayout android:id="@+id/pinned_header"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
diff --git a/res/layout/setup_wifi_mac_address.xml b/res/layout/setup_wifi_mac_address.xml
new file mode 100644
index 0000000..8f5703b
--- /dev/null
+++ b/res/layout/setup_wifi_mac_address.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/setup_add_network_item_height"
+ android:gravity="center_vertical"
+ android:orientation="vertical"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="@dimen/setup_list_no_icon_padding"
+ android:text="@string/wifi_advanced_mac_address_title" />
+
+ <TextView
+ android:id="@+id/mac_address"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="@dimen/setup_list_no_icon_padding" />
+
+</LinearLayout>
diff --git a/res/layout/wifi_progress_header.xml b/res/layout/wifi_progress_header.xml
new file mode 100644
index 0000000..05518ae
--- /dev/null
+++ b/res/layout/wifi_progress_header.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+
+<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/TrimmedHorizontalProgressBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:indeterminate="true" />
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
index 974b226..0903167 100644
--- a/res/values-land/styles.xml
+++ b/res/values-land/styles.xml
@@ -18,38 +18,4 @@
<style name="KeyguardAppWidgetItem">
<item name="android:textSize">16sp</item>
</style>
-
- <style name="wifi_item">
- <item name="android:layout_marginTop">8dip</item>
- <item name="android:layout_marginStart">8dip</item>
- <item name="android:layout_marginEnd">8dip</item>
- <item name="android:paddingStart">8dip</item>
- <item name="android:paddingEnd">8dip</item>
- <item name="android:orientation">vertical</item>
- <item name="android:gravity">start</item>
- </style>
-
- <style name="wifi_item_label">
- <item name="android:paddingStart">8dip</item>
- <item name="android:textSize">14sp</item>
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
- <item name="android:textColor">?android:attr/textColorSecondary</item>
- </style>
-
- <style name="wifi_item_content">
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Subhead</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- </style>
-
- <style name="wifi_item_edit_content">
- <item name="android:paddingStart">4dip</item>
- <item name="android:layout_marginStart">4dip</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_section">
- <item name="android:orientation">vertical</item>
- </style>
</resources>
diff --git a/res/values-sw600dp-land/styles.xml b/res/values-sw600dp-land/styles.xml
index 1a4a40e..645d1fe 100644
--- a/res/values-sw600dp-land/styles.xml
+++ b/res/values-sw600dp-land/styles.xml
@@ -18,38 +18,4 @@
<style name="KeyguardAppWidgetItem">
<item name="android:textSize">18sp</item>
</style>
-
- <style name="wifi_item">
- <item name="android:layout_marginTop">8dip</item>
- <item name="android:layout_marginStart">8dip</item>
- <item name="android:layout_marginEnd">8dip</item>
- <item name="android:paddingStart">8dip</item>
- <item name="android:paddingEnd">8dip</item>
- <item name="android:orientation">vertical</item>
- <item name="android:gravity">start</item>
- </style>
-
- <style name="wifi_item_label">
- <item name="android:paddingStart">8dip</item>
- <item name="android:textSize">14sp</item>
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
- <item name="android:textColor">?android:attr/textColorSecondary</item>
- </style>
-
- <style name="wifi_item_content">
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Subhead</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- </style>
-
- <style name="wifi_item_edit_content">
- <item name="android:paddingStart">4dip</item>
- <item name="android:layout_marginStart">4dip</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_section">
- <item name="android:orientation">vertical</item>
- </style>
</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 8cf0e86..d428288 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -20,43 +20,6 @@
<item name="android:windowNoTitle">true</item>
</style>
- <style name="wifi_item">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginTop">8dip</item>
- <item name="android:layout_marginStart">16dip</item>
- <item name="android:layout_marginEnd">16dip</item>
- <item name="android:orientation">vertical</item>
- <item name="android:gravity">center_vertical</item>
- </style>
-
- <style name="wifi_item_label">
- <item name="android:layout_width">0dip</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_weight">3</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_item_content">
- <item name="android:layout_width">0dip</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_weight">7</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_item_edit_content">
- <item name="android:layout_width">0dip</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_weight">7</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_section">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:orientation">vertical</item>
- </style>
-
<style name="setup_wizard_button">
<item name="android:layout_width">wrap_content</item>
<item name="android:minWidth">208dip</item>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 1a4a40e..645d1fe 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -18,38 +18,4 @@
<style name="KeyguardAppWidgetItem">
<item name="android:textSize">18sp</item>
</style>
-
- <style name="wifi_item">
- <item name="android:layout_marginTop">8dip</item>
- <item name="android:layout_marginStart">8dip</item>
- <item name="android:layout_marginEnd">8dip</item>
- <item name="android:paddingStart">8dip</item>
- <item name="android:paddingEnd">8dip</item>
- <item name="android:orientation">vertical</item>
- <item name="android:gravity">start</item>
- </style>
-
- <style name="wifi_item_label">
- <item name="android:paddingStart">8dip</item>
- <item name="android:textSize">14sp</item>
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
- <item name="android:textColor">?android:attr/textColorSecondary</item>
- </style>
-
- <style name="wifi_item_content">
- <item name="android:textAlignment">viewStart</item>
- <item name="android:textAppearance">@android:style/TextAppearance.Material.Subhead</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- </style>
-
- <style name="wifi_item_edit_content">
- <item name="android:paddingStart">4dip</item>
- <item name="android:layout_marginStart">4dip</item>
- <item name="android:textSize">18sp</item>
- </style>
-
- <style name="wifi_section">
- <item name="android:orientation">vertical</item>
- </style>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 94aea96..24d599c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1608,11 +1608,11 @@
<string name="wifi_skipped_message" product="default">WARNING: if you skip Wi\u2011Fi, your phone will only use cellular data for initial downloads and updates. To avoid possible data charges, connect to Wi\u2011Fi.</string>
<!-- Text warning about skipping Wi-Fi without a mobile connect (tablet) [CHAR LIMIT=NONE] -->
- <string name="wifi_and_mobile_skipped_message" product="tablet">If you skip Wi\u2011Fi:\n\nYour tablet won\'t have an Internet connection.\n\nYou won\'t get software updates until you connect to the Internet.\n\nYou can\'t activate device protection features at this time.</string>
+ <string name="wifi_and_mobile_skipped_message" product="tablet">If you skip Wi\u2011Fi:\n\n<li>Your tablet won\'t have an Internet connection.</li>\n\n<li>You won\'t get software updates until you connect to the Internet.</li>\n\n<li>You can\'t activate device protection features at this time.</li></string>
<!-- Text warning about skipping Wi-Fi without a mobile connect (device) [CHAR LIMIT=NONE] -->
- <string name="wifi_and_mobile_skipped_message" product="device">If you skip Wi\u2011Fi:\n\nYour device won\'t have an Internet connection.\n\nYou won\'t get software updates until you connect to the Internet.\n\nYou can\'t activate device protection features at this time.</string>
+ <string name="wifi_and_mobile_skipped_message" product="device">If you skip Wi\u2011Fi:\n\n<li>Your device won\'t have an Internet connection.</li>\n\n<li>You won\'t get software updates until you connect to the Internet.</li>\n\n<li>You can\'t activate device protection features at this time.</li></string>
<!-- Text warning about skipping Wi-Fi without a mobile connect (phone) [CHAR LIMIT=NONE] -->
- <string name="wifi_and_mobile_skipped_message" product="default">If you skip Wi\u2011Fi:\n\nYour phone won\'t have an Internet connection.\n\nYou won\'t get software updates until you connect to the Internet.\n\nYou can\'t activate device protection features at this time.</string>
+ <string name="wifi_and_mobile_skipped_message" product="default">If you skip Wi\u2011Fi:\n\n<li>Your phone won\'t have an Internet connection.</li>\n\n<li>You won\'t get software updates until you connect to the Internet.</li>\n\n<li>You can\'t activate device protection features at this time.</li></string>
<!-- Text alerting that Wi-Fi couldn't connect (tablet) [CHAR LIMIT=NONE] -->
<string name="wifi_connect_failed_message" product="tablet">The tablet was unable to connect to this Wi\u2011Fi network.</string>
<!-- Text alerting that Wi-Fi couldn't connect (device) [CHAR LIMIT=NONE] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index d0d2ead..cca8a70 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -158,6 +158,12 @@
<item name="android:textColor">?android:attr/colorAccent</item>
</style>
+ <style name="TrimmedHorizontalProgressBar" parent="android:Widget.Material.ProgressBar.Horizontal">
+ <item name="android:indeterminateDrawable">@drawable/progress_indeterminate_horizontal_material_trimmed</item>
+ <item name="android:minHeight">3dip</item>
+ <item name="android:maxHeight">3dip</item>
+ </style>
+
<style name="bt_item">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 17ff4b2..095785b 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -112,16 +112,19 @@
return mFloatingActionButton;
}
+ public View setPinnedHeaderView(int layoutResId) {
+ final LayoutInflater inflater = getActivity().getLayoutInflater();
+ final View pinnedHeader =
+ inflater.inflate(layoutResId, mPinnedHeaderFrameLayout, false);
+ setPinnedHeaderView(pinnedHeader);
+ return pinnedHeader;
+ }
+
public void setPinnedHeaderView(View pinnedHeader) {
mPinnedHeaderFrameLayout.addView(pinnedHeader);
mPinnedHeaderFrameLayout.setVisibility(View.VISIBLE);
}
- public void clearPinnedHeaderView() {
- mPinnedHeaderFrameLayout.removeAllViews();
- mPinnedHeaderFrameLayout.setVisibility(View.GONE);
- }
-
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
diff --git a/src/com/android/settings/print/PrintSettingsFragment.java b/src/com/android/settings/print/PrintSettingsFragment.java
index cea65d7..ebd51d5 100644
--- a/src/com/android/settings/print/PrintSettingsFragment.java
+++ b/src/com/android/settings/print/PrintSettingsFragment.java
@@ -192,11 +192,9 @@
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
mProfileSpinnerAdapter = Utils.createUserSpinnerAdapter(um, getActivity());
if (mProfileSpinnerAdapter != null) {
- mSpinner = (Spinner) getActivity().getLayoutInflater().inflate(
- R.layout.spinner_view, null);
+ mSpinner = (Spinner) setPinnedHeaderView(R.layout.spinner_view);
mSpinner.setAdapter(mProfileSpinnerAdapter);
mSpinner.setOnItemSelectedListener(this);
- setPinnedHeaderView(mSpinner);
}
}
diff --git a/src/com/android/settings/users/RestrictedProfileSettings.java b/src/com/android/settings/users/RestrictedProfileSettings.java
index 03a55d4..b0b86e4 100644
--- a/src/com/android/settings/users/RestrictedProfileSettings.java
+++ b/src/com/android/settings/users/RestrictedProfileSettings.java
@@ -22,8 +22,8 @@
import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.view.LayoutInflater;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@@ -58,17 +58,13 @@
@Override
public void onActivityCreated(Bundle savedInstanceState) {
- if (mHeaderView == null) {
- mHeaderView = LayoutInflater.from(getActivity()).inflate(
- R.layout.user_info_header, null);
- setPinnedHeaderView(mHeaderView);
- mHeaderView.setOnClickListener(this);
- mUserIconView = (ImageView) mHeaderView.findViewById(android.R.id.icon);
- mUserNameView = (TextView) mHeaderView.findViewById(android.R.id.title);
- mDeleteButton = (ImageView) mHeaderView.findViewById(R.id.delete);
- mDeleteButton.setOnClickListener(this);
- getListView().setFastScrollEnabled(true);
- }
+ mHeaderView = setPinnedHeaderView(R.layout.user_info_header);
+ mHeaderView.setOnClickListener(this);
+ mUserIconView = (ImageView) mHeaderView.findViewById(android.R.id.icon);
+ mUserNameView = (TextView) mHeaderView.findViewById(android.R.id.title);
+ mDeleteButton = (ImageView) mHeaderView.findViewById(R.id.delete);
+ mDeleteButton.setOnClickListener(this);
+ getListView().setFastScrollEnabled(true);
// This is going to bind the preferences.
super.onActivityCreated(savedInstanceState);
}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index e5adaf0..5cb4869 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -56,6 +56,7 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.TextView.BufferType;
import android.widget.Toast;
@@ -127,6 +128,7 @@
private WriteWifiConfigToNfcDialog mWifiToNfcDialog;
private TextView mEmptyView;
+ private ProgressBar mProgressHeader;
// this boolean extra specifies whether to disable the Next button when not connected. Used by
// account creation outside of setup wizard.
@@ -153,6 +155,15 @@
}
@Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ final Activity activity = getActivity();
+ if (activity != null) {
+ mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
+ }
+ }
+
+ @Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
@@ -711,7 +722,9 @@
}
protected void setProgressBarVisible(boolean visible) {
- // TODO: show a progress bar when scan is in progress.
+ if (mProgressHeader != null) {
+ mProgressHeader.setVisibility(visible ? View.VISIBLE : View.GONE);
+ }
}
@Override
diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
index 0c8ee60..b0570cc 100644
--- a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
+++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
@@ -19,6 +19,7 @@
import android.app.Dialog;
import android.net.wifi.WifiConfiguration;
import android.os.Bundle;
+import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -46,6 +47,7 @@
private SetupWizardListLayout mLayout;
private View mAddOtherNetworkItem;
private TextView mEmptyFooter;
+ private View mMacAddressFooter;
private boolean mListLastEmpty = false;
@Override
@@ -66,6 +68,9 @@
}
});
+ mMacAddressFooter = inflater.inflate(R.layout.setup_wifi_mac_address, list, false);
+ list.addFooterView(mMacAddressFooter, null, false);
+
final NavigationBar navigationBar = mLayout.getNavigationBar();
if (navigationBar != null) {
WifiSetupActivity activity = (WifiSetupActivity) getActivity();
@@ -82,6 +87,8 @@
if (hasNextButton()) {
getNextButton().setVisibility(View.GONE);
}
+
+ updateMacAddress();
}
@Override
@@ -91,6 +98,12 @@
}
@Override
+ public void onWifiStateChanged(int state) {
+ super.onWifiStateChanged(state);
+ updateMacAddress();
+ }
+
+ @Override
public void registerForContextMenu(View view) {
// Suppressed during setup wizard
}
@@ -137,18 +150,31 @@
protected void updateFooter(boolean isEmpty) {
if (isEmpty != mListLastEmpty) {
final ListView list = getListView();
+ list.removeFooterView(mEmptyFooter);
+ list.removeFooterView(mAddOtherNetworkItem);
+ list.removeFooterView(mMacAddressFooter);
if (isEmpty) {
- list.removeFooterView(mAddOtherNetworkItem);
list.addFooterView(mEmptyFooter, null, false);
} else {
- list.removeFooterView(mEmptyFooter);
list.addFooterView(mAddOtherNetworkItem, null, true);
+ list.addFooterView(mMacAddressFooter, null, false);
}
mListLastEmpty = isEmpty;
}
}
@Override
+ public View setPinnedHeaderView(int layoutResId) {
+ // Pinned header is not supported in setup wizard
+ return null;
+ }
+
+ @Override
+ public void setPinnedHeaderView(View pinnedHeader) {
+ // Pinned header is not supported in setup wizard
+ }
+
+ @Override
protected void setProgressBarVisible(boolean visible) {
if (mLayout != null) {
if (visible) {
@@ -158,4 +184,20 @@
}
}
}
+
+ private void updateMacAddress() {
+ if (mMacAddressFooter != null) {
+ String macAddress = null;
+ if (mWifiManager != null) {
+ android.net.wifi.WifiInfo connectionInfo = mWifiManager.getConnectionInfo();
+ if (connectionInfo != null) {
+ macAddress = connectionInfo.getMacAddress();
+ }
+ }
+ final TextView macAddressTextView =
+ (TextView) mMacAddressFooter.findViewById(R.id.mac_address);
+ macAddressTextView.setText(!TextUtils.isEmpty(macAddress) ?
+ macAddress : getString(R.string.status_unavailable));
+ }
+ }
}