Merge "Add divider line in Preference for scan QR code button and share hotspot button"
diff --git a/src/com/android/settings/wifi/AddWifiNetworkPreference.java b/src/com/android/settings/wifi/AddWifiNetworkPreference.java
index cd2e4a8..e49f2ab 100644
--- a/src/com/android/settings/wifi/AddWifiNetworkPreference.java
+++ b/src/com/android/settings/wifi/AddWifiNetworkPreference.java
@@ -20,7 +20,6 @@
 import android.content.res.Resources;
 import android.graphics.drawable.Drawable;
 import android.util.Log;
-import android.view.View;
 import android.widget.ImageButton;
 
 import androidx.annotation.DrawableRes;
@@ -63,10 +62,6 @@
                 getContext().startActivity(
                     WifiDppUtils.getEnrolleeQrCodeScannerIntent(/* ssid */ null));
             });
-
-            final View divider = (View) holder.findViewById(
-                    com.android.settingslib.R.id.two_target_divider);
-            divider.setVisibility(View.INVISIBLE);
         }
     }
 
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSsidPreference.java b/src/com/android/settings/wifi/tether/WifiTetherSsidPreference.java
index 64014d9..7d4ebec 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSsidPreference.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSsidPreference.java
@@ -39,6 +39,7 @@
 
     private ImageButton mImageButton;
     private Drawable mButtonIcon;
+    private View mDivider;
     private View.OnClickListener mClickListener;
     private boolean mVisible;
 
@@ -68,6 +69,8 @@
     }
 
     private void initialize() {
+        // TODO(b/129019971): use methods of divider line in parent object
+        setLayoutResource(com.android.settingslib.R.layout.preference_two_target);
         setWidgetLayoutResource(R.layout.wifi_button_preference_widget);
     }
 
@@ -82,13 +85,17 @@
                     getContext().getString(R.string.wifi_dpp_share_hotspot));
             setButtonIcon(R.drawable.ic_qrcode_24dp);
             mImageButton.setImageDrawable(mButtonIcon);
+
+            mDivider = holder.findViewById(R.id.two_target_divider);
         }
 
         if (mVisible) {
             mImageButton.setOnClickListener(mClickListener);
             mImageButton.setVisibility(View.VISIBLE);
+            mDivider.setVisibility(View.VISIBLE);
         } else {
             mImageButton.setVisibility(View.GONE);
+            mDivider.setVisibility(View.GONE);
         }
     }