Snap for 8445529 from 00047b4c64 to tm-qpr1-release
Change-Id: I24ce2a9a4e27158e146e10267b70899eb4a5f87a
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -157,7 +157,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
}
|
||||
}
|
||||
|
||||
setupDefaultShortcutIfNecessary(getPrefContext());
|
||||
final int resId = getPreferenceScreenResId();
|
||||
if (resId <= 0) {
|
||||
final PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(
|
||||
@@ -226,6 +225,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
if (mNeedsQSTooltipReshow) {
|
||||
getView().post(this::showQuickSettingsTooltipIfNeeded);
|
||||
}
|
||||
|
||||
writeDefaultShortcutTargetServiceToSettingsIfNeeded(getPrefContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -792,8 +793,22 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
|
||||
/**
|
||||
* Setups a configurable default if the setting has never been set.
|
||||
*
|
||||
* TODO(b/228562075): Remove this function when correcting the format in config file
|
||||
* `config_defaultAccessibilityService`.
|
||||
*/
|
||||
private static void setupDefaultShortcutIfNecessary(Context context) {
|
||||
private void writeDefaultShortcutTargetServiceToSettingsIfNeeded(Context context) {
|
||||
if (mComponentName == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ComponentName defaultService = ComponentName.unflattenFromString(context.getString(
|
||||
com.android.internal.R.string.config_defaultAccessibilityService));
|
||||
// write default accessibility service only when user enter into corresponding page.
|
||||
if (!mComponentName.equals(defaultService)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String targetKey = Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE;
|
||||
String targetString = Settings.Secure.getString(context.getContentResolver(), targetKey);
|
||||
if (!TextUtils.isEmpty(targetString)) {
|
||||
|
||||
@@ -177,4 +177,11 @@ public class DreamAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the enabled state of all items.
|
||||
*/
|
||||
public boolean getEnabled() {
|
||||
return mEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class DreamPickerController extends BasePreferenceController implements
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (mActiveDream == null) {
|
||||
if (!mAdapter.getEnabled() || mActiveDream == null) {
|
||||
return false;
|
||||
}
|
||||
return mDreamInfo.componentName.equals(mActiveDream.componentName);
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.os.LocaleList;
|
||||
import android.os.UserHandle;
|
||||
import android.text.format.DateFormat;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -32,7 +33,6 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -182,7 +182,7 @@ public final class ConvertUtils {
|
||||
}
|
||||
|
||||
// Collects all keys in these three time slot records as all populations.
|
||||
final Set<String> allBatteryHistEntryKeys = new HashSet<>();
|
||||
final Set<String> allBatteryHistEntryKeys = new ArraySet<>();
|
||||
allBatteryHistEntryKeys.addAll(currentBatteryHistMap.keySet());
|
||||
allBatteryHistEntryKeys.addAll(nextBatteryHistMap.keySet());
|
||||
allBatteryHistEntryKeys.addAll(nextTwoBatteryHistMap.keySet());
|
||||
|
||||
@@ -21,12 +21,12 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Process;
|
||||
import android.util.ArraySet;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.settingslib.fuelgauge.Estimate;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -169,7 +169,7 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
|
||||
|
||||
@Override
|
||||
public Set<CharSequence> getHideBackgroundUsageTimeSet(Context context) {
|
||||
return new HashSet<>();
|
||||
return new ArraySet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user