Snap for 9296606 from 2f0cec804f to udc-release
Change-Id: I7777f1501e65089796f02ff9f07d9570e73289cd
This commit is contained in:
1
OWNERS
1
OWNERS
@@ -10,7 +10,6 @@ emilychuang@google.com
|
||||
millchen@google.com
|
||||
stanleytfwang@google.com
|
||||
sunnyshao@google.com
|
||||
tmfang@google.com
|
||||
yantingyang@google.com
|
||||
ykhung@google.com
|
||||
|
||||
|
||||
@@ -240,11 +240,11 @@
|
||||
<!-- Message shown in SFPS enrollment dialog to locate the sensor (default) [CHAR LIMIT=NONE]-->
|
||||
<string name="security_settings_sfps_enroll_find_sensor_message" product="default">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the phone.\n\nPressing the power button turns off the screen.</string>
|
||||
<!-- Message shown in fingerprint enrollment dialog once enrollment is completed (tablet) [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="tablet">Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps</string>
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="tablet">Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||
<!-- Message shown in fingerprint enrollment dialog once enrollment is completed (device) [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="device">Now you can use your fingerprint to unlock your device or verify it\u2019s you, like when you sign in to apps</string>
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="device">Now you can use your fingerprint to unlock your device or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||
<!-- Message shown in fingerprint enrollment dialog once enrollment is completed (default) [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="default">Now you can use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps</string>
|
||||
<string name="security_settings_fingerprint_enroll_finish_v2_message" product="default">Now you can use your fingerprint to unlock your phone or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
|
||||
<string name="lock_screen_pin_skip_message" product="tablet">A PIN protects the tablet if it\u2019s lost or stolen</string>
|
||||
<!-- Dialog text shown when the user tries to skip setting up a screen lock, warning that they can't continue to set up fingerprint. (tablet) [CHAR LIMIT=NONE] -->
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:gravity="center">
|
||||
android:layout_gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fingerprint_in_app_indicator"
|
||||
|
||||
@@ -797,8 +797,6 @@
|
||||
<string name="security_settings_udfps_enroll_progress_a11y_message">Enrolling fingerprint <xliff:g id="percentage" example="10">%d</xliff:g> percent</string>
|
||||
<!-- Title shown in fingerprint enrollment dialog once enrollment is completed [CHAR LIMIT=29] -->
|
||||
<string name="security_settings_fingerprint_enroll_finish_title">Fingerprint added</string>
|
||||
<!-- Message shown in SFPS enrollment dialog once enrollment is completed [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_sfps_enroll_finish">Now you can use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps or approve a purchase</string>
|
||||
<!-- Title for require screen on to auth toggle shown in fingerprint enrollment dialog once enrollment is completed. [CHAR LIMIT=NONE] -->
|
||||
<string name="security_settings_require_screen_on_to_auth_title">Unlock only when screen is on</string>
|
||||
<!-- Description for require screen on to auth toggle shown in fingerprint enrollment dialog once enrollment is completed. [CHAR LIMIT=NONE] -->
|
||||
@@ -2269,19 +2267,19 @@
|
||||
<string name="short_summary_font_size">Make text bigger or smaller</string>
|
||||
|
||||
<!-- SIM lock settings title [CHAR LIMIT=40] -->
|
||||
<string name="sim_lock_settings">SIM card lock settings</string>
|
||||
<!-- Security & screen lock settings screen, SIM card lock setting option name [CHAR LIMIT=40] -->
|
||||
<string name="sim_lock_settings_category">SIM card lock</string>
|
||||
<!-- SIM card lock settings screen, setting check box label [CHAR LIMIT=40] -->
|
||||
<string name="sim_pin_toggle">Lock SIM card</string>
|
||||
<string name="sim_lock_settings">SIM lock settings</string>
|
||||
<!-- Security & screen lock settings screen, SIM lock setting option name [CHAR LIMIT=40] -->
|
||||
<string name="sim_lock_settings_category">SIM lock</string>
|
||||
<!-- SIM lock settings screen, setting check box label [CHAR LIMIT=40] -->
|
||||
<string name="sim_pin_toggle">Lock SIM</string>
|
||||
<!-- SIM card lock settings screen, setting option name to change the SIM PIN [CHAR LIMIT=40] -->
|
||||
<string name="sim_pin_change">Change SIM PIN</string>
|
||||
<!-- SIM card lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_enter_pin">SIM PIN</string>
|
||||
<!-- SIM card lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_enable_sim_lock">Lock SIM card</string>
|
||||
<!-- SIM card lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_disable_sim_lock">Unlock SIM card</string>
|
||||
<!-- SIM lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_enable_sim_lock">Lock SIM</string>
|
||||
<!-- SIM lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_disable_sim_lock">Unlock SIM</string>
|
||||
<!-- SIM card lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
<string name="sim_enter_old">Old SIM PIN</string>
|
||||
<!-- SIM card lock settings screen, SIM PIN dialog message instruction [CHAR LIMIT=40] -->
|
||||
@@ -2321,7 +2319,7 @@
|
||||
Use <xliff:g id="carrier" example="Verizon">%1$s</xliff:g>
|
||||
</string>
|
||||
<!-- Title for the dialog asking to user to change the preferred SIM [CHAR LIMIT=30] -->
|
||||
<string name="sim_preferred_title">Update preferred SIM card?</string>
|
||||
<string name="sim_preferred_title">Update preferred SIM?</string>
|
||||
<!-- Message for the dialog asking to user to change the preferred SIM [CHAR LIMIT=NONE] -->
|
||||
<string name="sim_preferred_message"><xliff:g id="new_sim">%1$s</xliff:g> is the only SIM in your device. Do you want to use this SIM for mobile data, calls, and SMS messages?</string>
|
||||
|
||||
@@ -2690,7 +2688,7 @@
|
||||
<!-- Confirmation button of dialog to confirm resetting user's app preferences [CHAR LIMIT=NONE] -->
|
||||
<string name="erase_euicc_data_button">Erase</string>
|
||||
<!-- Erase Euicc dialog and SD card & phone storage settings screen, title for the menu option and checkbox to let user decide whether erase eSIM data together [CHAR LIMIT=50] -->
|
||||
<string name="reset_esim_title">Erase downloaded SIMs</string>
|
||||
<string name="reset_esim_title">Erase eSIMs</string>
|
||||
<!-- Erase Euicc dialog and SD card & phone storage settings screen, message for the checkbox to let user decide whether erase eSIM data together [CHAR LIMIT=NONE] -->
|
||||
<string name="reset_esim_desc">This won’t cancel any mobile service plans. To download replacement SIMs, contact your carrier.</string>
|
||||
|
||||
@@ -2699,7 +2697,7 @@
|
||||
<!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button -->
|
||||
<string name="reset_network_final_desc">Reset all network settings? You can\u2019t undo this action.</string>
|
||||
<!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button [CHAR LIMIT=NONE] -->
|
||||
<string name="reset_network_final_desc_esim">Reset all network settings and erase downloaded SIMs? You can\u2019t undo this action.</string>
|
||||
<string name="reset_network_final_desc_esim">Reset all network settings and erase eSIMs? You can\u2019t undo this action.</string>
|
||||
<!-- SD card & phone storage settings screen, button on screen after user selects Reset settings button -->
|
||||
<string name="reset_network_final_button_text">Reset settings</string>
|
||||
<!-- Reset settings confirmation screen title [CHAR LIMIT=30] -->
|
||||
@@ -2711,7 +2709,7 @@
|
||||
<!-- Title of the error message shown when error happens during erase eSIM data [CHAR LIMIT=NONE] -->
|
||||
<string name="reset_esim_error_title">Can\u2019t erase SIMs</string>
|
||||
<!-- Message of the error message shown when error happens during erase eSIM data [CHAR LIMIT=NONE] -->
|
||||
<string name="reset_esim_error_msg">Downloaded SIMs can\u2019t be erased due to an error.\n\nRestart your device and try again.</string>
|
||||
<string name="reset_esim_error_msg">eSIMs can\u2019t be erased due to an error.\n\nRestart your device and try again.</string>
|
||||
|
||||
<!-- Main Clear -->
|
||||
<!-- Button title to factory data reset the entire device [CHAR LIMIT=NONE] -->
|
||||
@@ -6279,7 +6277,7 @@
|
||||
<string name="regulatory_info_text"></string>
|
||||
|
||||
<!-- Title for SIM settings title settings during Setup Wizard. [CHAR LIMIT=40] -->
|
||||
<string name="sim_settings_title">SIM cards</string>
|
||||
<string name="sim_settings_title">SIMs</string>
|
||||
<!-- Message that Cellular data is unavailable. [CHAR LIMIT=40] -->
|
||||
<string name="sim_cellular_data_unavailable">Mobile data is unavailable</string>
|
||||
<!-- Message summary that Cellular data is unavailable. [CHAR LIMIT=60] -->
|
||||
@@ -6314,8 +6312,8 @@
|
||||
<string name="sim_status_title_sim_slot">SIM status (sim slot %1$d)</string>
|
||||
<!-- Summary text describing signal strength to the user. [CHAR LIMIT=60] -->
|
||||
<string name="sim_signal_strength"><xliff:g id="dbm">%1$d</xliff:g> dBm <xliff:g id="asu">%2$d</xliff:g> asu</string>
|
||||
<!-- Title for SIM card notification. [CHAR LIMIT=40] -->
|
||||
<string name="sim_notification_title">SIM cards changed.</string>
|
||||
<!-- Title for SIM notification. [CHAR LIMIT=40] -->
|
||||
<string name="sim_notification_title">SIMs changed.</string>
|
||||
<!-- Message under title informing the user to touch to go to SIM Cards in Settings. [CHAR LIMIT=40] -->
|
||||
<string name="sim_notification_summary">Tap to set up</string>
|
||||
|
||||
@@ -8014,7 +8012,7 @@
|
||||
<!-- [CHAR LIMIT=60] turn eSim deletion confirmation on/off -->
|
||||
<string name="confirm_sim_deletion_title">Confirm SIM deletion</string>
|
||||
<!-- [CHAR LIMIT=NONE] eSim deletion confirmation description -->
|
||||
<string name="confirm_sim_deletion_description">Verify it\u0027s you before erasing a downloaded SIM</string>
|
||||
<string name="confirm_sim_deletion_description">Verify it\u0027s you before erasing a eSIM</string>
|
||||
|
||||
<!-- TODO(b/258550150): Finalize all strings in this section and remove translatable="false" -->
|
||||
<!-- [CHAR LIMIT=32] Name of Advanced memory protection page in "More Security Settings" and heading of page. -->
|
||||
@@ -10086,7 +10084,7 @@
|
||||
</string>
|
||||
<!-- Mobile network setting screen, summary of Mobile data switch preference when the network
|
||||
is unavailable, the preference selection will be disabled. [CHAR LIMIT=NONE] -->
|
||||
<string name="mobile_data_settings_summary_unavailable">No SIM card available</string>
|
||||
<string name="mobile_data_settings_summary_unavailable">No SIM available</string>
|
||||
|
||||
<!-- Mobile network settings screen, title of item showing the name of the default subscription
|
||||
that will be used for calls. This only appears in multi-SIM mode. [CHAR LIMIT=NONE] -->
|
||||
@@ -10140,10 +10138,10 @@
|
||||
<string name="mobile_network_inactive_sim">Inactive / SIM</string>
|
||||
<!-- Summary for an item in the page listing multiple mobile service subscriptions, indicating
|
||||
that service is active and is tied to an eSIM profile [CHAR LIMIT=40] -->
|
||||
<string name="mobile_network_active_esim">Active / Downloaded SIM</string>
|
||||
<string name="mobile_network_active_esim">Active / eSIM</string>
|
||||
<!-- Summary for an item in the page listing multiple mobile service subscriptions, indicating
|
||||
that service is inactive and is tied to an eSIM profile [CHAR LIMIT=40] -->
|
||||
<string name="mobile_network_inactive_esim">Inactive / Downloaded SIM</string>
|
||||
<string name="mobile_network_inactive_esim">Inactive / eSIM</string>
|
||||
<!-- Title of a dialog that lets a user modify the display name used for a mobile network
|
||||
subscription in various places in the Settings app. The default name is typically just the
|
||||
carrier name, but especially in multi-SIM configurations users may want to use a different
|
||||
@@ -10243,8 +10241,8 @@
|
||||
<string name="sim_action_switch_sub_dialog_mep_title">Use <xliff:g id="carrier_name" example="Google Fi">%1$s</xliff:g>?</string>
|
||||
<!-- Body text of confirmation dialog for switching subscription that involves switching SIM slots. Indicates that only one SIM can be active at a time. Also that switching will not cancel the user's mobile service plan. [CHAR_LIMIT=NONE] -->
|
||||
<string name="sim_action_switch_sub_dialog_text">Only one SIM can be active at a time.\n\nSwitching to <xliff:g id="to_carrier_name" example="Google Fi">%1$s</xliff:g> won\u2019t cancel your <xliff:g id="from_carrier_name" example="Sprint">%2$s</xliff:g> service.</string>
|
||||
<!-- Body text of confirmation dialog for switching subscription between two eSIM profiles. Indicates that only one downloaded SIM can be active at a time. Also that switching will not cancel the user's mobile service plan. [CHAR_LIMIT=NONE] -->
|
||||
<string name="sim_action_switch_sub_dialog_text_downloaded">Only one downloaded SIM can be active at a time.\n\nSwitching to <xliff:g id="to_carrier_name" example="Google Fi">%1$s</xliff:g> won\u2019t cancel your <xliff:g id="from_carrier_name" example="Sprint">%2$s</xliff:g> service.</string>
|
||||
<!-- Body text of confirmation dialog for switching subscription between two eSIM profiles. Indicates that only 1 eSIM can be active at a time. Also that switching will not cancel the user's mobile service plan. [CHAR_LIMIT=NONE] -->
|
||||
<string name="sim_action_switch_sub_dialog_text_downloaded">Only 1 eSIM can be active at a time.\n\nSwitching to <xliff:g id="to_carrier_name" example="Google Fi">%1$s</xliff:g> won\u2019t cancel your <xliff:g id="from_carrier_name" example="Sprint">%2$s</xliff:g> service.</string>
|
||||
<!-- Body text of confirmation dialog for switching subscription between two eSIM profiles. Indicates that only one SIM can be active at a time. Also that switching will not cancel the user's mobile service plan. [CHAR_LIMIT=NONE] -->
|
||||
<string name="sim_action_switch_sub_dialog_text_single_sim">Only one SIM can be active at a time.\n\nSwitching won\u2019t cancel your <xliff:g id="to_carrier_name" example="Google Fi">%1$s</xliff:g> service.</string>
|
||||
<!-- Body text of confirmation dialog for switching subscription between two eSIM profiles. Indicates that only one downloaded SIM can be active at a time. Also that switching will not cancel the user's mobile service plan. [CHAR_LIMIT=NONE] -->
|
||||
@@ -10338,12 +10336,12 @@
|
||||
<!-- The body text of skip sim switch dialog. [CHAR LIMIT=NONE] -->
|
||||
<string name="switch_sim_dialog_no_switch_text">To use mobile data, call features, and SMS at a later time, go to your network settings</string>
|
||||
|
||||
<!-- Button label of the removable sim card. [CHAR LIMIT=NONE] -->
|
||||
<string name="sim_card_label">SIM card</string>
|
||||
<!-- Button label of the removable sim. [CHAR LIMIT=NONE] -->
|
||||
<string name="sim_card_label">SIM</string>
|
||||
|
||||
<!-- Strings for deleting eUICC subscriptions dialog activity -->
|
||||
<!-- Title on confirmation dialog asking the user if they want to erase the downloaded SIM from the device. [CHAR_LIMIT=NONE] -->
|
||||
<string name="erase_sim_dialog_title">Erase this downloaded SIM?</string>
|
||||
<!-- Title on confirmation dialog asking the user if they want to erase the eSIM from the device. [CHAR_LIMIT=NONE] -->
|
||||
<string name="erase_sim_dialog_title">Erase this eSIM?</string>
|
||||
<!-- Body text in confirmation dialog indicating what erasing a SIM entails. [CHAR_LIMIT=NONE] -->
|
||||
<string name="erase_sim_dialog_text">Erasing this SIM removes <xliff:g id="carrier_name_a" example="Google Fi">%1$s</xliff:g> service from this device.\n\nService for <xliff:g id="carrier_name_b" example="Google Fi">%1$s</xliff:g> won\'t be canceled.</string>
|
||||
<!-- Button label to erase the eSIM [CHAR_LIMIT=20] -->
|
||||
@@ -10717,10 +10715,10 @@
|
||||
<string name="carrier_wifi_network_title">W+ network</string>
|
||||
<!-- Provider Model: title of SIM category -->
|
||||
<string name="sim_category_title">SIM</string>
|
||||
<!-- Provider Model: title of Downloaded SIM category. [CHAR LIMIT=50] -->
|
||||
<string name="downloaded_sim_category_title">DOWNLOADED SIM</string>
|
||||
<!-- Provider Model: title of Downloaded SIMs category. [CHAR LIMIT=50] -->
|
||||
<string name="downloaded_sims_category_title">DOWNLOADED SIMS</string>
|
||||
<!-- Provider Model: title of eSIM category. [CHAR LIMIT=50] -->
|
||||
<string name="downloaded_sim_category_title">eSIM</string>
|
||||
<!-- Provider Model: title of eSIMs category. [CHAR LIMIT=50] -->
|
||||
<string name="downloaded_sims_category_title">eSIMs</string>
|
||||
<!-- Provider Model: summary of Active in SIM category. [CHAR LIMIT=50] -->
|
||||
<string name="sim_category_active_sim">Active</string>
|
||||
<!-- Provider Model: summary of Inactive in SIM category. [CHAR LIMIT=50] -->
|
||||
@@ -10850,7 +10848,7 @@
|
||||
<!-- Dialog title for smart forwarding failed [CHAR LIMIT=50]-->
|
||||
<string name="smart_forwarding_failed_title">Call Settings error</string>
|
||||
<!-- Subtext for smart forwarding failed [CHAR LIMIT=50]-->
|
||||
<string name="smart_forwarding_failed_text">Network or SIM card error.</string>
|
||||
<string name="smart_forwarding_failed_text">Network or SIM error.</string>
|
||||
<!-- Subtext for sim is not activated [CHAR LIMIT=50]-->
|
||||
<string name="smart_forwarding_failed_not_activated_text">Sim is not activated.</string>
|
||||
<!-- Title when smart forwarding can't get the phone number [CHAR LIMIT=50]-->
|
||||
@@ -10911,14 +10909,14 @@
|
||||
<!-- Content description of preview pager in colors preview -->
|
||||
<string name="colors_viewpager_content_description">Color preview</string>
|
||||
|
||||
<!-- Bluetooth sim card permission alert for notification title [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_notification_title">SIM card access request</string>
|
||||
<!-- Bluetooth sim card permission alert for notification content [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_notification_content">A device wants to access your SIM card. Tap for details.</string>
|
||||
<!-- Bluetooth sim card permission alert for dialog title [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_dialog_title">Allow access to SIM card?</string>
|
||||
<!-- Bluetooth sim card permission alert for dialog content [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_dialog_content">A Bluetooth device, <xliff:g id="device_name" example="My device">%1$s</xliff:g>, wants to access data on your SIM card. This includes your contacts.\n\nWhile connected, <xliff:g id="device_name" example="My device">%2$s</xliff:g> will receive all calls made to <xliff:g id="phone_number" example="0912345678">%3$s</xliff:g>.</string>
|
||||
<!-- Bluetooth sim permission alert for notification title [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_notification_title">SIM access request</string>
|
||||
<!-- Bluetooth sim permission alert for notification content [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_notification_content">A device wants to access your SIM. Tap for details.</string>
|
||||
<!-- Bluetooth sim permission alert for dialog title [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_dialog_title">Allow access to SIM?</string>
|
||||
<!-- Bluetooth sim permission alert for dialog content [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_sim_card_access_dialog_content">A Bluetooth device, <xliff:g id="device_name" example="My device">%1$s</xliff:g>, wants to access data from your SIM. This includes your contacts.\n\nWhile connected, <xliff:g id="device_name" example="My device">%2$s</xliff:g> will receive all calls made to <xliff:g id="phone_number" example="0912345678">%3$s</xliff:g>.</string>
|
||||
<!-- Bluetooth connect permission alert for notification title [CHAR LIMIT=none] -->
|
||||
<string name="bluetooth_connect_access_notification_title">Bluetooth device available</string>
|
||||
<!-- Bluetooth connect permission alert for notification content [CHAR LIMIT=none] -->
|
||||
|
||||
@@ -24,6 +24,7 @@ import static com.android.settings.applications.appinfo.AppButtonsPreferenceCont
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
@@ -230,11 +231,32 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||
if (name.equals(getPackageName() + "_preferences")) {
|
||||
return new SharedPreferencesLogger(this, getMetricsTag(),
|
||||
FeatureFactory.getFactory(this).getMetricsFeatureProvider());
|
||||
if (!TextUtils.equals(name, getPackageName() + "_preferences")) {
|
||||
return super.getSharedPreferences(name, mode);
|
||||
}
|
||||
return super.getSharedPreferences(name, mode);
|
||||
|
||||
String tag = getMetricsTag();
|
||||
|
||||
return new SharedPreferencesLogger(this, tag,
|
||||
FeatureFactory.getFactory(this).getMetricsFeatureProvider(),
|
||||
lookupMetricsCategory());
|
||||
}
|
||||
|
||||
private int lookupMetricsCategory() {
|
||||
int category = SettingsEnums.PAGE_UNKNOWN;
|
||||
Bundle args = null;
|
||||
if (getIntent() != null) {
|
||||
args = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
|
||||
}
|
||||
|
||||
Fragment fragment = Utils.getTargetFragment(this, getMetricsTag(), args);
|
||||
|
||||
if (fragment instanceof Instrumentable) {
|
||||
category = ((Instrumentable) fragment).getMetricsCategory();
|
||||
}
|
||||
Log.d(LOG_TAG, "MetricsCategory is " + category);
|
||||
|
||||
return category;
|
||||
}
|
||||
|
||||
private String getMetricsTag() {
|
||||
@@ -242,13 +264,11 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
|
||||
tag = getInitialFragmentName(getIntent());
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(tag)) {
|
||||
Log.w(LOG_TAG, "MetricsTag is invalid " + tag);
|
||||
tag = getClass().getName();
|
||||
}
|
||||
if (tag.startsWith("com.android.settings.")) {
|
||||
tag = tag.replace("com.android.settings.", "");
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -320,7 +340,7 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
}
|
||||
mMainSwitch = findViewById(R.id.switch_bar);
|
||||
if (mMainSwitch != null) {
|
||||
mMainSwitch.setMetricsTag(getMetricsTag());
|
||||
mMainSwitch.setMetricsCategory(lookupMetricsCategory());
|
||||
mMainSwitch.setTranslationZ(findViewById(R.id.main_content).getTranslationZ() + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,11 +69,7 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
||||
setContentView(R.layout.fingerprint_enroll_finish);
|
||||
}
|
||||
setHeaderText(R.string.security_settings_fingerprint_enroll_finish_title);
|
||||
if (mCanAssumeSfps) {
|
||||
setDescriptionText(R.string.security_settings_sfps_enroll_finish);
|
||||
} else {
|
||||
setDescriptionText(R.string.security_settings_fingerprint_enroll_finish_v2_message);
|
||||
}
|
||||
setDescriptionText(R.string.security_settings_fingerprint_enroll_finish_v2_message);
|
||||
|
||||
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
|
||||
mFooterBarMixin.setSecondaryButton(
|
||||
|
||||
@@ -40,6 +40,22 @@ public class SettingsEventLogWriter extends EventLogWriter {
|
||||
super.hidden(context, category, visibleTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clicked(int sourceCategory, String key) {
|
||||
if (shouldDisableGenericEventLogging()) {
|
||||
return;
|
||||
}
|
||||
super.clicked(sourceCategory, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changed(int category, String key, int value) {
|
||||
if (shouldDisableGenericEventLogging()) {
|
||||
return;
|
||||
}
|
||||
super.changed(category, key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void action(Context context, int category, String pkg) {
|
||||
if (shouldDisableGenericEventLogging()) {
|
||||
|
||||
@@ -84,6 +84,10 @@ public class SettingsIntelligenceLogWriter implements LogWriter {
|
||||
public void clicked(int sourceCategory, String key) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changed(int category, String key, int value) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void action(Context context, int action, Pair<Integer, Object>... taggedData) {
|
||||
action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
|
||||
|
||||
@@ -54,6 +54,16 @@ public class StatsLogWriter implements LogWriter {
|
||||
0 /* changedPreferenceIntValue */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changed(int sourceCategory, String key, int value) {
|
||||
SettingsStatsLog.write(SettingsStatsLog.SETTINGS_UI_CHANGED /* Atom name */,
|
||||
sourceCategory /* attribution */,
|
||||
SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE /* action */,
|
||||
SettingsEnums.PAGE_UNKNOWN /* pageId */,
|
||||
key /* changedPreferenceKey */,
|
||||
value /* changedPreferenceIntValue */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void action(Context context, int action, Pair<Integer, Object>... taggedData) {
|
||||
action(SettingsEnums.PAGE_UNKNOWN /* attribution */,
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
import android.content.DialogInterface.OnShowListener;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
@@ -168,7 +169,8 @@ public class ProfileSelectDialog extends DialogFragment implements UserAdapter.O
|
||||
}
|
||||
final UserManager userManager = UserManager.get(context);
|
||||
for (int i = userHandles.size() - 1; i >= 0; i--) {
|
||||
if (userManager.getUserInfo(userHandles.get(i).getIdentifier()) == null) {
|
||||
UserInfo userInfo = userManager.getUserInfo(userHandles.get(i).getIdentifier());
|
||||
if (userInfo == null || userInfo.isCloneProfile()) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Delete the user: " + userHandles.get(i).getIdentifier());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.settingslib.fuelgauge.BatterySaverUtils;
|
||||
|
||||
@@ -36,9 +37,9 @@ import com.android.settingslib.fuelgauge.BatterySaverUtils;
|
||||
* See {@link Settings.Global#AUTOMATIC_POWER_SAVE_MODE} for more details.
|
||||
*/
|
||||
public class BatterySaverScheduleRadioButtonsController {
|
||||
private static final String TAG = "BatterySaverScheduleRadioButtonsController";
|
||||
|
||||
public static final String KEY_NO_SCHEDULE = "key_battery_saver_no_schedule";
|
||||
public static final String KEY_ROUTINE = "key_battery_saver_routine";
|
||||
public static final String KEY_PERCENTAGE = "key_battery_saver_percentage";
|
||||
public static final int TRIGGER_LEVEL_MIN = 10;
|
||||
|
||||
@@ -53,20 +54,17 @@ public class BatterySaverScheduleRadioButtonsController {
|
||||
|
||||
public String getDefaultKey() {
|
||||
final ContentResolver resolver = mContext.getContentResolver();
|
||||
// Note: this can also be obtained via PowerManager.getPowerSaveModeTrigger()
|
||||
final int mode = Settings.Global.getInt(resolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
// if mode is "dynamic" we are in routine mode, percentage with non-zero threshold is
|
||||
// percentage mode, otherwise it is no schedule mode
|
||||
if (mode == PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE) {
|
||||
final int threshold =
|
||||
Settings.Global.getInt(resolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0);
|
||||
if (threshold <= 0) {
|
||||
return KEY_NO_SCHEDULE;
|
||||
}
|
||||
return KEY_PERCENTAGE;
|
||||
return threshold <= 0 ? KEY_NO_SCHEDULE : KEY_PERCENTAGE;
|
||||
}
|
||||
return KEY_ROUTINE;
|
||||
// Convert the legacy routine mode into none.
|
||||
BatterySaverUtils.revertScheduleToNoneIfNeeded(mContext);
|
||||
Log.w(TAG, "Found the legacy routine mode and set into none");
|
||||
return KEY_NO_SCHEDULE;
|
||||
}
|
||||
|
||||
public boolean setDefaultKey(String key) {
|
||||
@@ -89,12 +87,6 @@ public class BatterySaverScheduleRadioButtonsController {
|
||||
confirmationExtras.putInt(BatterySaverUtils.EXTRA_POWER_SAVE_MODE_TRIGGER_LEVEL,
|
||||
triggerLevel);
|
||||
break;
|
||||
case KEY_ROUTINE:
|
||||
mode = PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC;
|
||||
confirmationExtras.putBoolean(BatterySaverUtils.EXTRA_CONFIRM_TEXT_ONLY, true);
|
||||
confirmationExtras.putInt(BatterySaverUtils.EXTRA_POWER_SAVE_MODE_TRIGGER,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(
|
||||
"Not a valid key for " + this.getClass().getSimpleName());
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.Activity;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.ContentObserver;
|
||||
@@ -211,8 +212,10 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
||||
|
||||
private final OnPreferenceChangeListener mShowVirtualKeyboardSwitchPreferenceChangeListener =
|
||||
(preference, newValue) -> {
|
||||
Secure.putInt(getContentResolver(), Secure.SHOW_IME_WITH_HARD_KEYBOARD,
|
||||
((Boolean) newValue) ? 1 : 0);
|
||||
final ContentResolver cr = getContentResolver();
|
||||
Secure.putInt(cr, Secure.SHOW_IME_WITH_HARD_KEYBOARD, ((Boolean) newValue) ? 1 : 0);
|
||||
cr.notifyChange(Secure.getUriFor(Secure.SHOW_IME_WITH_HARD_KEYBOARD),
|
||||
null /* observer */, ContentResolver.NOTIFY_NO_DELAY);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
# Default reviewers for this and subdirectories.
|
||||
rni@google.com
|
||||
|
||||
# Emergency approvers in case the above are not available
|
||||
tmfang@google.com
|
||||
@@ -18,7 +18,6 @@ package com.android.settings.widget;
|
||||
|
||||
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
@@ -55,7 +54,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
private OnBeforeCheckedChangeListener mOnBeforeListener;
|
||||
|
||||
private String mMetricsTag;
|
||||
private int mMetricsCategory;
|
||||
|
||||
public SettingsMainSwitchBar(Context context) {
|
||||
this(context, null);
|
||||
@@ -125,12 +124,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
}
|
||||
|
||||
protected void onRestrictedIconClick() {
|
||||
mMetricsFeatureProvider.action(
|
||||
SettingsEnums.PAGE_UNKNOWN,
|
||||
SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
|
||||
SettingsEnums.PAGE_UNKNOWN,
|
||||
mMetricsTag + "/switch_bar|restricted",
|
||||
1);
|
||||
mMetricsFeatureProvider.clicked(mMetricsCategory, "switch_bar|restricted");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,8 +153,8 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
/**
|
||||
* Set the metrics tag.
|
||||
*/
|
||||
public void setMetricsTag(String tag) {
|
||||
mMetricsTag = tag;
|
||||
public void setMetricsCategory(int category) {
|
||||
mMetricsCategory = category;
|
||||
}
|
||||
|
||||
private View getDelegatingView() {
|
||||
@@ -168,11 +162,6 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
}
|
||||
|
||||
private void logMetrics(boolean isChecked) {
|
||||
mMetricsFeatureProvider.action(
|
||||
SettingsEnums.PAGE_UNKNOWN,
|
||||
SettingsEnums.ACTION_SETTINGS_PREFERENCE_CHANGE,
|
||||
SettingsEnums.PAGE_UNKNOWN,
|
||||
mMetricsTag + "/switch_bar",
|
||||
isChecked ? 1 : 0);
|
||||
mMetricsFeatureProvider.changed(mMetricsCategory, "switch_bar", isChecked ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class ProfileSelectDialogTest {
|
||||
|
||||
private static final UserHandle NORMAL_USER = new UserHandle(1111);
|
||||
private static final UserHandle REMOVED_USER = new UserHandle(2222);
|
||||
private static final UserHandle CLONE_USER = new UserHandle(3333);
|
||||
|
||||
@Spy
|
||||
private Context mContext = ApplicationProvider.getApplicationContext();
|
||||
@@ -101,6 +102,22 @@ public class ProfileSelectDialogTest {
|
||||
verify(mUserManager, times(2)).getUserInfo(REMOVED_USER.getIdentifier());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateUserHandlesIfNeeded_removesCloneProfile() {
|
||||
final UserInfo userInfo = new UserInfo(CLONE_USER.getIdentifier(), "clone_user", null,
|
||||
UserInfo.FLAG_PROFILE, UserManager.USER_TYPE_PROFILE_CLONE);
|
||||
when(mUserManager.getUserInfo(CLONE_USER.getIdentifier())).thenReturn(userInfo);
|
||||
final Tile tile = new ActivityTile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE);
|
||||
tile.userHandle.add(CLONE_USER);
|
||||
tile.userHandle.add(NORMAL_USER);
|
||||
|
||||
ProfileSelectDialog.updateUserHandlesIfNeeded(mContext, tile);
|
||||
|
||||
assertThat(tile.userHandle).hasSize(1);
|
||||
assertThat(tile.userHandle.get(0).getIdentifier()).isEqualTo(NORMAL_USER.getIdentifier());
|
||||
verify(mUserManager, times(1)).getUserInfo(CLONE_USER.getIdentifier());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createDialog_showsCorrectTitle() {
|
||||
mContext.setTheme(R.style.Theme_AppCompat);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
assertThat(mController.getDefaultKey())
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -73,14 +73,6 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setDefaultKey_any_defaultsToNoScheduleIfWarningNotSeen() {
|
||||
Secure.putString(
|
||||
mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, "null");
|
||||
mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
|
||||
assertThat(mController.getDefaultKey())
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setDefaultKey_percentage_shouldSuppressNotification() {
|
||||
@@ -95,17 +87,4 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
|
||||
assertThat(result).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setDefaultKey_routine_shouldSuppressNotification() {
|
||||
Secure.putInt(
|
||||
mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, 1);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
|
||||
|
||||
final int result = Settings.Secure.getInt(mResolver,
|
||||
Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
|
||||
assertThat(result).isEqualTo(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user