Data plan setting in SystemUI quick settings.
Change-Id: I26e0e7cccc85236503cffd60d5323d444ba7613c
Note: These changes are required for Data balance UI.
Bug: 62349208
Test: manual test
(cherry picked from commit 2d20d90cbd968ebdf9631aef67cf04cfb0b24477)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
index b796451..8b62beb 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
@@ -14,18 +14,16 @@
package com.android.systemui.qs.tiles;
-import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.service.quicksettings.Tile;
import android.widget.Switch;
-
-import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.Dependency;
import com.android.systemui.Prefs;
import com.android.systemui.R;
-import com.android.systemui.qs.QSHost;
import com.android.systemui.plugins.qs.QSTile.BooleanState;
+import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.statusbar.phone.SystemUIDialog;
import com.android.systemui.statusbar.policy.DataSaverController;
@@ -57,9 +55,8 @@
@Override
public Intent getLongClickIntent() {
- return CellularTile.CELLULAR_SETTINGS;
+ return CellularTile.getCellularSettingIntent(mContext);
}
-
@Override
protected void handleClick() {
if (mState.value
@@ -73,12 +70,7 @@
dialog.setTitle(com.android.internal.R.string.data_saver_enable_title);
dialog.setMessage(com.android.internal.R.string.data_saver_description);
dialog.setPositiveButton(com.android.internal.R.string.data_saver_enable_button,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- toggleDataSaver();
- }
- });
+ (OnClickListener) (dialogInterface, which) -> toggleDataSaver());
dialog.setNegativeButton(com.android.internal.R.string.cancel, null);
dialog.setShowForAllUsers(true);
dialog.show();
@@ -126,4 +118,4 @@
public void onDataSaverChanged(boolean isDataSaving) {
refreshState(isDataSaving);
}
-}
\ No newline at end of file
+}