Snap for 8303774 from da591a4f76 to tm-release

Change-Id: I32db58d496ae54995fe549103e69ed2c89ccb591
This commit is contained in:
Android Build Coastguard Worker
2022-03-16 01:08:45 +00:00
11 changed files with 41 additions and 20 deletions

View File

@@ -33,8 +33,8 @@
style="?android:attr/borderlessButtonStyle" style="?android:attr/borderlessButtonStyle"
android:layout_width="56dp" android:layout_width="56dp"
android:layout_height="56dp" android:layout_height="56dp"
android:layout_marginTop="12dp" android:layout_centerHorizontal="true"
android:layout_toEndOf="@id/filter_spinner" android:layout_toRightOf="@+id/filter_spinner"
android:contentDescription="@string/configure" android:contentDescription="@string/configure"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_apps_filter_settings_24dp" android:src="@drawable/ic_apps_filter_settings_24dp"

View File

@@ -618,4 +618,6 @@
<!-- Whether the dream setup activity should be enabled as part of setupwizard --> <!-- Whether the dream setup activity should be enabled as part of setupwizard -->
<bool name="dream_setup_supported">false</bool> <bool name="dream_setup_supported">false</bool>
<!-- Whether to put the apps with system UID into system component bucket or not -->
<bool name="config_battery_combine_system_components">false</bool>
</resources> </resources>

View File

@@ -7774,6 +7774,8 @@
<string name="nfc_payment_btn_text_set_deault">Set default</string> <string name="nfc_payment_btn_text_set_deault">Set default</string>
<!-- Label of the Update button of the Update default payment app dialog [CHAR LIMIT=40] --> <!-- Label of the Update button of the Update default payment app dialog [CHAR LIMIT=40] -->
<string name="nfc_payment_btn_text_update">Update</string> <string name="nfc_payment_btn_text_update">Update</string>
<!-- Summary text of the work apps in the default payment selection list [CHAR LIMIT=20]-->
<string name="nfc_work_text">Work</string>
<!-- Restrictions settings --><skip/> <!-- Restrictions settings --><skip/>
<!-- Restriction settings title [CHAR LIMIT=35] --> <!-- Restriction settings title [CHAR LIMIT=35] -->

View File

@@ -432,12 +432,12 @@
</style> </style>
<style name="LockPatternContainerStyle"> <style name="LockPatternContainerStyle">
<item name="android:maxHeight">400dp</item> <item name="android:maxHeight">620dp</item>
<item name="android:maxWidth">420dp</item> <item name="android:maxWidth">620dp</item>
<item name="android:minHeight">0dp</item> <item name="android:minHeight">0dp</item>
<item name="android:minWidth">0dp</item> <item name="android:minWidth">0dp</item>
<item name="android:paddingBottom">0dp</item> <item name="android:paddingBottom">0dp</item>
<item name="android:paddingHorizontal">44dp</item> <item name="android:paddingHorizontal">0dp</item>
<item name="android:paddingTop">0dp</item> <item name="android:paddingTop">0dp</item>
</style> </style>

View File

@@ -312,9 +312,10 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
default: default:
FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this); FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
int enrolled = fpm.getEnrolledFingerprints().size(); int enrolled = fpm.getEnrolledFingerprints().size();
int max = getResources().getInteger( final List<FingerprintSensorPropertiesInternal> props =
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser); fpm.getSensorPropertiesInternal();
if (enrolled >= max) { final int maxEnrollments = props.get(0).maxEnrollmentsPerUser;
if (enrolled >= maxEnrollments) {
finish(); finish();
} else { } else {
// We came back from enrolling but it wasn't completed, start again. // We came back from enrolling but it wasn't completed, start again.

View File

@@ -21,6 +21,7 @@ import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
@@ -36,6 +37,7 @@ import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton; import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupcompat.util.WizardManagerHelper;
import java.util.List;
/** /**
* Activity which concludes fingerprint enrollment. * Activity which concludes fingerprint enrollment.
*/ */
@@ -92,10 +94,11 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this); final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
boolean hideAddAnother = false; boolean hideAddAnother = false;
if (fpm != null) { if (fpm != null) {
final List<FingerprintSensorPropertiesInternal> props =
fpm.getSensorPropertiesInternal();
int maxEnrollments = props.get(0).maxEnrollmentsPerUser;
int enrolled = fpm.getEnrolledFingerprints(mUserId).size(); int enrolled = fpm.getEnrolledFingerprints(mUserId).size();
int max = getResources().getInteger( hideAddAnother = enrolled >= maxEnrollments;
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
hideAddAnother = enrolled >= max;
} }
if (hideAddAnother) { if (hideAddAnother) {
// Don't show "Add" button if too many fingerprints already added // Don't show "Add" button if too many fingerprints already added

View File

@@ -457,8 +457,10 @@ public class FingerprintSettings extends SubSettings {
final Preference addPreference = findPreference(KEY_FINGERPRINT_ADD); final Preference addPreference = findPreference(KEY_FINGERPRINT_ADD);
/* Disable preference if too many fingerprints added */ /* Disable preference if too many fingerprints added */
final int max = getContext().getResources().getInteger( final List<FingerprintSensorPropertiesInternal> props =
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser); mFingerprintManager.getSensorPropertiesInternal();
// This will need to be updated for devices with multiple fingerprint sensors
final int max = props.get(0).maxEnrollmentsPerUser;
boolean tooMany = mFingerprintManager.getEnrolledFingerprints(mUserId).size() >= max; boolean tooMany = mFingerprintManager.getEnrolledFingerprints(mUserId).size() >= max;
// retryFingerprint() will be called when remove finishes // retryFingerprint() will be called when remove finishes
// need to disable enroll or have a way to determine if enroll is in progress // need to disable enroll or have a way to determine if enroll is in progress

View File

@@ -25,6 +25,7 @@ import android.util.Log;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settingslib.utils.StringUtil; import com.android.settingslib.utils.StringUtil;
import java.util.Comparator; import java.util.Comparator;
@@ -52,6 +53,7 @@ public class BatteryDiffEntry {
public double mConsumePower; public double mConsumePower;
// A BatteryHistEntry corresponding to this diff usage data. // A BatteryHistEntry corresponding to this diff usage data.
public final BatteryHistEntry mBatteryHistEntry; public final BatteryHistEntry mBatteryHistEntry;
private double mTotalConsumePower; private double mTotalConsumePower;
private double mPercentOfTotal; private double mPercentOfTotal;
@@ -151,8 +153,13 @@ public class BatteryDiffEntry {
case ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY: case ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY:
return true; return true;
case ConvertUtils.CONSUMER_TYPE_UID_BATTERY: case ConvertUtils.CONSUMER_TYPE_UID_BATTERY:
return isSystemUid((int) mBatteryHistEntry.mUid) if (mBatteryHistEntry.mIsHidden) {
|| mBatteryHistEntry.mIsHidden; return true;
}
final boolean combineSystemComponents =
mContext.getResources().getBoolean(
R.bool.config_battery_combine_system_components);
return combineSystemComponents && isSystemUid((int) mBatteryHistEntry.mUid);
} }
return false; return false;
} }

View File

@@ -143,7 +143,8 @@ public class DefaultPaymentSettings extends DefaultAppPickerFragment {
CandidateInfo info, String defaultKey, String systemDefaultKey) { CandidateInfo info, String defaultKey, String systemDefaultKey) {
final NfcPaymentCandidateInfo candidateInfo = (NfcPaymentCandidateInfo) info; final NfcPaymentCandidateInfo candidateInfo = (NfcPaymentCandidateInfo) info;
if (candidateInfo.isManagedProfile()) { if (candidateInfo.isManagedProfile()) {
pref.setSummary("Work"); final String textWork = getContext().getString(R.string.nfc_work_text);
pref.setSummary(textWork);
} }
} }

View File

@@ -59,10 +59,13 @@ public final class PaymentDefaultDialog extends AlertActivity implements
CardEmulation.EXTRA_SERVICE_COMPONENT); CardEmulation.EXTRA_SERVICE_COMPONENT);
String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY); String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY);
UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER); UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER);
int userId;
if (userHandle == null) { if (userHandle == null) {
userHandle = UserHandle.CURRENT; userId = UserHandle.myUserId();
} else {
userId = userHandle.getIdentifier();
} }
int userId = userHandle.getIdentifier();
setResult(RESULT_CANCELED); setResult(RESULT_CANCELED);
if (!buildDialog(component, category, userId)) { if (!buildDialog(component, category, userId)) {

View File

@@ -349,12 +349,12 @@ public final class BatteryDiffEntryTest {
} }
@Test @Test
public void testIsSystemEntry_uidBatteryWithSystemProcess_returnTrue() { public void testIsSystemEntry_uidBatteryWithSystemProcess_returnFalse() {
final BatteryDiffEntry entry = final BatteryDiffEntry entry =
createBatteryDiffEntry( createBatteryDiffEntry(
ConvertUtils.CONSUMER_TYPE_UID_BATTERY, ConvertUtils.CONSUMER_TYPE_UID_BATTERY,
/*uid=*/ 1230, /*isHidden=*/ false); /*uid=*/ 1230, /*isHidden=*/ false);
assertThat(entry.isSystemEntry()).isTrue(); assertThat(entry.isSystemEntry()).isFalse();
} }
@Test @Test