Merge "Changed intents for data and saver tiles" into qt-dev
am: 3d6d6f0085
Change-Id: I671d7edc1366c53d4ab002a38c2306dd31cf4260
This commit is contained in:
@@ -1074,6 +1074,22 @@ public final class Settings {
|
||||
public static final String ACTION_ADD_ACCOUNT =
|
||||
"android.settings.ADD_ACCOUNT_SETTINGS";
|
||||
|
||||
/**
|
||||
* Activity Action: Show settings for enabling or disabling data saver
|
||||
* <p></p>
|
||||
* In some cases, a matching Activity may not exist, so ensure you
|
||||
* safeguard against this.
|
||||
* <p>
|
||||
* Input: Nothing.
|
||||
* <p>
|
||||
* Output: Nothing.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_DATA_SAVER_SETTINGS =
|
||||
"android.settings.DATA_SAVER_SETTINGS";
|
||||
|
||||
/**
|
||||
* Activity Action: Show settings for selecting the network operator.
|
||||
* <p>
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.provider.Settings;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -285,7 +286,13 @@ public class CellularTile extends QSTileImpl<SignalState> {
|
||||
}
|
||||
|
||||
static Intent getCellularSettingIntent() {
|
||||
return new Intent(Settings.ACTION_DATA_USAGE_SETTINGS);
|
||||
Intent intent = new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
|
||||
int dataSub = SubscriptionManager.getDefaultDataSubscriptionId();
|
||||
if (dataSub != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
intent.putExtra(Settings.EXTRA_SUB_ID,
|
||||
SubscriptionManager.getDefaultDataSubscriptionId());
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
private final class CellularDetailAdapter implements DetailAdapter {
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.android.systemui.qs.tiles;
|
||||
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.widget.Switch;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class DataSaverTile extends QSTileImpl<BooleanState> implements
|
||||
|
||||
@Override
|
||||
public Intent getLongClickIntent() {
|
||||
return CellularTile.getCellularSettingIntent();
|
||||
return new Intent(Settings.ACTION_DATA_SAVER_SETTINGS);
|
||||
}
|
||||
@Override
|
||||
protected void handleClick() {
|
||||
|
||||
Reference in New Issue
Block a user