Merge changes Ib5ac6ee9,Ib127ad43,I37a423f3 into sc-qpr1-dev am: 1902c78ce2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15542636 Change-Id: Ie4205d1c9d12d1ea6d93d8b05fdcd5aea755efc4
This commit is contained in:
@@ -27,15 +27,16 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
style="@style/Widget.SliceView.Panel"
|
style="@style/Widget.SliceView.Panel"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_height="64dp"
|
android:layout_marginBottom="24dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/internet_dialog_title"
|
android:id="@+id/internet_dialog_title"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="32dp"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:fontFamily="google-sans"
|
android:fontFamily="google-sans"
|
||||||
android:textSize="24sp"/>
|
android:textSize="24sp"/>
|
||||||
@@ -44,7 +45,8 @@
|
|||||||
android:id="@+id/internet_dialog_subtitle"
|
android:id="@+id/internet_dialog_subtitle"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:fontFamily="google-sans"
|
android:fontFamily="google-sans"
|
||||||
@@ -56,6 +58,15 @@
|
|||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?android:attr/listDivider"/>
|
android:background="?android:attr/listDivider"/>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/scroll_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/scroll_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/internet_list"
|
android:id="@+id/internet_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -69,18 +80,18 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:layout_gravity="center_vertical|start"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
||||||
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
android:paddingStart="19dp"
|
||||||
android:paddingEnd="@dimen/settingslib_switchbar_padding_right">
|
android:paddingEnd="@dimen/settingslib_switchbar_padding_right">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="36dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="24dp"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:layout_gravity="center_vertical|start">
|
android:layout_gravity="center_vertical|start">
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -95,12 +106,12 @@
|
|||||||
android:id="@+id/mobile_network_list"
|
android:id="@+id/mobile_network_list"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:layout_marginLeft="3dp"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="start|center_vertical">
|
android:gravity="start|center_vertical">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/mobile_title"
|
android:id="@+id/mobile_title"
|
||||||
|
android:layout_marginLeft="17dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -111,6 +122,7 @@
|
|||||||
android:fontFamily="google-sans"/>
|
android:fontFamily="google-sans"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/mobile_summary"
|
android:id="@+id/mobile_summary"
|
||||||
|
android:layout_marginLeft="17dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -123,7 +135,8 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp">
|
android:layout_height="48dp"
|
||||||
|
android:layout_gravity="end|center_vertical">
|
||||||
<Switch
|
<Switch
|
||||||
android:id="@+id/mobile_toggle"
|
android:id="@+id/mobile_toggle"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@@ -155,6 +168,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
||||||
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
||||||
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
||||||
@@ -203,7 +217,6 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
android:layout_marginRight="@dimen/settingslib_switchbar_margin"
|
||||||
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
android:layout_marginLeft="@dimen/settingslib_switchbar_margin"
|
||||||
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
||||||
@@ -349,3 +362,5 @@
|
|||||||
android:fontFamily="google-sans"/>
|
android:fontFamily="google-sans"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
|||||||
@@ -174,10 +174,7 @@ public class InternetAdapter extends RecyclerView.Adapter<InternetAdapter.Intern
|
|||||||
Html.fromHtml(wifiEntry.getSummary(false), Html.FROM_HTML_MODE_LEGACY));
|
Html.fromHtml(wifiEntry.getSummary(false), Html.FROM_HTML_MODE_LEGACY));
|
||||||
|
|
||||||
mWifiListLayout.setOnClickListener(v -> {
|
mWifiListLayout.setOnClickListener(v -> {
|
||||||
if (!isOpenNetwork(security)) {
|
if (wifiEntry.shouldEditBeforeConnect()) {
|
||||||
// Popup Wi-Fi password dialog condition:
|
|
||||||
// 1. The access point is a non-open network.
|
|
||||||
// 2. The Wi-Fi connection is not connected with this access point.
|
|
||||||
final Intent intent = new Intent(ACTION_WIFI_DIALOG);
|
final Intent intent = new Intent(ACTION_WIFI_DIALOG);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.systemui.qs.tiles.dialog;
|
package com.android.systemui.qs.tiles.dialog;
|
||||||
|
|
||||||
import static android.view.WindowInsets.Type.navigationBars;
|
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
|
||||||
import static android.view.WindowInsets.Type.statusBars;
|
|
||||||
|
|
||||||
import static com.android.systemui.Prefs.Key.QS_HAS_TURNED_OFF_MOBILE_DATA;
|
import static com.android.systemui.Prefs.Key.QS_HAS_TURNED_OFF_MOBILE_DATA;
|
||||||
|
|
||||||
@@ -166,7 +165,6 @@ public class InternetDialog extends SystemUIDialog implements
|
|||||||
if (!aboveStatusBar) {
|
if (!aboveStatusBar) {
|
||||||
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
|
||||||
}
|
}
|
||||||
show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -179,16 +177,19 @@ public class InternetDialog extends SystemUIDialog implements
|
|||||||
mDialogView = LayoutInflater.from(mContext).inflate(R.layout.internet_connectivity_dialog,
|
mDialogView = LayoutInflater.from(mContext).inflate(R.layout.internet_connectivity_dialog,
|
||||||
null);
|
null);
|
||||||
final Window window = getWindow();
|
final Window window = getWindow();
|
||||||
final WindowManager.LayoutParams lp = window.getAttributes();
|
final WindowManager.LayoutParams layoutParams = window.getAttributes();
|
||||||
lp.gravity = Gravity.BOTTOM;
|
layoutParams.gravity = Gravity.BOTTOM;
|
||||||
lp.setFitInsetsTypes(statusBars() | navigationBars());
|
// Move down the dialog to overlay the navigation bar.
|
||||||
lp.setFitInsetsSides(WindowInsets.Side.all());
|
layoutParams.setFitInsetsTypes(
|
||||||
lp.setFitInsetsIgnoringVisibility(true);
|
layoutParams.getFitInsetsTypes() & ~WindowInsets.Type.navigationBars());
|
||||||
window.setAttributes(lp);
|
layoutParams.setFitInsetsSides(WindowInsets.Side.all());
|
||||||
|
layoutParams.setFitInsetsIgnoringVisibility(true);
|
||||||
|
window.setAttributes(layoutParams);
|
||||||
window.setContentView(mDialogView);
|
window.setContentView(mDialogView);
|
||||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
window.setWindowAnimations(R.style.Animation_InternetDialog);
|
window.setWindowAnimations(R.style.Animation_InternetDialog);
|
||||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
window.addFlags(FLAG_LAYOUT_NO_LIMITS);
|
||||||
|
|
||||||
mInternetDialogTitle = mDialogView.requireViewById(R.id.internet_dialog_title);
|
mInternetDialogTitle = mDialogView.requireViewById(R.id.internet_dialog_title);
|
||||||
mInternetDialogSubTitle = mDialogView.requireViewById(R.id.internet_dialog_subtitle);
|
mInternetDialogSubTitle = mDialogView.requireViewById(R.id.internet_dialog_subtitle);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class InternetDialogFactory @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
internetDialog = InternetDialog(context, this, internetDialogController, aboveStatusBar,
|
internetDialog = InternetDialog(context, this, internetDialogController, aboveStatusBar,
|
||||||
uiEventLogger, handler)
|
uiEventLogger, handler)
|
||||||
|
internetDialog?.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class InternetDialogTest extends SysuiTestCase {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mInternetDialog = new MockInternetDialog(mContext, mInternetDialogFactory,
|
mInternetDialog = new MockInternetDialog(mContext, mInternetDialogFactory,
|
||||||
mInternetDialogController, true, mUiEventLogger, mHandler);
|
mInternetDialogController, true, mUiEventLogger, mHandler);
|
||||||
|
mInternetDialog.show();
|
||||||
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
|
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
|
||||||
when(mMockWifiManager.isWifiEnabled()).thenReturn(true);
|
when(mMockWifiManager.isWifiEnabled()).thenReturn(true);
|
||||||
when(mMockWifiManager.getConnectionInfo()).thenReturn(mWifiInfo);
|
when(mMockWifiManager.getConnectionInfo()).thenReturn(mWifiInfo);
|
||||||
@@ -177,8 +178,8 @@ public class InternetDialogTest extends SysuiTestCase {
|
|||||||
private String mConnectedWifiSummary;
|
private String mConnectedWifiSummary;
|
||||||
|
|
||||||
MockInternetDialog(Context context, InternetDialogFactory internetDialogFactory,
|
MockInternetDialog(Context context, InternetDialogFactory internetDialogFactory,
|
||||||
InternetDialogController internetDialogController,
|
InternetDialogController internetDialogController, boolean aboveStatusBar,
|
||||||
boolean aboveStatusBar, UiEventLogger uiEventLogger, @Main Handler handler) {
|
UiEventLogger uiEventLogger, @Main Handler handler) {
|
||||||
super(context, internetDialogFactory, internetDialogController, aboveStatusBar,
|
super(context, internetDialogFactory, internetDialogController, aboveStatusBar,
|
||||||
uiEventLogger, handler);
|
uiEventLogger, handler);
|
||||||
mAdapter = mInternetAdapter;
|
mAdapter = mInternetAdapter;
|
||||||
|
|||||||
Reference in New Issue
Block a user