Merge "Move config for inflateSignalStrength" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-28 21:54:12 +00:00
committed by Android (Google) Code Review
18 changed files with 52 additions and 60 deletions

View File

@@ -48,4 +48,8 @@
<item>"#8"</item>
<item>"#9"</item>
</string-array>
<!-- Enable 5 bar signal strength icon -->
<bool name="config_inflateSignalStrength">true</bool>
</resources>

View File

@@ -40,4 +40,7 @@
<bool name="config_use_sim_language_file">true</bool>
<!-- Enable 5 bar signal strength icon -->
<bool name="config_inflateSignalStrength">true</bool>
</resources>

View File

@@ -4121,4 +4121,9 @@
even after user setup is complete. The defined component should be used for supervision purposes
only. The component must be part of a system app. -->
<string name="config_defaultSupervisionProfileOwnerComponent" translatable="false"></string>
<!-- Whether to artificially interpret all signal strengths as
one bar higher than they actually are -->
<bool name="config_inflateSignalStrength">false</bool>
</resources>

View File

@@ -3797,4 +3797,5 @@
<java-symbol type="style" name="Animation.DeviceDefault.Activity.Resolver" />
<java-symbol type="string" name="config_defaultSupervisionProfileOwnerComponent" />
<java-symbol type="bool" name="config_inflateSignalStrength" />
</resources>

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 2019 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.
*/
package com.android.settingslib.net;
import android.content.Context;
import android.telephony.SubscriptionManager;
/**
* Utilities for dealing with signal strength.
*/
public class SignalStrengthUtil {
/**
* @return whether we should artificially inflate the signal strength and number of levels by 1
* bar for the subscription with the given id
*/
public static boolean shouldInflateSignalStrength(Context context, int subscriptionId) {
return SubscriptionManager.getResourcesForSubId(context, subscriptionId)
.getBoolean(com.android.internal.R.bool.config_inflateSignalStrength);
}
}

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2019, 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.
*/
-->
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
<!-- Enable 5 bar signal strength icon -->
<bool name="config_inflateSignalStrength">true</bool>
</resources>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2017, 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.
*/
-->
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
<!-- Enable 5 bar signal strength icon -->
<bool name="config_inflateSignalStrength">true</bool>
</resources>

View File

@@ -417,10 +417,6 @@
it has been expanded to reveal its children. -->
<bool name="config_showGroupNotificationBgWhenExpanded">false</bool>
<!-- Whether to artificially interpret all signal strengths as
one bar higher than they actually are -->
<bool name="config_inflateSignalStrength">false</bool>
<!-- Should we vibrate on an icon animation of the shelf. This should only be active if the
vibrator is capable of subtle vibrations -->
<bool name="config_vibrateOnIconAnimation">false</bool>

View File

@@ -38,6 +38,7 @@ import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.cdma.EriInfo;
import com.android.settingslib.Utils;
import com.android.settingslib.graph.SignalDrawable;
import com.android.settingslib.net.SignalStrengthUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
@@ -248,9 +249,8 @@ public class MobileSignalController extends SignalController<
}
private void updateInflateSignalStrength() {
mInflateSignalStrengths = SubscriptionManager.getResourcesForSubId(mContext,
mSubscriptionInfo.getSubscriptionId())
.getBoolean(R.bool.config_inflateSignalStrength);
mInflateSignalStrengths = SignalStrengthUtil.shouldInflateSignalStrength(mContext,
mSubscriptionInfo.getSubscriptionId());
}
private int getNumLevels() {

View File

@@ -1140,7 +1140,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
res.getBoolean(com.android.internal.R.bool.config_alwaysUseCdmaRssi);
config.hspaDataDistinguishable =
res.getBoolean(R.bool.config_hspa_data_distinguishable);
config.inflateSignalStrengths = res.getBoolean(R.bool.config_inflateSignalStrength);
config.inflateSignalStrengths = res.getBoolean(
com.android.internal.R.bool.config_inflateSignalStrength);
CarrierConfigManager configMgr = (CarrierConfigManager)
context.getSystemService(Context.CARRIER_CONFIG_SERVICE);