Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: robotest & manual Change-Id: I1eaa45b576913e57ad9728e3a6fc892c4cf9fdc7
This commit is contained in:
@@ -139,8 +139,8 @@ public class RunningState {
|
||||
|
||||
int mSequence = 0;
|
||||
|
||||
final Comparator<RunningState.MergedItem> mBackgroundComparator
|
||||
= new Comparator<RunningState.MergedItem>() {
|
||||
final Comparator<RunningState.MergedItem> mBackgroundComparator =
|
||||
new Comparator<RunningState.MergedItem>() {
|
||||
@Override
|
||||
public int compare(MergedItem lhs, MergedItem rhs) {
|
||||
if (DEBUG_COMPARE) {
|
||||
@@ -161,12 +161,14 @@ public class RunningState {
|
||||
}
|
||||
if (lhs.mProcess == null) return -1;
|
||||
if (rhs.mProcess == null) return 1;
|
||||
if (DEBUG_COMPARE) Log.i(TAG, " Label " + lhs.mProcess.mLabel
|
||||
if (DEBUG_COMPARE) {
|
||||
Log.i(TAG, " Label " + lhs.mProcess.mLabel
|
||||
+ " with " + rhs.mProcess.mLabel);
|
||||
final ActivityManager.RunningAppProcessInfo lhsInfo
|
||||
= lhs.mProcess.mRunningProcessInfo;
|
||||
final ActivityManager.RunningAppProcessInfo rhsInfo
|
||||
= rhs.mProcess.mRunningProcessInfo;
|
||||
}
|
||||
final ActivityManager.RunningAppProcessInfo lhsInfo =
|
||||
lhs.mProcess.mRunningProcessInfo;
|
||||
final ActivityManager.RunningAppProcessInfo rhsInfo =
|
||||
rhs.mProcess.mRunningProcessInfo;
|
||||
final boolean lhsBg = lhsInfo.importance
|
||||
>= ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
|
||||
final boolean rhsBg = rhsInfo.importance
|
||||
@@ -183,7 +185,10 @@ public class RunningState {
|
||||
if (lhsA != rhsA) {
|
||||
return lhsA ? -1 : 1;
|
||||
}
|
||||
if (DEBUG_COMPARE) Log.i(TAG, " Lru " + lhsInfo.lru + " with " + rhsInfo.lru);
|
||||
if (DEBUG_COMPARE) {
|
||||
Log.i(TAG,
|
||||
" Lru " + lhsInfo.lru + " with " + rhsInfo.lru);
|
||||
}
|
||||
if (lhsInfo.lru != rhsInfo.lru) {
|
||||
return lhsInfo.lru < rhsInfo.lru ? -1 : 1;
|
||||
}
|
||||
@@ -221,6 +226,7 @@ public class RunningState {
|
||||
// ----- BACKGROUND MONITORING THREAD -----
|
||||
|
||||
final HandlerThread mBackgroundThread;
|
||||
|
||||
final class BackgroundHandler extends Handler {
|
||||
public BackgroundHandler(Looper looper) {
|
||||
super(looper);
|
||||
@@ -776,9 +782,9 @@ public class RunningState {
|
||||
|
||||
private RunningState(Context context) {
|
||||
mApplicationContext = context.getApplicationContext();
|
||||
mAm = (ActivityManager)mApplicationContext.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
mAm = mApplicationContext.getSystemService(ActivityManager.class);
|
||||
mPm = mApplicationContext.getPackageManager();
|
||||
mUm = (UserManager)mApplicationContext.getSystemService(Context.USER_SERVICE);
|
||||
mUm = mApplicationContext.getSystemService(UserManager.class);
|
||||
mMyUserId = UserHandle.myUserId();
|
||||
UserInfo userInfo = mUm.getUserInfo(mMyUserId);
|
||||
mHideManagedProfiles = userInfo == null || !userInfo.canHaveProfile();
|
||||
@@ -1119,8 +1125,7 @@ public class RunningState {
|
||||
if (pi.mCurSeq == mSequence) {
|
||||
pi.ensureLabel(pm);
|
||||
if (pi.mPid == 0) {
|
||||
// Sanity: a non-process can't be dependent on
|
||||
// anything.
|
||||
// Validation: a non-process can't be dependent on anything.
|
||||
pi.mDependentProcesses.clear();
|
||||
}
|
||||
} else {
|
||||
|
@@ -112,7 +112,7 @@ public class BatteryTipPreferenceController extends BasePreferenceController {
|
||||
|
||||
for (int i = 0, size = batteryTips.size(); i < size; i++) {
|
||||
final BatteryTip batteryTip = mBatteryTips.get(i);
|
||||
batteryTip.sanityCheck(mContext);
|
||||
batteryTip.validateCheck(mContext);
|
||||
if (batteryTip.getState() != BatteryTip.StateType.INVISIBLE) {
|
||||
batteryTip.updatePreference(mCardPreference);
|
||||
mBatteryTipMap.put(mCardPreference.getKey(), batteryTip);
|
||||
|
@@ -138,7 +138,7 @@ public abstract class BatteryTip implements Comparable<BatteryTip>, Parcelable {
|
||||
* Check whether data is still make sense. If not, try recover.
|
||||
* @param context used to do validate check
|
||||
*/
|
||||
public void sanityCheck(Context context) {
|
||||
public void validateCheck(Context context) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
@@ -107,8 +107,8 @@ public class RestrictAppTip extends BatteryTip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sanityCheck(Context context) {
|
||||
super.sanityCheck(context);
|
||||
public void validateCheck(Context context) {
|
||||
super.validateCheck(context);
|
||||
|
||||
// Set it invisible if there is no valid app
|
||||
mRestrictAppList.removeIf(AppLabelPredicate.getInstance(context));
|
||||
|
@@ -34,7 +34,6 @@ import android.os.Parcel;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.fuelgauge.batterytip.AppInfo;
|
||||
import com.android.settings.testutils.BatteryTestUtils;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -45,10 +44,10 @@ import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class RestrictAppTipTest {
|
||||
@@ -198,7 +197,7 @@ public class RestrictAppTipTest {
|
||||
appInfos.add(mUninstallAppInfo);
|
||||
final BatteryTip batteryTip = new RestrictAppTip(BatteryTip.StateType.NEW, appInfos);
|
||||
|
||||
batteryTip.sanityCheck(mContext);
|
||||
batteryTip.validateCheck(mContext);
|
||||
|
||||
assertThat(batteryTip.getState()).isEqualTo(BatteryTip.StateType.INVISIBLE);
|
||||
}
|
||||
@@ -210,7 +209,7 @@ public class RestrictAppTipTest {
|
||||
appInfos.add(mUninstallAppInfo);
|
||||
final BatteryTip batteryTip = new RestrictAppTip(BatteryTip.StateType.NEW, appInfos);
|
||||
|
||||
batteryTip.sanityCheck(mContext);
|
||||
batteryTip.validateCheck(mContext);
|
||||
|
||||
assertThat(batteryTip.getState()).isEqualTo(BatteryTip.StateType.NEW);
|
||||
}
|
||||
|
Reference in New Issue
Block a user