Automated code cleanup + copyright update

Change-Id: I6deb788643d639f11ce9a5dc09eda701a2664c4a
This commit is contained in:
Oliver Scott
2024-01-06 22:15:26 -05:00
committed by Michael Bestas
parent bd92956625
commit 51fde0aa49
31 changed files with 57 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
//
// Copyright (C) 2021 The LineageOS Project
// Copyright (C) 2021-2023 The LineageOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
Copyright (C) 2017-2022 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2021 The LineageOS Project
Copyright (c) 2021-2022 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2021 The LineageOS Project
Copyright (c) 2021-2022 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2017, 2022 The LineageOS Project
Copyright (c) 2017-2022 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
Copyright (C) 2017-2021 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
Copyright (C) 2021-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
2017-2022 The LineageOS Project
2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod Project
2017-2022 The LineageOS Project
2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod Project
Copyright (C) 2017-2021 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
Copyright (C) 2017-2021 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod Project
2017-2022 The LineageOS Project
2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The CyanogenMod Project
2017-2022 The LineageOS Project
2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 The CyanogenMod Project
Copyright (C) 2017-2022 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -2,7 +2,7 @@
<!--
Copyright (C) 2016 The CyanogenMod Project
Copyright (C) 2017-2022 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -2,7 +2,7 @@
<!--
Copyright (c) 2014 Google Inc.
Copyright (C) 2017,2019-2020 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -2,7 +2,7 @@
<!--
Copyright (c) 2014 Google Inc.
Copyright (C) 2017,2019-2020 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The LineageOS Project
Copyright (C) 2022-2024 The LineageOS Project
SPDX-License-Identifier: Apache-2.0
-->
<resources>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 The LineageOS Project
Copyright (C) 2021-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2015 The CyanogenMod Project
Copyright (C) 2017-2020, 2022 The LineageOS Project
Copyright (C) 2017-2024 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
Copyright (C) 2017-2021 The LineageOS Project
Copyright (C) 2017-2022 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* 2017-2018,2020,2022 The LineageOS Project
* 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,15 +80,15 @@ public class DateTimeActivity extends BaseSetupWizardActivity implements
setNextText(R.string.next);
getGlifLayout().setDescriptionText(getString(R.string.date_time_summary));
final Spinner spinner = (Spinner) findViewById(R.id.timezone_list);
final Spinner spinner = findViewById(R.id.timezone_list);
final SimpleAdapter adapter = constructTimezoneAdapter(this);
mCurrentTimeZone = TimeZone.getDefault();
View dateView = findViewById(R.id.date_item);
dateView.setOnClickListener((view) -> showDatePicker());
View timeView = findViewById(R.id.time_item);
timeView.setOnClickListener((view) -> showTimePicker());
mDateTextView = (TextView) findViewById(R.id.date_text);
mTimeTextView = (TextView) findViewById(R.id.time_text);
mDateTextView = findViewById(R.id.date_text);
mTimeTextView = findViewById(R.id.time_text);
// Pre-select current/default timezone
mHandler.post(() -> {
int tzIndex = getTimeZoneIndex(adapter, mCurrentTimeZone);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017-2020, 2022 The LineageOS Project
* Copyright (C) 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,7 +180,7 @@ public class FinishActivity extends BaseSetupWizardActivity {
WallpaperManager.getInstance(mSetupWizardApp);
wallpaperManager.forgetLoadedWallpaper();
finishAllAppTasks();
SetupWizardUtils.enableStatusBar(this);
SetupWizardUtils.enableStatusBar();
Intent intent = WizardManagerHelper.getNextIntent(getIntent(),
Activity.RESULT_OK);
startActivityForResult(intent, NEXT_REQUEST);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* 2017-2020,2022 The LineageOS Project
* 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -79,13 +79,13 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary);
metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
0, metricsHelpImproveLineage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView metrics = (TextView) findViewById(R.id.enable_metrics_summary);
TextView metrics = findViewById(R.id.enable_metrics_summary);
metrics.setText(metricsSpan);
mMetrics = (CheckBox) findViewById(R.id.enable_metrics_checkbox);
mMetrics = findViewById(R.id.enable_metrics_checkbox);
View navKeysRow = findViewById(R.id.nav_keys);
navKeysRow.setOnClickListener(mNavKeysClickListener);
mNavKeys = (CheckBox) findViewById(R.id.nav_keys_checkbox);
mNavKeys = findViewById(R.id.nav_keys_checkbox);
mSupportsKeyDisabler = isKeyDisablerSupported(this);
if (mSupportsKeyDisabler) {
mNavKeys.setChecked(LineageSettings.System.getIntForUser(getContentResolver(),

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* 2017-2022 The LineageOS Project
* 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@ public class LocaleActivity extends BaseSetupWizardActivity {
super.onCreate(savedInstanceState);
SystemBarHelper.setBackButtonVisible(getWindow(), true);
setNextText(R.string.next);
mLanguagePicker = (LocalePicker) findViewById(R.id.locale_list);
mLanguagePicker = findViewById(R.id.locale_list);
mLanguagePicker.setNextRight(getNextButton().getId());
mLanguagePicker.requestFocus();
if (getResources().getBoolean(R.bool.config_isLargeNoTouch)) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017-2021 The LineageOS Project
* Copyright (C) 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@ public class LocationSettingsActivity extends BaseSetupWizardActivity {
super.onCreate(savedInstanceState);
setNextText(R.string.next);
mLocationAccess = (CheckBox) findViewById(R.id.location_checkbox);
mLocationAgpsAccess = (CheckBox) findViewById(R.id.location_agps_checkbox);
mLocationAccess = findViewById(R.id.location_checkbox);
mLocationAgpsAccess = findViewById(R.id.location_agps_checkbox);
mLocationManager = getSystemService(LocationManager.class);
mUserManager = getSystemService(UserManager.class);
View locationAccessView = findViewById(R.id.location);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 The LineageOS Project
* Copyright (C) 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,6 +69,7 @@ import com.android.internal.telephony.TelephonyIntents;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -184,7 +185,7 @@ public class PhoneMonitor {
private void updatePhoneStateTrackers() {
int i = 0;
int[] subIds = mSubscriptionManager.getActiveSubscriptionIdList();
HashSet<Integer> subIdSet = new HashSet(Arrays.asList(subIds));
HashSet<Integer> subIdSet = new HashSet(Collections.singletonList(subIds));
if (LOGV) {
Log.v(TAG, "Register PhoneStateListeners for " + subIdSet);
}
@@ -482,7 +483,7 @@ public class PhoneMonitor {
states.append(" ").append(getPhoneState(subId));
}
return getPhoneTypeName() + " \"" + getNetworkTypeName() + "\"" + " mcc" + getMcc() +
"mnc" + getMnc() + " " + getDataStateName() + " " + states.toString();
"mnc" + getMnc() + " " + getDataStateName() + " " + states;
}
private String getPhoneState(int subId) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2013 The CyanogenMod Project
* 2017-2023 The LineageOS Project
* 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -170,9 +170,8 @@ public class SetupWizardUtils {
return statusBarManager;
}
public static void enableStatusBar(Context context) {
final SetupWizardApp setupWizardApp = (SetupWizardApp)context.getApplicationContext();
StatusBarManager statusBarManager = setupWizardApp.getStatusBarManager();
public static void enableStatusBar() {
StatusBarManager statusBarManager = SetupWizardApp.getStatusBarManager();
if (statusBarManager != null) {
if (LOGV) {
Log.v(SetupWizardApp.TAG, "Enabling status bar");

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* 2022 The LineageOS Project
* 2022-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -655,7 +655,7 @@ public class LocalePicker extends LinearLayout {
// increment button
if (!mHasSelectorWheel) {
mIncrementButton = (ImageButton) findViewById(R.id.lp__increment);
mIncrementButton = findViewById(R.id.lp__increment);
mIncrementButton.setOnClickListener(onClickListener);
mIncrementButton.setOnLongClickListener(onLongClickListener);
} else {
@@ -664,7 +664,7 @@ public class LocalePicker extends LinearLayout {
// decrement button
if (!mHasSelectorWheel) {
mDecrementButton = (ImageButton) findViewById(R.id.lp__decrement);
mDecrementButton = findViewById(R.id.lp__decrement);
mDecrementButton.setOnClickListener(onClickListener);
mDecrementButton.setOnLongClickListener(onLongClickListener);
} else {
@@ -672,7 +672,7 @@ public class LocalePicker extends LinearLayout {
}
// input text
mInputText = (EditText) findViewById(R.id.localepicker_input);
mInputText = findViewById(R.id.localepicker_input);
mInputText.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
@@ -2477,7 +2477,6 @@ public class LocalePicker extends LinearLayout {
outResult.add(createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INCREMENT));
}
}
return;
}
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project
* Copyright (C) 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Objects;
public class WizardAction implements Parcelable {
@@ -87,15 +88,11 @@ public class WizardAction implements Parcelable {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof WizardAction)) return false;
if (!(o instanceof WizardAction that)) return false;
WizardAction that = (WizardAction) o;
if (mId != null ? !mId.equals(that.mId) : that.mId != null) return false;
if (mUri != null ? !mUri.equals(that.mUri) : that.mUri != null) return false;
return mTransitions != null ?
mTransitions.equals(that.mTransitions) :
that.mTransitions == null;
if (!Objects.equals(mId, that.mId)) return false;
if (!Objects.equals(mUri, that.mUri)) return false;
return Objects.equals(mTransitions, that.mTransitions);
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project
* Copyright (C) 2017-2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@ import android.os.Parcelable;
import android.util.Log;
import android.util.SparseArray;
import java.util.Objects;
public class WizardTransitions extends SparseArray<String> implements Parcelable {
private static final String TAG = "WizardTransitions";
@@ -76,8 +78,7 @@ public class WizardTransitions extends SparseArray<String> implements Parcelable
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WizardTransitions that = (WizardTransitions) o;
return mDefaultAction != null ? mDefaultAction.equals(that.mDefaultAction)
: that.mDefaultAction == null;
return Objects.equals(mDefaultAction, that.mDefaultAction);
}