Merge "Don't wtf when rects are not available"
diff --git a/api/current.txt b/api/current.txt
index 4981c43..ef50a19 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -6566,7 +6566,7 @@
public static class AssistStructure.ViewNode {
method public float getAlpha();
- method public int getAutoFillHint();
+ method public java.lang.String[] getAutoFillHint();
method public android.view.autofill.AutofillId getAutofillId();
method public java.lang.String[] getAutofillOptions();
method public int getAutofillType();
@@ -25193,8 +25193,8 @@
method public void reportNetworkConnectivity(android.net.Network, boolean);
method public boolean requestBandwidthUpdate(android.net.Network);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
- method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+ method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
method public deprecated void setNetworkPreference(int);
@@ -39178,6 +39178,7 @@
method public android.os.PersistableBundle getConfigForSubId(int);
method public void notifyConfigChangedForSubId(int);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
+ field public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2; // 0xfffffffe
field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
field public static final java.lang.String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool";
field public static final java.lang.String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = "allow_add_call_during_video_call";
@@ -39220,6 +39221,8 @@
field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = "ci_action_on_sys_update_intent_string";
field public static final java.lang.String KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING = "config_ims_package_override_string";
field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
+ field public static final java.lang.String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long";
+ field public static final java.lang.String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long";
field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
field public static final java.lang.String KEY_DEFAULT_VM_NUMBER_STRING = "default_vm_number_string";
field public static final java.lang.String KEY_DIAL_STRING_REPLACE_STRING_ARRAY = "dial_string_replace_string_array";
@@ -39275,6 +39278,7 @@
field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
+ field public static final java.lang.String KEY_MONTHLY_DATA_CYCLE_DAY_INT = "monthly_data_cycle_day_int";
field public static final java.lang.String KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY = "only_single_dc_allowed_int_array";
field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
@@ -45098,7 +45102,7 @@
method public float getAlpha();
method public android.view.animation.Animation getAnimation();
method public android.os.IBinder getApplicationWindowToken();
- method public int getAutofillHint();
+ method public java.lang.String[] getAutofillHint();
method public int getAutofillMode();
method public int getAutofillType();
method public android.view.autofill.AutofillValue getAutofillValue();
@@ -45419,7 +45423,7 @@
method public void setActivated(boolean);
method public void setAlpha(float);
method public void setAnimation(android.view.animation.Animation);
- method public void setAutofillHint(int);
+ method public void setAutofillHint(java.lang.String[]);
method public void setAutofillMode(int);
method public void setBackground(android.graphics.drawable.Drawable);
method public void setBackgroundColor(int);
@@ -45562,20 +45566,19 @@
field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = 512; // 0x200
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = 4096; // 0x1000
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = 1024; // 0x400
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = 2048; // 0x800
- field public static final int AUTOFILL_HINT_CREDIT_CARD_NUMBER = 128; // 0x80
- field public static final int AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = 256; // 0x100
- field public static final int AUTOFILL_HINT_EMAIL_ADDRESS = 1; // 0x1
- field public static final int AUTOFILL_HINT_NAME = 2; // 0x2
- field public static final int AUTOFILL_HINT_NONE = 0; // 0x0
- field public static final int AUTOFILL_HINT_PASSWORD = 8; // 0x8
- field public static final int AUTOFILL_HINT_PHONE = 16; // 0x10
- field public static final int AUTOFILL_HINT_POSTAL_ADDRESS = 32; // 0x20
- field public static final int AUTOFILL_HINT_POSTAL_CODE = 64; // 0x40
- field public static final int AUTOFILL_HINT_USERNAME = 4; // 0x4
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
+ field public static final java.lang.String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
+ field public static final java.lang.String AUTOFILL_HINT_NAME = "name";
+ field public static final java.lang.String AUTOFILL_HINT_PASSWORD = "password";
+ field public static final java.lang.String AUTOFILL_HINT_PHONE = "phone";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
+ field public static final java.lang.String AUTOFILL_HINT_USERNAME = "username";
field public static final int AUTOFILL_MODE_AUTO = 1; // 0x1
field public static final int AUTOFILL_MODE_INHERIT = 0; // 0x0
field public static final int AUTOFILL_MODE_MANUAL = 2; // 0x2
@@ -46237,7 +46240,7 @@
method public abstract void setAccessibilityFocused(boolean);
method public abstract void setActivated(boolean);
method public abstract void setAlpha(float);
- method public abstract void setAutofillHint(int);
+ method public abstract void setAutofillHint(java.lang.String[]);
method public abstract void setAutofillOptions(java.lang.String[]);
method public abstract void setAutofillType(int);
method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
@@ -46248,6 +46251,7 @@
method public abstract void setClickable(boolean);
method public abstract void setContentDescription(java.lang.CharSequence);
method public abstract void setContextClickable(boolean);
+ method public abstract void setDataIsSensitive(boolean);
method public abstract void setDimens(int, int, int, int, int, int);
method public abstract void setElevation(float);
method public abstract void setEnabled(boolean);
@@ -46258,7 +46262,6 @@
method public abstract void setInputType(int);
method public abstract void setLongClickable(boolean);
method public abstract void setOpaque(boolean);
- method public abstract void setSanitized(boolean);
method public abstract void setSelected(boolean);
method public abstract void setText(java.lang.CharSequence);
method public abstract void setText(java.lang.CharSequence, int, int);
@@ -47533,6 +47536,10 @@
method public int getListValue();
method public java.lang.CharSequence getTextValue();
method public boolean getToggleValue();
+ method public boolean isDate();
+ method public boolean isList();
+ method public boolean isText();
+ method public boolean isToggle();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.view.autofill.AutofillValue> CREATOR;
}
diff --git a/api/system-current.txt b/api/system-current.txt
index fbfee83..1e62eb1 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6816,7 +6816,7 @@
public static class AssistStructure.ViewNode {
method public float getAlpha();
- method public int getAutoFillHint();
+ method public java.lang.String[] getAutoFillHint();
method public android.view.autofill.AutofillId getAutofillId();
method public java.lang.String[] getAutofillOptions();
method public int getAutofillType();
@@ -27312,8 +27312,8 @@
method public void reportNetworkConnectivity(android.net.Network, boolean);
method public boolean requestBandwidthUpdate(android.net.Network);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
- method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+ method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
method public deprecated void setNetworkPreference(int);
@@ -42536,6 +42536,7 @@
method public void notifyConfigChangedForSubId(int);
method public void updateConfigForPhoneId(int, java.lang.String);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
+ field public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2; // 0xfffffffe
field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
field public static final java.lang.String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool";
field public static final java.lang.String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = "allow_add_call_during_video_call";
@@ -42578,6 +42579,8 @@
field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = "ci_action_on_sys_update_intent_string";
field public static final java.lang.String KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING = "config_ims_package_override_string";
field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
+ field public static final java.lang.String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long";
+ field public static final java.lang.String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long";
field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
field public static final java.lang.String KEY_DEFAULT_VM_NUMBER_STRING = "default_vm_number_string";
field public static final java.lang.String KEY_DIAL_STRING_REPLACE_STRING_ARRAY = "dial_string_replace_string_array";
@@ -42633,6 +42636,7 @@
field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
+ field public static final java.lang.String KEY_MONTHLY_DATA_CYCLE_DAY_INT = "monthly_data_cycle_day_int";
field public static final java.lang.String KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY = "only_single_dc_allowed_int_array";
field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
@@ -48557,7 +48561,7 @@
method public float getAlpha();
method public android.view.animation.Animation getAnimation();
method public android.os.IBinder getApplicationWindowToken();
- method public int getAutofillHint();
+ method public java.lang.String[] getAutofillHint();
method public int getAutofillMode();
method public int getAutofillType();
method public android.view.autofill.AutofillValue getAutofillValue();
@@ -48878,7 +48882,7 @@
method public void setActivated(boolean);
method public void setAlpha(float);
method public void setAnimation(android.view.animation.Animation);
- method public void setAutofillHint(int);
+ method public void setAutofillHint(java.lang.String[]);
method public void setAutofillMode(int);
method public void setBackground(android.graphics.drawable.Drawable);
method public void setBackgroundColor(int);
@@ -49021,20 +49025,19 @@
field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = 512; // 0x200
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = 4096; // 0x1000
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = 1024; // 0x400
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = 2048; // 0x800
- field public static final int AUTOFILL_HINT_CREDIT_CARD_NUMBER = 128; // 0x80
- field public static final int AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = 256; // 0x100
- field public static final int AUTOFILL_HINT_EMAIL_ADDRESS = 1; // 0x1
- field public static final int AUTOFILL_HINT_NAME = 2; // 0x2
- field public static final int AUTOFILL_HINT_NONE = 0; // 0x0
- field public static final int AUTOFILL_HINT_PASSWORD = 8; // 0x8
- field public static final int AUTOFILL_HINT_PHONE = 16; // 0x10
- field public static final int AUTOFILL_HINT_POSTAL_ADDRESS = 32; // 0x20
- field public static final int AUTOFILL_HINT_POSTAL_CODE = 64; // 0x40
- field public static final int AUTOFILL_HINT_USERNAME = 4; // 0x4
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
+ field public static final java.lang.String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
+ field public static final java.lang.String AUTOFILL_HINT_NAME = "name";
+ field public static final java.lang.String AUTOFILL_HINT_PASSWORD = "password";
+ field public static final java.lang.String AUTOFILL_HINT_PHONE = "phone";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
+ field public static final java.lang.String AUTOFILL_HINT_USERNAME = "username";
field public static final int AUTOFILL_MODE_AUTO = 1; // 0x1
field public static final int AUTOFILL_MODE_INHERIT = 0; // 0x0
field public static final int AUTOFILL_MODE_MANUAL = 2; // 0x2
@@ -49696,7 +49699,7 @@
method public abstract void setAccessibilityFocused(boolean);
method public abstract void setActivated(boolean);
method public abstract void setAlpha(float);
- method public abstract void setAutofillHint(int);
+ method public abstract void setAutofillHint(java.lang.String[]);
method public abstract void setAutofillOptions(java.lang.String[]);
method public abstract void setAutofillType(int);
method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
@@ -49707,6 +49710,7 @@
method public abstract void setClickable(boolean);
method public abstract void setContentDescription(java.lang.CharSequence);
method public abstract void setContextClickable(boolean);
+ method public abstract void setDataIsSensitive(boolean);
method public abstract void setDimens(int, int, int, int, int, int);
method public abstract void setElevation(float);
method public abstract void setEnabled(boolean);
@@ -49717,7 +49721,6 @@
method public abstract void setInputType(int);
method public abstract void setLongClickable(boolean);
method public abstract void setOpaque(boolean);
- method public abstract void setSanitized(boolean);
method public abstract void setSelected(boolean);
method public abstract void setText(java.lang.CharSequence);
method public abstract void setText(java.lang.CharSequence, int, int);
@@ -50995,6 +50998,10 @@
method public int getListValue();
method public java.lang.CharSequence getTextValue();
method public boolean getToggleValue();
+ method public boolean isDate();
+ method public boolean isList();
+ method public boolean isText();
+ method public boolean isToggle();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.view.autofill.AutofillValue> CREATOR;
}
diff --git a/api/test-current.txt b/api/test-current.txt
index 3be7f67..185afcb 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -6593,7 +6593,7 @@
public static class AssistStructure.ViewNode {
method public float getAlpha();
- method public int getAutoFillHint();
+ method public java.lang.String[] getAutoFillHint();
method public android.view.autofill.AutofillId getAutofillId();
method public java.lang.String[] getAutofillOptions();
method public int getAutofillType();
@@ -25294,8 +25294,8 @@
method public void reportNetworkConnectivity(android.net.Network, boolean);
method public boolean requestBandwidthUpdate(android.net.Network);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback);
- method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
+ method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback);
method public void requestNetwork(android.net.NetworkRequest, int, android.net.ConnectivityManager.NetworkCallback, android.os.Handler);
method public void requestNetwork(android.net.NetworkRequest, android.app.PendingIntent);
method public deprecated void setNetworkPreference(int);
@@ -39367,6 +39367,7 @@
method public android.os.PersistableBundle getConfigForSubId(int);
method public void notifyConfigChangedForSubId(int);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
+ field public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2; // 0xfffffffe
field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
field public static final java.lang.String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool";
field public static final java.lang.String KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL = "allow_add_call_during_video_call";
@@ -39409,6 +39410,8 @@
field public static final java.lang.String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = "ci_action_on_sys_update_intent_string";
field public static final java.lang.String KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING = "config_ims_package_override_string";
field public static final java.lang.String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool";
+ field public static final java.lang.String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long";
+ field public static final java.lang.String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long";
field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string";
field public static final java.lang.String KEY_DEFAULT_VM_NUMBER_STRING = "default_vm_number_string";
field public static final java.lang.String KEY_DIAL_STRING_REPLACE_STRING_ARRAY = "dial_string_replace_string_array";
@@ -39464,6 +39467,7 @@
field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
+ field public static final java.lang.String KEY_MONTHLY_DATA_CYCLE_DAY_INT = "monthly_data_cycle_day_int";
field public static final java.lang.String KEY_ONLY_SINGLE_DC_ALLOWED_INT_ARRAY = "only_single_dc_allowed_int_array";
field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
@@ -45458,7 +45462,7 @@
method public float getAlpha();
method public android.view.animation.Animation getAnimation();
method public android.os.IBinder getApplicationWindowToken();
- method public int getAutofillHint();
+ method public java.lang.String[] getAutofillHint();
method public int getAutofillMode();
method public int getAutofillType();
method public android.view.autofill.AutofillValue getAutofillValue();
@@ -45782,7 +45786,7 @@
method public void setActivated(boolean);
method public void setAlpha(float);
method public void setAnimation(android.view.animation.Animation);
- method public void setAutofillHint(int);
+ method public void setAutofillHint(java.lang.String[]);
method public void setAutofillMode(int);
method public void setBackground(android.graphics.drawable.Drawable);
method public void setBackgroundColor(int);
@@ -45925,20 +45929,19 @@
field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
field public static final android.util.Property<android.view.View, java.lang.Float> ALPHA;
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = 512; // 0x200
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = 4096; // 0x1000
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = 1024; // 0x400
- field public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = 2048; // 0x800
- field public static final int AUTOFILL_HINT_CREDIT_CARD_NUMBER = 128; // 0x80
- field public static final int AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = 256; // 0x100
- field public static final int AUTOFILL_HINT_EMAIL_ADDRESS = 1; // 0x1
- field public static final int AUTOFILL_HINT_NAME = 2; // 0x2
- field public static final int AUTOFILL_HINT_NONE = 0; // 0x0
- field public static final int AUTOFILL_HINT_PASSWORD = 8; // 0x8
- field public static final int AUTOFILL_HINT_PHONE = 16; // 0x10
- field public static final int AUTOFILL_HINT_POSTAL_ADDRESS = 32; // 0x20
- field public static final int AUTOFILL_HINT_POSTAL_CODE = 64; // 0x40
- field public static final int AUTOFILL_HINT_USERNAME = 4; // 0x4
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
+ field public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
+ field public static final java.lang.String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
+ field public static final java.lang.String AUTOFILL_HINT_NAME = "name";
+ field public static final java.lang.String AUTOFILL_HINT_PASSWORD = "password";
+ field public static final java.lang.String AUTOFILL_HINT_PHONE = "phone";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
+ field public static final java.lang.String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
+ field public static final java.lang.String AUTOFILL_HINT_USERNAME = "username";
field public static final int AUTOFILL_MODE_AUTO = 1; // 0x1
field public static final int AUTOFILL_MODE_INHERIT = 0; // 0x0
field public static final int AUTOFILL_MODE_MANUAL = 2; // 0x2
@@ -46604,7 +46607,7 @@
method public abstract void setAccessibilityFocused(boolean);
method public abstract void setActivated(boolean);
method public abstract void setAlpha(float);
- method public abstract void setAutofillHint(int);
+ method public abstract void setAutofillHint(java.lang.String[]);
method public abstract void setAutofillOptions(java.lang.String[]);
method public abstract void setAutofillType(int);
method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
@@ -46615,6 +46618,7 @@
method public abstract void setClickable(boolean);
method public abstract void setContentDescription(java.lang.CharSequence);
method public abstract void setContextClickable(boolean);
+ method public abstract void setDataIsSensitive(boolean);
method public abstract void setDimens(int, int, int, int, int, int);
method public abstract void setElevation(float);
method public abstract void setEnabled(boolean);
@@ -46625,7 +46629,6 @@
method public abstract void setInputType(int);
method public abstract void setLongClickable(boolean);
method public abstract void setOpaque(boolean);
- method public abstract void setSanitized(boolean);
method public abstract void setSelected(boolean);
method public abstract void setText(java.lang.CharSequence);
method public abstract void setText(java.lang.CharSequence, int, int);
@@ -47902,6 +47905,10 @@
method public int getListValue();
method public java.lang.CharSequence getTextValue();
method public boolean getToggleValue();
+ method public boolean isDate();
+ method public boolean isList();
+ method public boolean isText();
+ method public boolean isToggle();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.view.autofill.AutofillValue> CREATOR;
}
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index fa64a0f..b36b664 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -25,6 +25,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.service.voice.IVoiceInteractionSession;
+import android.util.SparseIntArray;
import com.android.internal.app.IVoiceInteractor;
@@ -47,9 +48,9 @@
/**
* Type for {@link #notifyAppTransitionStarting}: The transition was started because we drew
- * the starting window.
+ * the splash screen.
*/
- public static final int APP_TRANSITION_STARTING_WINDOW = 1;
+ public static final int APP_TRANSITION_SPLASH_SCREEN = 1;
/**
* Type for {@link #notifyAppTransitionStarting}: The transition was started because we all
@@ -64,6 +65,12 @@
public static final int APP_TRANSITION_TIMEOUT = 3;
/**
+ * Type for {@link #notifyAppTransitionStarting}: The transition was started because of a
+ * we drew a task snapshot.
+ */
+ public static final int APP_TRANSITION_SNAPSHOT = 4;
+
+ /**
* Grant Uri permissions from one app to another. This method only extends
* permission grants if {@code callingUid} has permission to them.
*/
@@ -122,19 +129,13 @@
IVoiceInteractor mInteractor);
/**
- * Callback for window manager to let activity manager know that the starting window has been
- * drawn
- */
- public abstract void notifyStartingWindowDrawn();
-
- /**
* Callback for window manager to let activity manager know that we are finally starting the
* app transition;
*
- * @param reason The reason why the app transition started. Must be one of the APP_TRANSITION_*
- * values.
+ * @param reasons A map from stack id to a reason integer why the transition was started,, which
+ * must be one of the APP_TRANSITION_* values.
*/
- public abstract void notifyAppTransitionStarting(int reason);
+ public abstract void notifyAppTransitionStarting(SparseIntArray reasons);
/**
* Callback for window manager to let activity manager know that the app transition was
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index a512350..21a7ca7 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -28,6 +28,7 @@
import android.transition.TransitionSet;
import android.transition.Visibility;
import android.util.ArrayMap;
+import android.util.ArraySet;
import android.view.GhostView;
import android.view.View;
import android.view.ViewGroup;
@@ -394,6 +395,60 @@
return transition;
}
+ /**
+ * Looks through the transition to see which Views have been included and which have been
+ * excluded. {@code views} will be modified to contain only those Views that are included
+ * in the transition. If {@code transition} is a TransitionSet, it will search through all
+ * contained Transitions to find targeted Views.
+ *
+ * @param transition The transition to look through for inclusion of Views
+ * @param views The list of Views that are to be checked for inclusion. Will be modified
+ * to remove all excluded Views, possibly leaving an empty list.
+ */
+ protected static void removeExcludedViews(Transition transition, ArrayList<View> views) {
+ ArraySet<View> included = new ArraySet<>();
+ findIncludedViews(transition, views, included);
+ views.clear();
+ views.addAll(included);
+ }
+
+ /**
+ * Looks through the transition to see which Views have been included. Only {@code views}
+ * will be examined for inclusion. If {@code transition} is a TransitionSet, it will search
+ * through all contained Transitions to find targeted Views.
+ *
+ * @param transition The transition to look through for inclusion of Views
+ * @param views The list of Views that are to be checked for inclusion.
+ * @param included Modified to contain all Views in views that have at least one Transition
+ * that affects it.
+ */
+ private static void findIncludedViews(Transition transition, ArrayList<View> views,
+ ArraySet<View> included) {
+ if (transition instanceof TransitionSet) {
+ TransitionSet set = (TransitionSet) transition;
+ ArrayList<View> includedViews = new ArrayList<>();
+ final int numViews = views.size();
+ for (int i = 0; i < numViews; i++) {
+ final View view = views.get(i);
+ if (transition.isValidTarget(view)) {
+ includedViews.add(view);
+ }
+ }
+ final int count = set.getTransitionCount();
+ for (int i = 0; i < count; i++) {
+ findIncludedViews(set.getTransitionAt(i), includedViews, included);
+ }
+ } else {
+ final int numViews = views.size();
+ for (int i = 0; i < numViews; i++) {
+ final View view = views.get(i);
+ if (transition.isValidTarget(view)) {
+ included.add(view);
+ }
+ }
+ }
+ }
+
protected static Transition mergeTransitions(Transition transition1, Transition transition2) {
if (transition1 == null) {
return transition2;
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 445b687..ab847fd 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -132,7 +132,9 @@
super.viewsReady(sharedElements);
mIsReadyForTransition = true;
hideViews(mSharedElements);
- if (getViewsTransition() != null && mTransitioningViews != null) {
+ Transition viewsTransition = getViewsTransition();
+ if (viewsTransition != null && mTransitioningViews != null) {
+ removeExcludedViews(viewsTransition, mTransitioningViews);
stripOffscreenViews();
hideViews(mTransitioningViews);
}
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 29e10d8..df31da9 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -321,6 +321,10 @@
Transition viewsTransition = null;
if (mTransitioningViews != null && !mTransitioningViews.isEmpty()) {
viewsTransition = configureTransition(getViewsTransition(), true);
+ removeExcludedViews(viewsTransition, mTransitioningViews);
+ if (mTransitioningViews.isEmpty()) {
+ viewsTransition = null;
+ }
}
if (viewsTransition == null) {
viewsTransitionComplete();
diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java
index 1f2ed00..b1fbc8f 100644
--- a/core/java/android/app/assist/AssistStructure.java
+++ b/core/java/android/app/assist/AssistStructure.java
@@ -1,5 +1,6 @@
package android.app.assist;
+import android.annotation.Nullable;
import android.app.Activity;
import android.content.ComponentName;
import android.graphics.Matrix;
@@ -590,7 +591,7 @@
// fields (viewId and childId) of the field.
AutofillId mAutofillId;
@View.AutofillType int mAutofillType;
- @View.AutofillHint int mAutofillHint;
+ @Nullable String[] mAutofillHint;
AutofillValue mAutofillValue;
String[] mAutofillOptions;
boolean mSanitized;
@@ -676,7 +677,7 @@
mSanitized = in.readInt() == 1;
mAutofillId = in.readParcelable(null);
mAutofillType = in.readInt();
- mAutofillHint = in.readInt();
+ mAutofillHint = in.readStringArray();
mAutofillValue = in.readParcelable(null);
mAutofillOptions = in.readStringArray();
}
@@ -810,7 +811,7 @@
out.writeInt(mSanitized ? 1 : 0);
out.writeParcelable(mAutofillId, 0);
out.writeInt(mAutofillType);
- out.writeInt(mAutofillHint);
+ out.writeStringArray(mAutofillHint);
final AutofillValue sanitizedValue = writeSensitive ? mAutofillValue : null;
out.writeParcelable(sanitizedValue, 0);
out.writeStringArray(mAutofillOptions);
@@ -949,7 +950,7 @@
*
* @return The hint for this view
*/
- @View.AutofillHint public int getAutoFillHint() {
+ @Nullable public String[] getAutoFillHint() {
return mAutofillHint;
}
@@ -1012,9 +1013,8 @@
mAutofillValue = value;
// TODO(b/33197203, b/33802548): decide whether to set text as well (so it would work
// with "legacy" views) or just the autofill value
- final CharSequence text = value.getTextValue();
- if (text != null) {
- mText.mText = text;
+ if (value.isText()) {
+ mText.mText = value.getTextValue();
}
}
@@ -1663,7 +1663,7 @@
}
@Override
- public void setAutofillHint(@View.AutofillHint int hint) {
+ public void setAutofillHint(@Nullable String[] hint) {
mNode.mAutofillHint = hint;
}
@@ -1683,8 +1683,8 @@
}
@Override
- public void setSanitized(boolean sanitized) {
- mNode.mSanitized = sanitized;
+ public void setDataIsSensitive(boolean sensitive) {
+ mNode.mSanitized = !sensitive;
}
@Override
@@ -1812,7 +1812,7 @@
+ ", type=" + node.getAutofillType()
+ ", options=" + Arrays.toString(node.getAutofillOptions())
+ ", inputType=" + node.getInputType()
- + ", hint=" + Integer.toHexString(node.getAutoFillHint())
+ + ", hint=" + Arrays.toString(node.getAutoFillHint())
+ ", value=" + node.getAutofillValue()
+ ", sanitized=" + node.isSanitized());
}
diff --git a/core/java/android/os/storage/StorageVolume.java b/core/java/android/os/storage/StorageVolume.java
index 46f2d38..1fc0b82 100644
--- a/core/java/android/os/storage/StorageVolume.java
+++ b/core/java/android/os/storage/StorageVolume.java
@@ -373,8 +373,7 @@
}
/** {@hide} */
- // TODO(b/26742218): find out where toString() is called internally and replace these calls by
- // dump().
+ // TODO: find out where toString() is called internally and replace these calls by dump().
public String dump() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " ", 80));
diff --git a/core/java/android/preference/Preference.java b/core/java/android/preference/Preference.java
index d5de660..d9c749a 100644
--- a/core/java/android/preference/Preference.java
+++ b/core/java/android/preference/Preference.java
@@ -457,8 +457,8 @@
}
/**
- * Return the extras Bundle object associated with this preference,
- * returning null if there is not currently one.
+ * Return the extras Bundle object associated with this preference, returning {@code null} if
+ * there is not currently one.
*/
public Bundle peekExtras() {
return mExtras;
@@ -996,7 +996,7 @@
* the persistent {@link SharedPreferences} storage by default or into
* {@link PreferenceDataStore} if assigned.
*
- * @param persistent Set true if it should store its value(s) into the {@link SharedPreferences}.
+ * @param persistent set {@code true} if it should store its value(s) into the storage.
*/
public void setPersistent(boolean persistent) {
mPersistent = persistent;
@@ -1057,7 +1057,7 @@
*
* @param preferenceScreen A {@link PreferenceScreen} whose hierarchy click
* listener should be called in the proper order (between other
- * processing). May be null.
+ * processing). May be {@code null}.
* @hide
*/
public void performClick(PreferenceScreen preferenceScreen) {
@@ -1124,9 +1124,9 @@
* {@link SharedPreferences}, this is intended behavior to improve
* performance.
*
- * @return The {@link SharedPreferences} where this Preference reads its value(s), or null if it
- * isn't attached to a Preference hierarchy or if {@link PreferenceDataStore} is used
- * instead.
+ * @return the {@link SharedPreferences} where this Preference reads its value(s). If
+ * this preference isn't attached to a Preference hierarchy or if
+ * a {@link PreferenceDataStore} has been set, this method returns {@code null}.
* @see #getEditor()
* @see #setPreferenceDataStore(PreferenceDataStore)
*/
@@ -1151,9 +1151,9 @@
* not show up in the SharedPreferences, this is intended behavior to
* improve performance.
*
- * @return A {@link SharedPreferences.Editor} where this preference saves its value(s), or null
- * if it isn't attached to a Preference hierarchy or if {@link PreferenceDataStore} is
- * used instead.
+ * @return a {@link SharedPreferences.Editor} where this preference saves its value(s). If
+ * this preference isn't attached to a Preference hierarchy or if
+ * a {@link PreferenceDataStore} has been set, this method returns {@code null}.
* @see #shouldCommit()
* @see #getSharedPreferences()
* @see #setPreferenceDataStore(PreferenceDataStore)
@@ -1171,7 +1171,7 @@
* {@link #getEditor()}. This may return false in situations where batch
* committing is being done (by the manager) to improve performance.
*
- * <p>If this preference is using {@link PreferenceDataStore} this value should be irrelevant.
+ * <p>If this preference is using {@link PreferenceDataStore} this value is irrelevant.
*
* @return Whether the Preference should commit its saved value(s).
* @see #getEditor()
@@ -1275,10 +1275,10 @@
}
/**
- * Assigns a {@link PreferenceGroup} as the parent of this Preference. Set null to remove
- * the current parent.
+ * Assigns a {@link PreferenceGroup} as the parent of this Preference. Set {@code null} to
+ * remove the current parent.
*
- * @param parentGroup Parent preference group of this Preference or null if none.
+ * @param parentGroup Parent preference group of this Preference or {@code null} if none.
*/
void assignParent(@Nullable PreferenceGroup parentGroup) {
mParentGroup = parentGroup;
@@ -1447,10 +1447,10 @@
}
/**
- * Returns the {@link PreferenceGroup} which is this Preference assigned to or null if this
- * preference is not assigned to any group or is a root Preference.
+ * Returns the {@link PreferenceGroup} which is this Preference assigned to or {@code null} if
+ * this preference is not assigned to any group or is a root Preference.
*
- * @return The parent PreferenceGroup or null if not attached to any.
+ * @return the parent PreferenceGroup or {@code null} if not attached to any
*/
@Nullable
public PreferenceGroup getParent() {
@@ -1505,7 +1505,7 @@
* if {@link #shouldPersist()} is true).
*
* <p>In case of using {@link PreferenceDataStore}, the <var>restorePersistedValue</var> is
- * always false. But the default value (if provided) is set.
+ * always {@code true}. But the default value (if provided) is set.
*
* <p>This may not always be called. One example is if it should not persist
* but there is no default value given.
@@ -1928,9 +1928,9 @@
* state. This state should only contain information that is not persistent
* or can be reconstructed later.
*
- * @return A Parcelable object containing the current dynamic state of
- * this Preference, or null if there is nothing interesting to save.
- * The default implementation returns null.
+ * @return A Parcelable object containing the current dynamic state of this Preference, or
+ * {@code null} if there is nothing interesting to save. The default implementation
+ * returns {@code null}.
* @see #onRestoreInstanceState
* @see #saveHierarchyState
*/
@@ -1976,9 +1976,9 @@
}
/**
- * Hook allowing a Preference to re-apply a representation of its internal
- * state that had previously been generated by {@link #onSaveInstanceState}.
- * This function will never be called with a null state.
+ * Hook allowing a Preference to re-apply a representation of its internal state that had
+ * previously been generated by {@link #onSaveInstanceState}. This function will never be called
+ * with a {@code null} state.
*
* @param state The saved state that had previously been returned by
* {@link #onSaveInstanceState}.
diff --git a/core/java/android/preference/PreferenceManager.java b/core/java/android/preference/PreferenceManager.java
index 14b748a..ea32dfd 100644
--- a/core/java/android/preference/PreferenceManager.java
+++ b/core/java/android/preference/PreferenceManager.java
@@ -93,8 +93,8 @@
private SharedPreferences mSharedPreferences;
/**
- * Data store to be used by the Preferences or null if {@link android.content.SharedPreferences}
- * should be used.
+ * Data store to be used by the Preferences or {@code null} if
+ * {@link android.content.SharedPreferences} should be used.
*/
@Nullable
private PreferenceDataStore mPreferenceDataStore;
@@ -484,11 +484,16 @@
/**
* Gets a {@link SharedPreferences} instance that preferences managed by this will use.
*
- * @return A {@link SharedPreferences} instance pointing to the file that contains the values of
- * preferences that are managed by this or null if {@link PreferenceDataStore} is used instead.
+ * @return a {@link SharedPreferences} instance pointing to the file that contains the values of
+ * preferences that are managed by this PreferenceManager. If a
+ * {@link PreferenceDataStore} has been set, this method returns {@code null}.
*/
public SharedPreferences getSharedPreferences() {
- if (mSharedPreferences == null && getPreferenceDataStore() == null) {
+ if (mPreferenceDataStore != null) {
+ return null;
+ }
+
+ if (mSharedPreferences == null) {
final Context storageContext;
switch (mStorage) {
case STORAGE_DEVICE_PROTECTED:
@@ -564,8 +569,8 @@
/**
* Finds a {@link Preference} based on its key.
*
- * @param key The key of the preference to retrieve.
- * @return The {@link Preference} with the key, or null.
+ * @param key the key of the preference to retrieve
+ * @return the {@link Preference} with the key, or {@code null}
* @see PreferenceGroup#findPreference(CharSequence)
*/
@Nullable
@@ -659,11 +664,11 @@
/**
* Returns an editor to use when modifying the shared preferences.
- * <p>
- * Do NOT commit unless {@link #shouldCommit()} returns true.
*
- * @return An editor to use to write to shared preferences or null if
- * {@link PreferenceDataStore} is used instead.
+ * <p>Do NOT commit unless {@link #shouldCommit()} returns true.
+ *
+ * @return an editor to use to write to shared preferences. If a {@link PreferenceDataStore}
+ * has been set, this method returns {@code null}.
* @see #shouldCommit()
*/
SharedPreferences.Editor getEditor() {
@@ -687,6 +692,8 @@
* {@link #getEditor()}. This will return false in cases where the writes
* should be batched, for example when inflating preferences from XML.
*
+ * <p>If preferences are using {@link PreferenceDataStore} this value is irrelevant.
+ *
* @return Whether the client should commit.
*/
boolean shouldCommit() {
@@ -711,8 +718,8 @@
* Returns the activity that shows the preferences. This is useful for doing
* managed queries, but in most cases the use of {@link #getContext()} is
* preferred.
- * <p>
- * This will return null if this class was instantiated with a Context
+ *
+ * <p>This will return {@code null} if this class was instantiated with a Context
* instead of Activity. For example, when setting the default values.
*
* @return The activity that shows the preferences.
diff --git a/core/java/android/provider/DocumentsContract.java b/core/java/android/provider/DocumentsContract.java
index f53b0d7..56d4ff7 100644
--- a/core/java/android/provider/DocumentsContract.java
+++ b/core/java/android/provider/DocumentsContract.java
@@ -1563,7 +1563,7 @@
if (resolver.getTargetSdkVersion() >= Build.VERSION_CODES.O) {
if (e instanceof ParcelableException) {
((ParcelableException) e).maybeRethrow(FileNotFoundException.class);
- } else if (e instanceof RemoteException ) {
+ } else if (e instanceof RemoteException) {
((RemoteException) e).rethrowAsRuntimeException();
} else if (e instanceof RuntimeException) {
throw (RuntimeException) e;
diff --git a/core/java/android/service/autofill/AutofillServiceInfo.java b/core/java/android/service/autofill/AutofillServiceInfo.java
index d220052..f6d40db 100644
--- a/core/java/android/service/autofill/AutofillServiceInfo.java
+++ b/core/java/android/service/autofill/AutofillServiceInfo.java
@@ -78,14 +78,12 @@
// TODO(b/35956626): inline newSettingsActivity once clients migrate
final String newSettingsActivity =
metaDataArray.getString(R.styleable.AutofillService_settingsActivity);
- System.out.println(">>> NEW CRAP MAN: " + newSettingsActivity); // TODO(felipeal): tmp
if (newSettingsActivity != null) {
mSettingsActivity = newSettingsActivity;
} else {
mSettingsActivity =
metaDataArray.getString(R.styleable.AutoFillService_settingsActivity);
}
- System.out.println(">>> FINAL CRAP MAN: " + mSettingsActivity); // TODO(felipeal): tmp
metaDataArray.recycle();
} else {
mSettingsActivity = null;
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 94c463c..353dfed 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -1031,6 +1031,7 @@
float avail, TextUtils.TruncateAt where,
int line, float textWidth, TextPaint paint,
boolean forceEllipsis) {
+ avail -= getTotalInsets(line);
if (textWidth <= avail && !forceEllipsis) {
// Everything fits!
mLines[mColumns * line + ELLIPSIS_START] = 0;
@@ -1134,6 +1135,17 @@
mLines[mColumns * line + ELLIPSIS_COUNT] = ellipsisCount;
}
+ private float getTotalInsets(int line) {
+ int totalIndent = 0;
+ if (mLeftIndents != null) {
+ totalIndent = mLeftIndents[Math.min(line, mLeftIndents.length - 1)];
+ }
+ if (mRightIndents != null) {
+ totalIndent += mRightIndents[Math.min(line, mRightIndents.length - 1)];
+ }
+ return totalIndent;
+ }
+
// Override the base class so we can directly access our members,
// rather than relying on member functions.
// The logic mirrors that of Layout.getLineForVertical
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java
index af2547e..255a029 100644
--- a/core/java/android/transition/Transition.java
+++ b/core/java/android/transition/Transition.java
@@ -799,8 +799,10 @@
* targetId list. If the target parameter is null, then the target list
* is not checked (this is in the case of ListView items, where the
* views are ignored and only the ids are used).
+ *
+ * @hide
*/
- boolean isValidTarget(View target) {
+ public boolean isValidTarget(View target) {
if (target == null) {
return false;
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 029caf9..80f6c32 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -978,142 +978,123 @@
*/
public static final int AUTOFILL_MODE_MANUAL = 2;
- /** @hide */
- @IntDef({
- AUTOFILL_HINT_NONE,
- AUTOFILL_HINT_EMAIL_ADDRESS,
- AUTOFILL_HINT_NAME,
- AUTOFILL_HINT_POSTAL_ADDRESS,
- AUTOFILL_HINT_PASSWORD,
- AUTOFILL_HINT_PHONE,
- AUTOFILL_HINT_USERNAME,
- AUTOFILL_HINT_POSTAL_CODE,
- AUTOFILL_HINT_CREDIT_CARD_NUMBER,
- AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE,
- AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE,
- AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH,
- AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR,
- AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY,
- })
- @Retention(RetentionPolicy.SOURCE)
- public @interface AutofillHint {}
-
- /**
- * No autofill hint is set.
- *
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
- */
- public static final int AUTOFILL_HINT_NONE = 0;
-
/**
* This view contains an email address.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_EMAIL_ADDRESS}"
+ * to <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_EMAIL_ADDRESS = 0x1;
+ public static final String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";
/**
* The view contains a real name.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_NAME}" to
+ * <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_NAME = 0x2;
+ public static final String AUTOFILL_HINT_NAME = "name";
/**
* The view contains a user name.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_USERNAME}" to
+ * <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_USERNAME = 0x4;
+ public static final String AUTOFILL_HINT_USERNAME = "username";
/**
* The view contains a password.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_PASSWORD}" to
+ * <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_PASSWORD = 0x8;
+ public static final String AUTOFILL_HINT_PASSWORD = "password";
/**
* The view contains a phone number.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_PHONE}" to
+ * <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_PHONE = 0x10;
+ public static final String AUTOFILL_HINT_PHONE = "phone";
/**
* The view contains a postal address.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_POSTAL_ADDRESS}"
+ * to <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_POSTAL_ADDRESS = 0x20;
+ public static final String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";
/**
* The view contains a postal code.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value #AUTOFILL_HINT_POSTAL_CODE}" to
+ * <a href="#attr_android:autofillHint"> {@code android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_POSTAL_CODE = 0x40;
+ public static final String AUTOFILL_HINT_POSTAL_CODE = "postalCode";
/**
* The view contains a credit card number.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_NUMBER}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_NUMBER = 0x80;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";
/**
* The view contains a credit card security code.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = 0x100;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";
/**
* The view contains a credit card expiration date.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = 0x200;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE =
+ "creditCardExpirationDate";
/**
* The view contains the month a credit card expires.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = 0x400;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH =
+ "creditCardExpirationMonth";
/**
* The view contains the year a credit card expires.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = 0x800;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR =
+ "creditCardExpirationYear";
/**
* The view contains the day a credit card expires.
*
- * Use with {@link #setAutofillHint(int)} and <a href="#attr_android:autofillHint">
- * {@code android:autofillHint}.
+ * Use with {@link #setAutofillHint(String[])}, or set "{@value
+ * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY}" to <a href="#attr_android:autofillHint"> {@code
+ * android:autofillHint}.
*/
- public static final int AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = 0x1000;
+ public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";
/**
- * Hint for the autofill services that describes the content of the view.
+ * Hintd for the autofill services that describes the content of the view.
*/
- @AutofillHint private int mAutofillHint;
+ private @Nullable String[] mAutofillHint;
/** @hide */
@IntDef({
@@ -5049,7 +5030,37 @@
break;
case R.styleable.View_autofillHint:
if (a.peekValue(attr) != null) {
- setAutofillHint(a.getInt(attr, AUTOFILL_HINT_NONE));
+ CharSequence[] rawHints = null;
+ String rawString = null;
+
+ if (a.getType(attr) == TypedValue.TYPE_REFERENCE) {
+ int resId = a.getResourceId(attr, 0);
+
+ try {
+ rawHints = a.getTextArray(attr);
+ } catch (NullPointerException e) {
+ rawString = getResources().getString(resId);
+ }
+ } else {
+ rawString = a.getString(attr);
+ }
+
+ if (rawHints == null) {
+ if (rawString == null) {
+ throw new IllegalArgumentException(
+ "Could not resolve autofillHint");
+ } else {
+ rawHints = rawString.split(",");
+ }
+ }
+
+ String[] hints = new String[rawHints.length];
+
+ int numHints = rawHints.length;
+ for (int rawHintNum = 0; rawHintNum < numHints; rawHintNum++) {
+ hints[rawHintNum] = rawHints[rawHintNum].toString().trim();
+ }
+ setAutofillHint(hints);
}
break;
case R.styleable.View_importantForAutofill:
@@ -7257,9 +7268,10 @@
* Called when assist structure is being retrieved from a view as part of an autofill request.
*
* <p>This method already provides most of what's needed for autofill, but should be overridden
+ * when:
* <ol>
* <li>The view contents does not include PII (Personally Identifiable Information), so it
- * can call {@link ViewStructure#setSanitized(boolean)} passing {@code true}.
+ * can call {@link ViewStructure#setDataIsSensitive(boolean)} passing {@code false}.
* <li>It must set fields such {@link ViewStructure#setText(CharSequence)},
* {@link ViewStructure#setAutofillOptions(String[])}, or {@link ViewStructure#setUrl(String)}.
* </ol>
@@ -7464,12 +7476,12 @@
/**
* Describes the content of a view so that a autofill service can fill in the appropriate data.
*
- * @return The hint set via the attribute
+ * @return The hint set via the attribute or {@code null} if no hint it set.
*
* @attr ref android.R.styleable#View_autofillHint
*/
@ViewDebug.ExportedProperty()
- @AutofillHint public int getAutofillHint() {
+ @Nullable public String[] getAutofillHint() {
return mAutofillHint;
}
@@ -9099,11 +9111,15 @@
* Sets the a hint that helps the autofill service to select the appropriate data to fill the
* view.
*
- * @param autofillHint The autofill hint to set
+ * @param autofillHint The autofill hint to set. If the array is emtpy, {@code null} is set.
* @attr ref android.R.styleable#View_autofillHint
*/
- public void setAutofillHint(@AutofillHint int autofillHint) {
- mAutofillHint = autofillHint;
+ public void setAutofillHint(@Nullable String... autofillHint) {
+ if (autofillHint == null || autofillHint.length == 0) {
+ mAutofillHint = null;
+ } else {
+ mAutofillHint = autofillHint;
+ }
}
/**
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index bccaca2..a71b899 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -16,6 +16,7 @@
package android.view;
+import android.annotation.Nullable;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.os.Bundle;
@@ -323,7 +324,7 @@
* Sets the a hint that helps the autofill service to select the appropriate data to fill the
* view.
*/
- public abstract void setAutofillHint(@View.AutofillHint int hint);
+ public abstract void setAutofillHint(@Nullable String[] hint);
/**
* Sets the {@link AutofillValue} representing the current value of this node.
@@ -346,19 +347,27 @@
public abstract void setInputType(int inputType);
/**
- * Marks this node as sanitized so its content are sent on {@link
+ * Sets whether the data on this node is sensitive; if it is, then its content (text, autofill
+ * value, etc..) is striped before calls to {@link
* android.service.autofill.AutofillService#onFillRequest(android.app.assist.AssistStructure,
* Bundle, android.os.CancellationSignal, android.service.autofill.FillCallback)}.
*
- * <p>Only nodes that does not have PII (Personally Identifiable Information - sensitive data
- * such as email addresses, credit card numbers, passwords, etc...) should be marked
- * as sanitized; a good rule of thumb is to mark as sanitized nodes whose value were statically
- * set from resources.
+ * <p>By default, all nodes are assumed to be sensitive, and only nodes that does not have PII
+ * (Personally Identifiable Information - sensitive data such as email addresses, credit card
+ * numbers, passwords, etc...) should be marked as non-sensitive; a good rule of thumb is to
+ * mark as non-sensitive nodes whose value were statically set from resources.
+ *
+ * <p>Notice that the content of even sensitive nodes are sent to the service (through the
+ * {@link
+ * android.service.autofill.AutofillService#onSaveRequest(android.app.assist.AssistStructure,
+ * Bundle, android.service.autofill.SaveCallback)} call) when the user consented to save the
+ * data, so it is important to set the content of sensitive nodes as well, but mark them as
+ * sensitive.
*
* <p>Should only be set when the node is used for autofill purposes - it will be ignored
* when used for Assist.
*/
- public abstract void setSanitized(boolean sanitized);
+ public abstract void setDataIsSensitive(boolean sensitive);
/**
* Call when done populating a {@link ViewStructure} returned by
diff --git a/core/java/android/view/autofill/AutofillValue.java b/core/java/android/view/autofill/AutofillValue.java
index 0c7620e..9babb59 100644
--- a/core/java/android/view/autofill/AutofillValue.java
+++ b/core/java/android/view/autofill/AutofillValue.java
@@ -16,13 +16,22 @@
package android.view.autofill;
+import static android.view.View.AUTOFILL_TYPE_DATE;
+import static android.view.View.AUTOFILL_TYPE_LIST;
+import static android.view.View.AUTOFILL_TYPE_TEXT;
+import static android.view.View.AUTOFILL_TYPE_TOGGLE;
import static android.view.autofill.Helper.DEBUG;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
+import com.android.internal.util.Preconditions;
+
+import java.util.Objects;
+
/**
* Abstracts how a {@link View} can be autofilled by an
* {@link android.service.autofill.AutofillService}.
@@ -31,52 +40,96 @@
* {@link View#getAutofillType()}.
*/
public final class AutofillValue implements Parcelable {
- private final String mText;
- private final int mListIndex;
- private final boolean mToggle;
- private final long mDate;
+ private final @View.AutofillType int mType;
+ private final @NonNull Object mValue;
- private AutofillValue(CharSequence text, int listIndex, boolean toggle, long date) {
- mText = (text == null) ? null : text.toString();
- mListIndex = listIndex;
- mToggle = toggle;
- mDate = date;
+ private AutofillValue(@View.AutofillType int type, @NonNull Object value) {
+ mType = type;
+ mValue = value;
}
/**
* Gets the value to autofill a text field.
*
- * <p>See {@link View#AUTOFILL_TYPE_TEXT} for more info.
+ * <p>See {@link View#AUTOFILL_TYPE_TEXT} for more info.</p>
+ *
+ * @throws IllegalStateException if the value is not a text value
*/
- public CharSequence getTextValue() {
- return mText;
+ @NonNull public CharSequence getTextValue() {
+ Preconditions.checkState(isText(), "value must be a text value, not type=" + mType);
+ return (CharSequence) mValue;
+ }
+
+ /**
+ * Checks is this is a text value.
+ *
+ * <p>See {@link View#AUTOFILL_TYPE_TEXT} for more info.</p>
+ */
+ public boolean isText() {
+ return mType == AUTOFILL_TYPE_TEXT;
}
/**
* Gets the value to autofill a toggable field.
*
- * <p>See {@link View#AUTOFILL_TYPE_TOGGLE} for more info.
+ * <p>See {@link View#AUTOFILL_TYPE_TOGGLE} for more info.</p>
+ *
+ * @throws IllegalStateException if the value is not a toggle value
*/
public boolean getToggleValue() {
- return mToggle;
+ Preconditions.checkState(isToggle(), "value must be a toggle value, not type=" + mType);
+ return (Boolean) mValue;
+ }
+
+ /**
+ * Checks is this is a toggle value.
+ *
+ * <p>See {@link View#AUTOFILL_TYPE_TOGGLE} for more info.</p>
+ */
+ public boolean isToggle() {
+ return mType == AUTOFILL_TYPE_TOGGLE;
}
/**
* Gets the value to autofill a selection list field.
*
- * <p>See {@link View#AUTOFILL_TYPE_LIST} for more info.
+ * <p>See {@link View#AUTOFILL_TYPE_LIST} for more info.</p>
+ *
+ * @throws IllegalStateException if the value is not a list value
*/
public int getListValue() {
- return mListIndex;
+ Preconditions.checkState(isList(), "value must be a list value, not type=" + mType);
+ return (Integer) mValue;
+ }
+
+ /**
+ * Checks is this is a list value.
+ *
+ * <p>See {@link View#AUTOFILL_TYPE_LIST} for more info.</p>
+ */
+ public boolean isList() {
+ return mType == AUTOFILL_TYPE_LIST;
}
/**
* Gets the value to autofill a date field.
*
- * <p>See {@link View#AUTOFILL_TYPE_DATE} for more info.
+ * <p>See {@link View#AUTOFILL_TYPE_DATE} for more info.</p>
+ *
+ * @throws IllegalStateException if the value is not a date value
*/
public long getDateValue() {
- return mDate;
+ Preconditions.checkState(isDate(), "value must be a date value, not type=" + mType);
+ return (Long) mValue;
+ }
+
+ /**
+ * Checks is this is a date value.
+ *
+ * <p>See {@link View#AUTOFILL_TYPE_DATE} for more info.</p>
+ */
+ public boolean isDate() {
+ return mType == AUTOFILL_TYPE_DATE;
}
/////////////////////////////////////
@@ -85,13 +138,7 @@
@Override
public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mText == null) ? 0 : mText.hashCode());
- result = prime * result + mListIndex;
- result = prime * result + (mToggle ? 1231 : 1237);
- result = prime * result + (int) (mDate ^ (mDate >>> 32));
- return result;
+ return mType + mValue.hashCode();
}
@Override
@@ -100,32 +147,31 @@
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
final AutofillValue other = (AutofillValue) obj;
- if (mText == null) {
- if (other.mText != null) return false;
+
+ if (mType != other.mType) return false;
+
+ if (isText()) {
+ return mValue.toString().equals(other.mValue.toString());
} else {
- if (!mText.equals(other.mText)) return false;
+ return Objects.equals(mValue, other.mValue);
}
- if (mListIndex != other.mListIndex) return false;
- if (mToggle != other.mToggle) return false;
- if (mDate != other.mDate) return false;
- return true;
}
/** @hide */
public String coerceToString() {
// TODO(b/33197203): How can we filter on toggles or list values?
- return mText;
+ return mValue.toString();
}
@Override
public String toString() {
if (!DEBUG) return super.toString();
- if (mText != null) {
- return mText.length() + "_chars";
+ if (isText()) {
+ return ((CharSequence) mValue).length() + "_chars";
}
- return "[l=" + mListIndex + ", t=" + mToggle + ", d=" + mDate + "]";
+ return "[type=" + mType + ", value=" + mValue + "]";
}
/////////////////////////////////////
@@ -139,17 +185,44 @@
@Override
public void writeToParcel(Parcel parcel, int flags) {
- parcel.writeString(mText);
- parcel.writeInt(mListIndex);
- parcel.writeInt(mToggle ? 1 : 0);
- parcel.writeLong(mDate);
+ parcel.writeInt(mType);
+
+ switch (mType) {
+ case AUTOFILL_TYPE_TEXT:
+ parcel.writeCharSequence((CharSequence) mValue);
+ break;
+ case AUTOFILL_TYPE_TOGGLE:
+ parcel.writeInt((Boolean) mValue ? 1 : 0);
+ break;
+ case AUTOFILL_TYPE_LIST:
+ parcel.writeInt((Integer) mValue);
+ break;
+ case AUTOFILL_TYPE_DATE:
+ parcel.writeLong((Long) mValue);
+ break;
+ }
}
- private AutofillValue(Parcel parcel) {
- mText = parcel.readString();
- mListIndex = parcel.readInt();
- mToggle = parcel.readInt() == 1;
- mDate = parcel.readLong();
+ private AutofillValue(@NonNull Parcel parcel) {
+ mType = parcel.readInt();
+
+ switch (mType) {
+ case AUTOFILL_TYPE_TEXT:
+ mValue = parcel.readCharSequence();
+ break;
+ case AUTOFILL_TYPE_TOGGLE:
+ int rawValue = parcel.readInt();
+ mValue = rawValue != 0;
+ break;
+ case AUTOFILL_TYPE_LIST:
+ mValue = parcel.readInt();
+ break;
+ case AUTOFILL_TYPE_DATE:
+ mValue = parcel.readLong();
+ break;
+ default:
+ throw new IllegalArgumentException("type=" + mType + " not valid");
+ }
}
public static final Parcelable.Creator<AutofillValue> CREATOR =
@@ -175,9 +248,8 @@
* <p>See {@link View#AUTOFILL_TYPE_TEXT} for more info.
*/
// TODO(b/33197203): use cache
- @Nullable
public static AutofillValue forText(@Nullable CharSequence value) {
- return value == null ? null : new AutofillValue(value, 0, false, 0);
+ return value == null ? null : new AutofillValue(AUTOFILL_TYPE_TEXT, value);
}
/**
@@ -187,7 +259,7 @@
* <p>See {@link View#AUTOFILL_TYPE_TOGGLE} for more info.
*/
public static AutofillValue forToggle(boolean value) {
- return new AutofillValue(null, 0, value, 0);
+ return new AutofillValue(AUTOFILL_TYPE_TOGGLE, value);
}
/**
@@ -197,7 +269,7 @@
* <p>See {@link View#AUTOFILL_TYPE_LIST} for more info.
*/
public static AutofillValue forList(int value) {
- return new AutofillValue(null, value, false, 0);
+ return new AutofillValue(AUTOFILL_TYPE_LIST, value);
}
/**
@@ -206,6 +278,6 @@
* <p>See {@link View#AUTOFILL_TYPE_DATE} for more info.
*/
public static AutofillValue forDate(long value) {
- return new AutofillValue(null, 0, false, value);
+ return new AutofillValue(AUTOFILL_TYPE_DATE, value);
}
}
diff --git a/core/java/android/widget/AbsSpinner.java b/core/java/android/widget/AbsSpinner.java
index 053574f..020e80a 100644
--- a/core/java/android/widget/AbsSpinner.java
+++ b/core/java/android/widget/AbsSpinner.java
@@ -23,6 +23,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
@@ -38,6 +39,8 @@
* @attr ref android.R.styleable#AbsSpinner_entries
*/
public abstract class AbsSpinner extends AdapterView<SpinnerAdapter> {
+ private static final String LOG_TAG = AbsSpinner.class.getSimpleName();
+
SpinnerAdapter mAdapter;
int mHeightMeasureSpec;
@@ -514,8 +517,11 @@
public void autofill(AutofillValue value) {
if (!isEnabled()) return;
- final int position = value.getListValue();
- setSelection(position);
+ if (value.isList()) {
+ setSelection(value.getListValue());
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
+ }
}
@Override
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index d246405..899a824 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -28,6 +28,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.Gravity;
import android.view.SoundEffectConstants;
import android.view.ViewDebug;
@@ -55,6 +56,7 @@
* </p>
*/
public abstract class CompoundButton extends Button implements Checkable {
+ private static final String LOG_TAG = CompoundButton.class.getSimpleName();
private boolean mChecked;
private boolean mBroadcasting;
@@ -578,14 +580,18 @@
public void onProvideAutofillStructure(ViewStructure structure, int flags) {
super.onProvideAutofillStructure(structure, flags);
- structure.setSanitized(mCheckedFromResource);
+ structure.setDataIsSensitive(!mCheckedFromResource);
}
@Override
public void autofill(AutofillValue value) {
if (!isEnabled()) return;
- setChecked(value.getToggleValue());
+ if (value.isToggle()) {
+ setChecked(value.getToggleValue());
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
+ }
}
@Override
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index 31a88d4..f63573f 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -29,6 +29,7 @@
import android.os.Parcelable;
import android.text.format.DateUtils;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewStructure;
@@ -83,6 +84,8 @@
*/
@Widget
public class DatePicker extends FrameLayout {
+ private static final String LOG_TAG = DatePicker.class.getSimpleName();
+
/**
* Presentation mode for the Holo-style date picker that uses a set of
* {@link android.widget.NumberPicker}s.
@@ -775,7 +778,11 @@
public void autofill(AutofillValue value) {
if (!isEnabled()) return;
- mDelegate.updateDate(value.getDateValue());
+ if (value.isDate()) {
+ mDelegate.updateDate(value.getDateValue());
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
+ }
}
@Override
diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java
index dc9976d..5e8279a 100644
--- a/core/java/android/widget/RadioGroup.java
+++ b/core/java/android/widget/RadioGroup.java
@@ -55,6 +55,7 @@
*
*/
public class RadioGroup extends LinearLayout {
+ private static final String LOG_TAG = RadioGroup.class.getSimpleName();
// holds the checked id; the selection is empty by default
private int mCheckedId = -1;
@@ -421,14 +422,21 @@
@Override
public void onProvideAutofillStructure(ViewStructure structure, int flags) {
super.onProvideAutofillStructure(structure, flags);
- structure.setSanitized(mCheckedId == mInitialCheckedId);
+ structure.setDataIsSensitive(mCheckedId != mInitialCheckedId);
}
@Override
public void autofill(AutofillValue value) {
if (!isEnabled()) return;
- final int index = value.getListValue();
+ int index;
+ if (value.isList()) {
+ index = value.getListValue();
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
+ return;
+ }
+
final View child = getChildAt(index);
if (child == null) {
Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index d591316f..d04f70f 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -9900,7 +9900,7 @@
final boolean isPassword = hasPasswordTransformationMethod()
|| isPasswordInputType(getInputType());
if (forAutofill) {
- structure.setSanitized(mTextFromResource);
+ structure.setDataIsSensitive(!mTextFromResource);
}
if (!isPassword || forAutofill) {
@@ -10014,10 +10014,12 @@
@Override
public void autofill(AutofillValue value) {
- final CharSequence text = value.getTextValue();
-
- if (text != null && isTextEditable()) {
- setText(text, mBufferType, true, 0);
+ if (value.isText()) {
+ if (isTextEditable()) {
+ setText(value.getTextValue(), mBufferType, true, 0);
+ }
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
}
}
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 9825f1e..cfa78b5 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -27,6 +27,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.MathUtils;
import android.view.View;
import android.view.ViewStructure;
@@ -53,6 +54,8 @@
*/
@Widget
public class TimePicker extends FrameLayout {
+ private static final String LOG_TAG = TimePicker.class.getSimpleName();
+
/**
* Presentation mode for the Holo-style time picker that uses a set of
* {@link android.widget.NumberPicker}s.
@@ -530,7 +533,11 @@
public void autofill(AutofillValue value) {
if (!isEnabled()) return;
- mDelegate.setDate(value.getDateValue());
+ if (value.isDate()) {
+ mDelegate.setDate(value.getDateValue());
+ } else {
+ Log.w(LOG_TAG, value + " could not be autofilled into " + this);
+ }
}
@Override
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index a7e900a..0516209 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -132,9 +132,6 @@
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL");
preloadOpenGL();
Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
- Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL");
- preloadOpenGL();
- Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
preloadSharedLibraries();
preloadTextResources();
// Ask the WebViewFactory to do any initialization that must run in the zygote process,
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index c1bb69d..e64a574 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -417,11 +417,7 @@
// For wide gamut images, we will leave the color space on the SkBitmap. Otherwise,
// use the default.
SkImageInfo bitmapInfo = decodeInfo;
- sk_sp<SkColorSpace> srgb =
- SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma,
- SkColorSpace::kSRGB_Gamut,
- SkColorSpace::kNonLinearBlending_ColorSpaceFlag);
- if (decodeInfo.colorSpace() == srgb.get()) {
+ if (decodeInfo.colorSpace() && decodeInfo.colorSpace()->isSRGB()) {
bitmapInfo = bitmapInfo.makeColorSpace(GraphicsJNI::colorSpaceForType(decodeColorType));
}
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 7c56c7b..e66587a 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -461,12 +461,7 @@
}
bool GraphicsJNI::isColorSpaceSRGB(SkColorSpace* colorSpace) {
- return colorSpace == nullptr
- || colorSpace == SkColorSpace::MakeSRGB().get()
- || colorSpace == SkColorSpace::MakeRGB(
- SkColorSpace::kSRGB_RenderTargetGamma,
- SkColorSpace::kSRGB_Gamut,
- SkColorSpace::kNonLinearBlending_ColorSpaceFlag).get();
+ return colorSpace == nullptr || colorSpace->isSRGB();
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 248fd15..c547ae5 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2307,37 +2307,9 @@
</attr>
<!-- Describes the content of a view so that a autofill service can fill in the appropriate
- data. Multiple flags can be combined to mean e.g. emailAddress or postalAddress. -->
- <attr name="autofillHint">
- <!-- No hint. -->
- <flag name="none" value="0" />
- <!-- The view contains an email address. -->
- <flag name="emailAddress" value="0x1" />
- <!-- The view contains a real name. -->
- <flag name="name" value="0x2" />
- <!-- The view contains a user name. -->
- <flag name="username" value="0x4" />
- <!-- The view contains a password. -->
- <flag name="password" value="0x8" />
- <!-- The view contains a phone number. -->
- <flag name="phone" value="0x10" />
- <!-- The view contains a postal address. -->
- <flag name="postalAddress" value="0x20" />
- <!-- The view contains a postal code. -->
- <flag name="postalCode" value="0x40" />
- <!-- The view contains a credit card number. -->
- <flag name="creditCardNumber" value="0x80" />
- <!-- The view contains a credit card security code -->
- <flag name="creditCardSecurityCode" value="0x100" />
- <!-- The view contains a credit card expiration date -->
- <flag name="creditCardExpirationDate" value="0x200" />
- <!-- The view contains the month a credit card expires -->
- <flag name="creditCardExpirationMonth" value="0x400" />
- <!-- The view contains the year a credit card expires -->
- <flag name="creditCardExpirationYear" value="0x800" />
- <!-- The view contains the day a credit card expires -->
- <flag name="creditCardExpirationDay" value="0x1000" />
- </attr>
+ data. Multiple hints can be combined in a comma separated list or an array of strings
+ to mean e.g. emailAddress or postalAddress. -->
+ <attr name="autofillHint" format="string|reference" />
<!-- Hints the Android System whether the view node associated with this View should be
included in a view structure used for autofill purposes. -->
diff --git a/data/fonts/fonts.xml b/data/fonts/fonts.xml
index 76598a0..38a1a46 100644
--- a/data/fonts/fonts.xml
+++ b/data/fonts/fonts.xml
@@ -248,6 +248,9 @@
<font weight="400" style="normal">NotoSansCham-Regular.ttf</font>
<font weight="700" style="normal">NotoSansCham-Bold.ttf</font>
</family>
+ <family lang="und-Avst">
+ <font weight="400" style="normal">NotoSansAvestan-Regular.ttf</font>
+ </family>
<family lang="und-Bali">
<font weight="400" style="normal">NotoSansBalinese-Regular.ttf</font>
</family>
@@ -257,6 +260,9 @@
<family lang="und-Batk">
<font weight="400" style="normal">NotoSansBatak-Regular.ttf</font>
</family>
+ <family lang="und-Brah">
+ <font weight="400" style="normal">NotoSansBrahmi-Regular.ttf</font>
+ </family>
<family lang="und-Bugi">
<font weight="400" style="normal">NotoSansBuginese-Regular.ttf</font>
</family>
@@ -266,33 +272,75 @@
<family lang="und-Cans">
<font weight="400" style="normal">NotoSansCanadianAboriginal-Regular.ttf</font>
</family>
+ <family lang="und-Cari">
+ <font weight="400" style="normal">NotoSansCarian-Regular.ttf</font>
+ </family>
<family lang="und-Cher">
<font weight="400" style="normal">NotoSansCherokee-Regular.ttf</font>
</family>
<family lang="und-Copt">
<font weight="400" style="normal">NotoSansCoptic-Regular.ttf</font>
</family>
+ <family lang="und-Xsux">
+ <font weight="400" style="normal">NotoSansCuneiform-Regular.ttf</font>
+ </family>
+ <family lang="und-Cprt">
+ <font weight="400" style="normal">NotoSansCypriot-Regular.ttf</font>
+ </family>
+ <family lang="und-Dsrt">
+ <font weight="400" style="normal">NotoSansDeseret-Regular.ttf</font>
+ </family>
+ <family lang="und-Egyp">
+ <font weight="400" style="normal">NotoSansEgyptianHieroglyphs-Regular.ttf</font>
+ </family>
<family lang="und-Glag">
<font weight="400" style="normal">NotoSansGlagolitic-Regular.ttf</font>
</family>
+ <family lang="und-Goth">
+ <font weight="400" style="normal">NotoSansGothic-Regular.ttf</font>
+ </family>
<family lang="und-Hano">
<font weight="400" style="normal">NotoSansHanunoo-Regular.ttf</font>
</family>
+ <family lang="und-Armi">
+ <font weight="400" style="normal">NotoSansImperialAramaic-Regular.ttf</font>
+ </family>
+ <family lang="und-Phli">
+ <font weight="400" style="normal">NotoSansInscriptionalPahlavi-Regular.ttf</font>
+ </family>
+ <family lang="und-Prti">
+ <font weight="400" style="normal">NotoSansInscriptionalParthian-Regular.ttf</font>
+ </family>
<family lang="und-Java">
<font weight="400" style="normal">NotoSansJavanese-Regular.ttf</font>
</family>
+ <family lang="und-Kthi">
+ <font weight="400" style="normal">NotoSansKaithi-Regular.ttf</font>
+ </family>
<family lang="und-Kali">
<font weight="400" style="normal">NotoSansKayahLi-Regular.ttf</font>
</family>
+ <family lang="und-Khar">
+ <font weight="400" style="normal">NotoSansKharoshthi-Regular.ttf</font>
+ </family>
<family lang="und-Lepc">
<font weight="400" style="normal">NotoSansLepcha-Regular.ttf</font>
</family>
<family lang="und-Limb">
<font weight="400" style="normal">NotoSansLimbu-Regular.ttf</font>
</family>
+ <family lang="und-Linb">
+ <font weight="400" style="normal">NotoSansLinearB-Regular.ttf</font>
+ </family>
<family lang="und-Lisu">
<font weight="400" style="normal">NotoSansLisu-Regular.ttf</font>
</family>
+ <family lang="und-Lyci">
+ <font weight="400" style="normal">NotoSansLycian-Regular.ttf</font>
+ </family>
+ <family lang="und-Lydi">
+ <font weight="400" style="normal">NotoSansLydian-Regular.ttf</font>
+ </family>
<family lang="und-Mand">
<font weight="400" style="normal">NotoSansMandaic-Regular.ttf</font>
</family>
@@ -305,12 +353,33 @@
<family lang="und-Nkoo">
<font weight="400" style="normal">NotoSansNKo-Regular.ttf</font>
</family>
+ <family lang="und-Ogam">
+ <font weight="400" style="normal">NotoSansOgham-Regular.ttf</font>
+ </family>
<family lang="und-Olck">
<font weight="400" style="normal">NotoSansOlChiki-Regular.ttf</font>
</family>
+ <family lang="und-Ital">
+ <font weight="400" style="normal">NotoSansOldItalic-Regular.ttf</font>
+ </family>
+ <family lang="und-Xpeo">
+ <font weight="400" style="normal">NotoSansOldPersian-Regular.ttf</font>
+ </family>
+ <family lang="und-Sarb">
+ <font weight="400" style="normal">NotoSansOldSouthArabian-Regular.ttf</font>
+ </family>
+ <family lang="und-Orkh">
+ <font weight="400" style="normal">NotoSansOldTurkic-Regular.ttf</font>
+ </family>
+ <family lang="und-Osma">
+ <font weight="400" style="normal">NotoSansOsmanya-Regular.ttf</font>
+ </family>
<family lang="und-Phag">
<font weight="400" style="normal">NotoSansPhagsPa-Regular.ttf</font>
</family>
+ <family lang="und-Phnx">
+ <font weight="400" style="normal">NotoSansPhoenician-Regular.ttf</font>
+ </family>
<family lang="und-Rjng">
<font weight="400" style="normal">NotoSansRejang-Regular.ttf</font>
</family>
@@ -323,6 +392,9 @@
<family lang="und-Saur">
<font weight="400" style="normal">NotoSansSaurashtra-Regular.ttf</font>
</family>
+ <family lang="und-Shaw">
+ <font weight="400" style="normal">NotoSansShavian-Regular.ttf</font>
+ </family>
<family lang="und-Sund">
<font weight="400" style="normal">NotoSansSundanese-Regular.ttf</font>
</family>
@@ -358,6 +430,9 @@
<family lang="und-Tfng">
<font weight="400" style="normal">NotoSansTifinagh-Regular.ttf</font>
</family>
+ <family lang="und-Ugar">
+ <font weight="400" style="normal">NotoSansUgaritic-Regular.ttf</font>
+ </family>
<family lang="und-Vaii">
<font weight="400" style="normal">NotoSansVai-Regular.ttf</font>
</family>
diff --git a/graphics/java/android/graphics/ColorSpace.java b/graphics/java/android/graphics/ColorSpace.java
index 908ec50..929ac22 100644
--- a/graphics/java/android/graphics/ColorSpace.java
+++ b/graphics/java/android/graphics/ColorSpace.java
@@ -490,16 +490,16 @@
* <tr>
* <td>Opto-electronic transfer function (OETF)</td>
* <td colspan="4">\(\begin{equation}
- * C_{sRGB} = \begin{cases} 12.92 \times C_{linear} & C_{linear} \lt 0.0031308 \\
- * 1.055 \times C_{linear}^{\frac{1}{2.4}} - 0.055 & C_{linear} \ge 0.0031308 \end{cases}
+ * C_{DisplayP3} = \begin{cases} 12.92 \times C_{linear} & C_{linear} \lt 0.0030186 \\
+ * 1.055 \times C_{linear}^{\frac{1}{2.4}} - 0.055 & C_{linear} \ge 0.0030186 \end{cases}
* \end{equation}\)
* </td>
* </tr>
* <tr>
* <td>Electro-optical transfer function (EOTF)</td>
* <td colspan="4">\(\begin{equation}
- * C_{linear} = \begin{cases}\frac{C_{sRGB}}{12.92} & C_{sRGB} \lt 0.04045 \\
- * \left( \frac{C_{sRGB} + 0.055}{1.055} \right) ^{2.4} & C_{sRGB} \ge 0.04045 \end{cases}
+ * C_{linear} = \begin{cases}\frac{C_{DisplayP3}}{12.92} & C_{sRGB} \lt 0.039 \\
+ * \left( \frac{C_{DisplayP3} + 0.055}{1.055} \right) ^{2.4} & C_{sRGB} \ge 0.039 \end{cases}
* \end{equation}\)
* </td>
* </tr>
@@ -1482,7 +1482,7 @@
"Display P3",
new float[] { 0.680f, 0.320f, 0.265f, 0.690f, 0.150f, 0.060f },
ILLUMINANT_D65,
- new Rgb.TransferParameters(1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4),
+ new Rgb.TransferParameters(1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.039, 2.4),
Named.DISPLAY_P3.ordinal()
);
sNamedColorSpaces[Named.NTSC_1953.ordinal()] = new ColorSpace.Rgb(
diff --git a/packages/SettingsLib/src/com/android/settingslib/drawer/CategoryManager.java b/packages/SettingsLib/src/com/android/settingslib/drawer/CategoryManager.java
index fa5ba73..ee7885d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/drawer/CategoryManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/drawer/CategoryManager.java
@@ -132,7 +132,7 @@
mCategoryByKeyMap.put(category.key, category);
}
backwardCompatCleanupForCategory(mTileByComponentCache, mCategoryByKeyMap);
- normalizePriority(context, mCategoryByKeyMap);
+ sortCategories(context, mCategoryByKeyMap);
filterDuplicateTiles(mCategoryByKeyMap);
}
}
@@ -188,17 +188,17 @@
}
/**
- * Normalize priority values on tiles across injected from all apps to make sure they don't set
- * the same priority value. However internal tiles' priority remains unchanged.
+ * Sort the tiles injected from all apps such that if they have the same priority value,
+ * they wil lbe sorted by package name.
* <p/>
- * A list of tiles are considered normalized when their priority value increases in a linear
+ * A list of tiles are considered sorted when their priority value decreases in a linear
* scan.
*/
@VisibleForTesting
- synchronized void normalizePriority(Context context,
+ synchronized void sortCategories(Context context,
Map<String, DashboardCategory> categoryByKeyMap) {
for (Entry<String, DashboardCategory> categoryEntry : categoryByKeyMap.entrySet()) {
- normalizePriorityForExternalTiles(context, categoryEntry.getValue());
+ sortCategoriesForExternalTiles(context, categoryEntry.getValue());
}
}
@@ -228,39 +228,34 @@
}
/**
- * Normalize priority value for tiles within a single {@code DashboardCategory}.
+ * Sort priority value for tiles within a single {@code DashboardCategory}.
*
- * @see #normalizePriority(Context, Map)
+ * @see #sortCategories(Context, Map)
*/
- private synchronized void normalizePriorityForExternalTiles(Context context,
+ private synchronized void sortCategoriesForExternalTiles(Context context,
DashboardCategory dashboardCategory) {
final String skipPackageName = context.getPackageName();
- // Sort tiles based on [package, priority within package]
+ // Sort tiles based on [priority, package within priority]
Collections.sort(dashboardCategory.tiles, (tile1, tile2) -> {
final String package1 = tile1.intent.getComponent().getPackageName();
final String package2 = tile2.intent.getComponent().getPackageName();
final int packageCompare = CASE_INSENSITIVE_ORDER.compare(package1, package2);
- // First sort by package name
+ // First sort by priority
+ final int priorityCompare = tile2.priority - tile1.priority;
+ if (priorityCompare != 0) {
+ return priorityCompare;
+ }
+ // Then sort by package name, skip package take precedence
if (packageCompare != 0) {
- return packageCompare;
- } else if (TextUtils.equals(package1, skipPackageName)) {
- return 0;
+ if (TextUtils.equals(package1, skipPackageName)) {
+ return -1;
+ }
+ if (TextUtils.equals(package2, skipPackageName)) {
+ return 1;
+ }
}
- // Then sort by priority
- return tile1.priority - tile2.priority;
+ return packageCompare;
});
- // Update priority for all items so no package define the same priority value.
- final int count = dashboardCategory.tiles.size();
- for (int i = 0; i < count; i++) {
- final String packageName =
- dashboardCategory.tiles.get(i).intent.getComponent().getPackageName();
- if (TextUtils.equals(packageName, skipPackageName)) {
- // We skip this tile because it's a intent pointing to our own app. We trust the
- // priority is set correctly, so don't normalize.
- continue;
- }
- dashboardCategory.tiles.get(i).priority = i;
- }
}
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/CategoryManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/CategoryManagerTest.java
index 434241d..8d61338 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/CategoryManagerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/CategoryManagerTest.java
@@ -120,7 +120,7 @@
}
@Test
- public void normalizePriority_singlePackage_shouldReorderBasedOnPriority() {
+ public void sortCategories_singlePackage_shouldReorderBasedOnPriority() {
// Create some fake tiles that are not sorted.
final String testPackage = "com.android.test";
final DashboardCategory category = new DashboardCategory();
@@ -141,22 +141,18 @@
category.tiles.add(tile3);
mCategoryByKeyMap.put(CategoryKey.CATEGORY_HOMEPAGE, category);
- // Normalize their priorities
- mCategoryManager.normalizePriority(ShadowApplication.getInstance().getApplicationContext(),
+ // Sort their priorities
+ mCategoryManager.sortCategories(ShadowApplication.getInstance().getApplicationContext(),
mCategoryByKeyMap);
// Verify they are now sorted.
- assertThat(category.tiles.get(0)).isSameAs(tile2);
+ assertThat(category.tiles.get(0)).isSameAs(tile3);
assertThat(category.tiles.get(1)).isSameAs(tile1);
- assertThat(category.tiles.get(2)).isSameAs(tile3);
- // Verify their priority is normalized
- assertThat(category.tiles.get(0).priority).isEqualTo(0);
- assertThat(category.tiles.get(1).priority).isEqualTo(1);
- assertThat(category.tiles.get(2).priority).isEqualTo(2);
+ assertThat(category.tiles.get(2)).isSameAs(tile2);
}
@Test
- public void normalizePriority_multiPackage_shouldReorderBasedOnPackageAndPriority() {
+ public void sortCategories_multiPackage_shouldReorderBasedOnPackageAndPriority() {
// Create some fake tiles that are not sorted.
final String testPackage1 = "com.android.test1";
final String testPackage2 = "com.android.test2";
@@ -178,22 +174,18 @@
category.tiles.add(tile3);
mCategoryByKeyMap.put(CategoryKey.CATEGORY_HOMEPAGE, category);
- // Normalize their priorities
- mCategoryManager.normalizePriority(ShadowApplication.getInstance().getApplicationContext(),
+ // Sort their priorities
+ mCategoryManager.sortCategories(ShadowApplication.getInstance().getApplicationContext(),
mCategoryByKeyMap);
// Verify they are now sorted.
- assertThat(category.tiles.get(0)).isSameAs(tile3);
- assertThat(category.tiles.get(1)).isSameAs(tile2);
- assertThat(category.tiles.get(2)).isSameAs(tile1);
- // Verify their priority is normalized
- assertThat(category.tiles.get(0).priority).isEqualTo(0);
- assertThat(category.tiles.get(1).priority).isEqualTo(1);
- assertThat(category.tiles.get(2).priority).isEqualTo(2);
+ assertThat(category.tiles.get(0)).isSameAs(tile2);
+ assertThat(category.tiles.get(1)).isSameAs(tile1);
+ assertThat(category.tiles.get(2)).isSameAs(tile3);
}
@Test
- public void normalizePriority_internalPackageTiles_shouldSkipTileForInternalPackage() {
+ public void sortCategories_internalPackageTiles_shouldSkipTileForInternalPackage() {
// Create some fake tiles that are not sorted.
final String testPackage =
ShadowApplication.getInstance().getApplicationContext().getPackageName();
@@ -215,18 +207,82 @@
category.tiles.add(tile3);
mCategoryByKeyMap.put(CategoryKey.CATEGORY_HOMEPAGE, category);
- // Normalize their priorities
- mCategoryManager.normalizePriority(ShadowApplication.getInstance().getApplicationContext(),
+ // Sort their priorities
+ mCategoryManager.sortCategories(ShadowApplication.getInstance().getApplicationContext(),
mCategoryByKeyMap);
// Verify the sorting order is not changed
assertThat(category.tiles.get(0)).isSameAs(tile1);
assertThat(category.tiles.get(1)).isSameAs(tile2);
assertThat(category.tiles.get(2)).isSameAs(tile3);
- // Verify their priorities are not changed.
- assertThat(category.tiles.get(0).priority).isEqualTo(100);
- assertThat(category.tiles.get(1).priority).isEqualTo(100);
- assertThat(category.tiles.get(2).priority).isEqualTo(50);
+ }
+
+ @Test
+ public void sortCategories_internalAndExternalPackageTiles_shouldRetainPriorityOrdering() {
+ // Inject one external tile among internal tiles.
+ final String testPackage =
+ ShadowApplication.getInstance().getApplicationContext().getPackageName();
+ final String testPackage2 = "com.google.test2";
+ final DashboardCategory category = new DashboardCategory();
+ final Tile tile1 = new Tile();
+ tile1.intent = new Intent().setComponent(new ComponentName(testPackage, "class1"));
+ tile1.priority = 2;
+ final Tile tile2 = new Tile();
+ tile2.intent = new Intent().setComponent(new ComponentName(testPackage, "class2"));
+ tile2.priority = 1;
+ final Tile tile3 = new Tile();
+ tile3.intent = new Intent().setComponent(new ComponentName(testPackage2, "class0"));
+ tile3.priority = 0;
+ final Tile tile4 = new Tile();
+ tile4.intent = new Intent().setComponent(new ComponentName(testPackage, "class3"));
+ tile4.priority = -1;
+ category.tiles.add(tile1);
+ category.tiles.add(tile2);
+ category.tiles.add(tile3);
+ category.tiles.add(tile4);
+ mCategoryByKeyMap.put(CategoryKey.CATEGORY_HOMEPAGE, category);
+
+ // Sort their priorities
+ mCategoryManager.sortCategories(ShadowApplication.getInstance().getApplicationContext(),
+ mCategoryByKeyMap);
+
+ // Verify the sorting order is not changed
+ assertThat(category.tiles.get(0)).isSameAs(tile1);
+ assertThat(category.tiles.get(1)).isSameAs(tile2);
+ assertThat(category.tiles.get(2)).isSameAs(tile3);
+ assertThat(category.tiles.get(3)).isSameAs(tile4);
+ }
+
+ @Test
+ public void sortCategories_samePriority_internalPackageTileShouldTakePrecedence() {
+ // Inject one external tile among internal tiles with same priority.
+ final String testPackage =
+ ShadowApplication.getInstance().getApplicationContext().getPackageName();
+ final String testPackage2 = "com.google.test2";
+ final String testPackage3 = "com.abcde.test3";
+ final DashboardCategory category = new DashboardCategory();
+ final Tile tile1 = new Tile();
+ tile1.intent = new Intent().setComponent(new ComponentName(testPackage2, "class1"));
+ tile1.priority = 1;
+ final Tile tile2 = new Tile();
+ tile2.intent = new Intent().setComponent(new ComponentName(testPackage, "class2"));
+ tile2.priority = 1;
+ final Tile tile3 = new Tile();
+ tile3.intent = new Intent().setComponent(new ComponentName(testPackage3, "class3"));
+ tile3.priority = 1;
+ category.tiles.add(tile1);
+ category.tiles.add(tile2);
+ category.tiles.add(tile3);
+ mCategoryByKeyMap.put(CategoryKey.CATEGORY_HOMEPAGE, category);
+
+ // Sort their priorities
+ mCategoryManager.sortCategories(ShadowApplication.getInstance().getApplicationContext(),
+ mCategoryByKeyMap);
+
+ // Verify the sorting order is internal first, follow by package name ordering
+ assertThat(category.tiles.get(0)).isSameAs(tile2);
+ assertThat(category.tiles.get(1)).isSameAs(tile3);
+ assertThat(category.tiles.get(2)).isSameAs(tile1);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
index 6424a0a..4250962 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
@@ -46,6 +46,7 @@
import com.android.systemui.util.wakelock.WakeLockFake;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -175,6 +176,7 @@
assertFalse(mWakeLock.isHeld());
}
+ @Ignore("Flaky")
@Test
public void transientIndication_releasesWakeLock_afterHidingDelayed() throws Throwable {
mInstrumentation.runOnMainSync(() -> {
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index 072d3dc..03582ea 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -44,6 +44,18 @@
// The view or control was updated.
TYPE_UPDATE = 6;
+
+ // Type for APP_TRANSITION event: The transition started a new activity for which it's process
+ // wasn't running.
+ TYPE_TRANSITION_COLD_LAUNCH = 7;
+
+ // Type for APP_TRANSITION event: The transition started a new activity for which it's process
+ // was already running.
+ TYPE_TRANSITION_WARM_LAUNCH = 8;
+
+ // Type for APP_TRANSITION event: The transition brought an already existing activity to the
+ // front.
+ TYPE_TRANSITION_HOT_LAUNCH = 9;
}
// Known visual elements: views or controls.
@@ -3559,6 +3571,39 @@
// ACTION: Settings > Connected devices > Bluetooth master switch Toggle
ACTION_SETTINGS_MASTER_SWITCH_BLUETOOTH_TOGGLE = 870;
+ // The name of the activity being launched in an app transition event.
+ APP_TRANSITION_ACTIVITY_NAME = 871;
+
+ // ACTION: Settings > App detail > Uninstall
+ ACTION_SETTINGS_UNINSTALL_APP = 872;
+
+ // ACTION: Settings > App detail > Uninstall Device admin app
+ ACTION_SETTINGS_UNINSTALL_DEVICE_ADMIN = 873;
+
+ // ACTION: Settings > App detail > Disable app
+ ACTION_SETTINGS_DISABLE_APP = 874;
+
+ // ACTION: Settings > App detail > Enable app
+ ACTION_SETTINGS_ENABLE_APP = 875;
+
+ // ACTION: Settings > App detail > Clear data
+ ACTION_SETTINGS_CLEAR_APP_DATA = 876;
+
+ // ACTION: Settings > App detail > Clear cache
+ ACTION_SETTINGS_CLEAR_APP_CACHE = 877;
+
+ // ACTION: Clicking on any search result in Settings.
+ ACTION_CLICK_SETTINGS_SEARCH_INLINE_RESULT = 878;
+
+ // FIELD: Settings inline search result name
+ FIELD_SETTINGS_SEARCH_INLINE_RESULT_NAME = 879;
+
+ // FIELD: Settings inline search result value
+ FIELD_SETTINGS_SEARCH_INLINE_RESULT_VALUE = 880;
+
+ // ACTION: Settings > Search > Click saved queries
+ ACTION_CLICK_SETTINGS_SEARCH_SAVED_QUERY = 881;
+
// ---- End O Constants, all O constants go above this line ----
// Add new aosp constants above this line.
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index b56035f..98ce00e 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -416,10 +416,12 @@
removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0));
} else if (Intent.ACTION_USER_PRESENT.equals(action)) {
// We will update when the automation service dies.
- UserState userState = getCurrentUserStateLocked();
- if (!userState.isUiAutomationSuppressingOtherServices()) {
- if (readConfigurationForUserStateLocked(userState)) {
- onUserStateChangedLocked(userState);
+ synchronized (mLock) {
+ UserState userState = getCurrentUserStateLocked();
+ if (!userState.isUiAutomationSuppressingOtherServices()) {
+ if (readConfigurationForUserStateLocked(userState)) {
+ onUserStateChangedLocked(userState);
+ }
}
}
} else if (Intent.ACTION_SETTING_RESTORED.equals(action)) {
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index b6c60d0..411aee0 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -60,6 +60,7 @@
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.LocalLog;
+import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Slog;
import android.view.autofill.AutofillId;
@@ -954,9 +955,10 @@
String filterText = "";
if (value != null) {
// TODO(b/33197203): Handle other AutofillValue types
- final CharSequence text = value.getTextValue();
- if (text != null) {
- filterText = text.toString();
+ if (value.isText()) {
+ filterText = value.getTextValue().toString();
+ } else {
+ Log.w(TAG, value + " could not be autofilled into " + this);
}
}
diff --git a/services/autofill/java/com/android/server/autofill/RemoteFillService.java b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
index eeff37c..47251db 100644
--- a/services/autofill/java/com/android/server/autofill/RemoteFillService.java
+++ b/services/autofill/java/com/android/server/autofill/RemoteFillService.java
@@ -240,7 +240,7 @@
}
mBinding = false;
if (isBound()) {
- // TODO(b/33197203, b/35395043): synchronize access instead
+ // TODO(b/33197203): synchronize access instead?
// Need to double check if it's null, since it could be set on onServiceDisconnected()
if (mAutoFillService != null) {
try {
@@ -322,7 +322,7 @@
}
try {
- // TODO(b/33197203, b/35395043): synchronize access instead
+ // TODO(b/33197203): synchronize access instead?
// Need to double check if it's null, since it could be set on
// onServiceDisconnected()
if (mAutoFillService != null) {
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 0d5a3e0..4670eed 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -4003,12 +4003,12 @@
public Account[] getAccountsAsUser(String type, int userId, String opPackageName) {
int callingUid = Binder.getCallingUid();
mAppOpsManager.checkPackage(callingUid, opPackageName);
- return getAccountsAsUser(type, userId, opPackageName /* callingPackage */, -1,
+ return getAccountsAsUserForPackage(type, userId, opPackageName /* callingPackage */, -1,
opPackageName, false /* includeUserManagedNotVisible */);
}
@NonNull
- private Account[] getAccountsAsUser(
+ private Account[] getAccountsAsUserForPackage(
String type,
int userId,
String callingPackage,
@@ -4061,7 +4061,7 @@
return getAccountsInternal(
accounts,
callingUid,
- callingPackage,
+ opPackageName,
visibleAccountTypes,
includeUserManagedNotVisible);
} finally {
@@ -4178,7 +4178,7 @@
throw new SecurityException("getAccountsForPackage() called from unauthorized uid "
+ callingUid + " with uid=" + uid);
}
- return getAccountsAsUser(null, UserHandle.getCallingUserId(), packageName, uid,
+ return getAccountsAsUserForPackage(null, UserHandle.getCallingUserId(), packageName, uid,
opPackageName, true /* includeUserManagedNotVisible */);
}
@@ -4197,11 +4197,10 @@
return EMPTY_ACCOUNT_ARRAY;
}
if (!UserHandle.isSameApp(callingUid, Process.SYSTEM_UID)
- && !isAccountManagedByCaller(type, callingUid, userId)) {
- return EMPTY_ACCOUNT_ARRAY;
+ && (type != null && !isAccountManagedByCaller(type, callingUid, userId))) {
+ return EMPTY_ACCOUNT_ARRAY;
}
-
- return getAccountsAsUser(type, userId,
+ return getAccountsAsUserForPackage(type, userId,
packageName, packageUid, opPackageName, true /* includeUserManagedNotVisible */);
}
@@ -5371,10 +5370,13 @@
@NonNull
private Account[] filterAccounts(UserAccounts accounts, Account[] unfiltered, int callingUid,
String callingPackage, boolean includeManagedNotVisible) {
- // filter based on visibility.
+ String visibilityFilterPackage = callingPackage;
+ if (visibilityFilterPackage == null) {
+ visibilityFilterPackage = getPackageNameForUid(callingUid);
+ }
Map<Account, Integer> firstPass = new LinkedHashMap<>();
for (Account account : unfiltered) {
- int visibility = resolveAccountVisibility(account, callingPackage, accounts);
+ int visibility = resolveAccountVisibility(account, visibilityFilterPackage, accounts);
if ((visibility == AccountManager.VISIBILITY_VISIBLE
|| visibility == AccountManager.VISIBILITY_USER_MANAGED_VISIBLE)
|| (includeManagedNotVisible
@@ -5394,7 +5396,7 @@
@NonNull
private Map<Account, Integer> filterSharedAccounts(UserAccounts userAccounts,
@NonNull Map<Account, Integer> unfiltered, int callingUid,
- String callingPackage) {
+ @Nullable String callingPackage) {
// first part is to filter shared accounts.
// unfiltered type check is not necessary.
if (getUserManager() == null || userAccounts == null || userAccounts.userId < 0
@@ -5474,7 +5476,7 @@
*/
@NonNull
protected Account[] getAccountsFromCacheLocked(UserAccounts userAccounts, String accountType,
- int callingUid, String callingPackage, boolean includeManagedNotVisible) {
+ int callingUid, @Nullable String callingPackage, boolean includeManagedNotVisible) {
if (callingPackage == null) {
callingPackage = getPackageNameForUid(callingUid);
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 9dc59cb..55d661c 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -6691,16 +6691,15 @@
: new ProfilerInfo(profileFile, profileFd, samplingInterval, profileAutoStop,
profileStreamingOutput);
- // We deprecated Build.SERIAL and only apps that target pre NMR1
- // SDK can see it. Since access to the serial is now behind a
- // permission we push down the value.
+ // We deprecated Build.SERIAL and it is not accessible to
+ // apps that target the v2 security sandbox. Since access to
+ // the serial is now behind a permission we push down the value.
String buildSerial = Build.UNKNOWN;
- // TODO: SHTOPSHIP Uncomment the check when clients migrate
-// if (appInfo.targetSdkVersion <= Build.VERSION_CODES.N_MR1) {
+ if (appInfo.targetSandboxVersion != 2) {
buildSerial = IDeviceIdentifiersPolicyService.Stub.asInterface(
ServiceManager.getService(Context.DEVICE_IDENTIFIERS_SERVICE))
.getSerial();
-// }
+ }
// Check if this is a secondary process that should be incorporated into some
// currently active instrumentation. (Note we do this AFTER all of the profiling
@@ -22957,16 +22956,9 @@
}
@Override
- public void notifyStartingWindowDrawn() {
+ public void notifyAppTransitionStarting(SparseIntArray reasons) {
synchronized (ActivityManagerService.this) {
- mStackSupervisor.mActivityMetricsLogger.notifyStartingWindowDrawn();
- }
- }
-
- @Override
- public void notifyAppTransitionStarting(int reason) {
- synchronized (ActivityManagerService.this) {
- mStackSupervisor.mActivityMetricsLogger.notifyTransitionStarting(reason);
+ mStackSupervisor.mActivityMetricsLogger.notifyTransitionStarting(reasons);
}
}
diff --git a/services/core/java/com/android/server/am/ActivityMetricsLogger.java b/services/core/java/com/android/server/am/ActivityMetricsLogger.java
index ff796a54..ebbce02 100644
--- a/services/core/java/com/android/server/am/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/am/ActivityMetricsLogger.java
@@ -1,24 +1,36 @@
package com.android.server.am;
+import static android.app.ActivityManager.START_SUCCESS;
+import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.ActivityManager.StackId.ASSISTANT_STACK_ID;
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
+import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
-
+import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_ACTIVITY_NAME;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DELAY_MS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_STARTING_WINDOW_DELAY_MS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_COLD_LAUNCH;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_HOT_LAUNCH;
+import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_WARM_LAUNCH;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.ActivityStack.STACK_INVISIBLE;
-import android.annotation.Nullable;
import android.app.ActivityManager.StackId;
import android.content.Context;
+import android.metrics.LogMaker;
import android.os.SystemClock;
import android.util.Slog;
+import android.util.SparseArray;
+import android.util.SparseIntArray;
-import android.metrics.LogMaker;
import com.android.internal.logging.MetricsLogger;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import java.util.ArrayList;
@@ -48,12 +60,27 @@
private long mLastLogTimeSecs;
private final ActivityStackSupervisor mSupervisor;
private final Context mContext;
+ private final MetricsLogger mMetricsLogger = new MetricsLogger();
private long mCurrentTransitionStartTime = INVALID_START_TIME;
- private boolean mLoggedWindowsDrawn;
- private boolean mLoggedStartingWindowDrawn;
+
+ private int mCurrentTransitionDeviceUptime;
+ private int mCurrentTransitionDelayMs;
private boolean mLoggedTransitionStarting;
+ private final SparseArray<StackTransitionInfo> mStackTransitionInfo = new SparseArray<>();
+
+ private final class StackTransitionInfo {
+ private ActivityRecord launchedActivity;
+ private int startResult;
+ private boolean currentTransitionProcessRunning;
+ private int windowsDrawnDelayMs;
+ private int startingWindowDelayMs;
+ private int reason = APP_TRANSITION_TIMEOUT;
+ private boolean loggedWindowsDrawn;
+ private boolean loggedStartingWindowDrawn;
+ }
+
ActivityMetricsLogger(ActivityStackSupervisor supervisor, Context context) {
mLastLogTimeSecs = SystemClock.elapsedRealtime() / 1000;
mSupervisor = supervisor;
@@ -102,7 +129,9 @@
* activity.
*/
void notifyActivityLaunching() {
- mCurrentTransitionStartTime = System.currentTimeMillis();
+ if (!isAnyTransitionActive()) {
+ mCurrentTransitionStartTime = System.currentTimeMillis();
+ }
}
/**
@@ -118,9 +147,6 @@
launchedActivity.appInfo.uid)
: null;
final boolean processRunning = processRecord != null;
- final String componentName = launchedActivity != null
- ? launchedActivity.shortComponentName
- : null;
// We consider this a "process switch" if the process of the activity that gets launched
// didn't have an activity that was in started state. In this case, we assume that lot
@@ -129,7 +155,7 @@
final boolean processSwitch = processRecord == null
|| !hasStartedActivity(processRecord, launchedActivity);
- notifyActivityLaunched(resultCode, componentName, processRunning, processSwitch);
+ notifyActivityLaunched(resultCode, launchedActivity, processRunning, processSwitch);
}
private boolean hasStartedActivity(ProcessRecord record, ActivityRecord launchedActivity) {
@@ -151,92 +177,120 @@
*
* @param resultCode one of the ActivityManager.START_* flags, indicating the result of the
* launch
- * @param componentName the component name of the activity being launched
+ * @param launchedActivity the activity being launched
* @param processRunning whether the process that will contains the activity is already running
* @param processSwitch whether the process that will contain the activity didn't have any
* activity that was stopped, i.e. the started activity is "switching"
* processes
*/
- private void notifyActivityLaunched(int resultCode, @Nullable String componentName,
+ private void notifyActivityLaunched(int resultCode, ActivityRecord launchedActivity,
boolean processRunning, boolean processSwitch) {
- if (resultCode < 0 || componentName == null || !processSwitch) {
-
- // Failed to launch or it was not a process switch, so we don't care about the timing.
- reset();
+ // If we are already in an existing transition, only update the activity name, but not the
+ // other attributes.
+ final int stackId = launchedActivity != null && launchedActivity.getStack() != null
+ ? launchedActivity.getStack().mStackId
+ : INVALID_STACK_ID;
+ final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
+ if (launchedActivity != null && info != null) {
+ info.launchedActivity = launchedActivity;
return;
}
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_COMPONENT_NAME,
- componentName);
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_PROCESS_RUNNING,
- processRunning);
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS,
- (int) (SystemClock.uptimeMillis() / 1000));
+ final boolean otherStacksLaunching = mStackTransitionInfo.size() > 0 && info == null;
+ if ((resultCode < 0 || launchedActivity == null || !processSwitch
+ || stackId == INVALID_STACK_ID) && !otherStacksLaunching) {
- LogMaker builder = new LogMaker(MetricsEvent.APP_TRANSITION);
- builder.addTaggedData(MetricsEvent.APP_TRANSITION_COMPONENT_NAME, componentName);
- builder.addTaggedData(MetricsEvent.APP_TRANSITION_PROCESS_RUNNING, processRunning ? 1 : 0);
- builder.addTaggedData(MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS,
- SystemClock.uptimeMillis() / 1000);
- MetricsLogger.action(builder);
+ // Failed to launch or it was not a process switch, so we don't care about the timing.
+ reset(true /* abort */);
+ return;
+ } else if (otherStacksLaunching) {
+ // Don't log this stack but continue with the other stacks.
+ return;
+ }
+
+ final StackTransitionInfo newInfo = new StackTransitionInfo();
+ newInfo.launchedActivity = launchedActivity;
+ newInfo.currentTransitionProcessRunning = processRunning;
+ newInfo.startResult = resultCode;
+ mStackTransitionInfo.append(stackId, newInfo);
+ mCurrentTransitionDeviceUptime = (int) (SystemClock.uptimeMillis() / 1000);
}
/**
* Notifies the tracker that all windows of the app have been drawn.
*/
- void notifyWindowsDrawn() {
- if (!isTransitionActive() || mLoggedWindowsDrawn) {
+ void notifyWindowsDrawn(int stackId) {
+ final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
+ if (info == null || info.loggedWindowsDrawn) {
return;
}
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS,
- calculateCurrentDelay());
- mLoggedWindowsDrawn = true;
- if (mLoggedTransitionStarting) {
- reset();
+ info.windowsDrawnDelayMs = calculateCurrentDelay();
+ info.loggedWindowsDrawn = true;
+ if (allStacksWindowsDrawn() && mLoggedTransitionStarting) {
+ reset(false /* abort */);
}
}
/**
* Notifies the tracker that the starting window was drawn.
*/
- void notifyStartingWindowDrawn() {
- if (!isTransitionActive() || mLoggedStartingWindowDrawn) {
+ void notifyStartingWindowDrawn(int stackId) {
+ final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
+ if (info == null || info.loggedStartingWindowDrawn) {
return;
}
- mLoggedStartingWindowDrawn = true;
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_STARTING_WINDOW_DELAY_MS,
- calculateCurrentDelay());
+ info.loggedStartingWindowDrawn = true;
+ info.startingWindowDelayMs = calculateCurrentDelay();
}
/**
* Notifies the tracker that the app transition is starting.
*
- * @param reason The reason why we started it. Must be on of
- * ActivityManagerInternal.APP_TRANSITION_* reasons.
+ * @param stackIdReasons A map from stack id to a reason integer, which must be on of
+ * ActivityManagerInternal.APP_TRANSITION_* reasons.
*/
- void notifyTransitionStarting(int reason) {
- if (!isTransitionActive() || mLoggedTransitionStarting) {
+ void notifyTransitionStarting(SparseIntArray stackIdReasons) {
+ if (!isAnyTransitionActive() || mLoggedTransitionStarting) {
return;
}
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_REASON, reason);
- MetricsLogger.action(mContext, MetricsEvent.APP_TRANSITION_DELAY_MS,
- calculateCurrentDelay());
+ mCurrentTransitionDelayMs = calculateCurrentDelay();
mLoggedTransitionStarting = true;
- if (mLoggedWindowsDrawn) {
- reset();
+ for (int index = stackIdReasons.size() - 1; index >= 0; index--) {
+ final int stackId = stackIdReasons.keyAt(index);
+ final StackTransitionInfo info = mStackTransitionInfo.get(stackId);
+ if (info == null) {
+ continue;
+ }
+ info.reason = stackIdReasons.valueAt(index);
+ }
+ if (allStacksWindowsDrawn()) {
+ reset(false /* abort */);
}
}
- private boolean isTransitionActive() {
- return mCurrentTransitionStartTime != INVALID_START_TIME;
+ private boolean allStacksWindowsDrawn() {
+ for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) {
+ if (!mStackTransitionInfo.valueAt(index).loggedWindowsDrawn) {
+ return false;
+ }
+ }
+ return true;
}
- private void reset() {
+ private boolean isAnyTransitionActive() {
+ return mCurrentTransitionStartTime != INVALID_START_TIME
+ && mStackTransitionInfo.size() > 0;
+ }
+
+ private void reset(boolean abort) {
+ if (!abort && isAnyTransitionActive()) {
+ logAppTransitionMultiEvents();
+ }
mCurrentTransitionStartTime = INVALID_START_TIME;
- mLoggedWindowsDrawn = false;
+ mCurrentTransitionDelayMs = -1;
mLoggedTransitionStarting = false;
- mLoggedStartingWindowDrawn = false;
+ mStackTransitionInfo.clear();
}
private int calculateCurrentDelay() {
@@ -244,4 +298,41 @@
// Shouldn't take more than 25 days to launch an app, so int is fine here.
return (int) (System.currentTimeMillis() - mCurrentTransitionStartTime);
}
+
+ private void logAppTransitionMultiEvents() {
+ for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) {
+ final StackTransitionInfo info = mStackTransitionInfo.valueAt(index);
+ final int type = getTransitionType(info);
+ if (type == -1) {
+ return;
+ }
+ final LogMaker builder = new LogMaker(APP_TRANSITION);
+ builder.setPackageName(info.launchedActivity.packageName);
+ builder.addTaggedData(APP_TRANSITION_ACTIVITY_NAME, info.launchedActivity.info.name);
+ builder.setType(type);
+ builder.addTaggedData(APP_TRANSITION_DEVICE_UPTIME_SECONDS,
+ mCurrentTransitionDeviceUptime);
+ builder.addTaggedData(APP_TRANSITION_DELAY_MS, mCurrentTransitionDelayMs);
+ builder.setSubtype(info.reason);
+ if (info.startingWindowDelayMs != -1) {
+ builder.addTaggedData(APP_TRANSITION_STARTING_WINDOW_DELAY_MS,
+ info.startingWindowDelayMs);
+ }
+ builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs);
+ mMetricsLogger.write(builder);
+ }
+ }
+
+ private int getTransitionType(StackTransitionInfo info) {
+ if (info.currentTransitionProcessRunning) {
+ if (info.startResult == START_SUCCESS) {
+ return TYPE_TRANSITION_WARM_LAUNCH;
+ } else if (info.startResult == START_TASK_TO_FRONT) {
+ return TYPE_TRANSITION_HOT_LAUNCH;
+ }
+ } else if (info.startResult == START_SUCCESS) {
+ return TYPE_TRANSITION_COLD_LAUNCH;
+ }
+ return -1;
+ }
}
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 77564bb..2e26bed 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -23,6 +23,7 @@
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
+import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE;
@@ -890,6 +891,10 @@
return task != null ? (T) task.getStack() : null;
}
+ private int getStackId() {
+ return getStack() != null ? getStack().mStackId : INVALID_STACK_ID;
+ }
+
boolean changeWindowTranslucency(boolean toOpaque) {
if (fullscreen == toOpaque) {
return false;
@@ -1706,9 +1711,16 @@
}
@Override
+ public void onStartingWindowDrawn() {
+ synchronized (service) {
+ mStackSupervisor.mActivityMetricsLogger.notifyStartingWindowDrawn(getStackId());
+ }
+ }
+
+ @Override
public void onWindowsDrawn() {
synchronized (service) {
- mStackSupervisor.mActivityMetricsLogger.notifyWindowsDrawn();
+ mStackSupervisor.mActivityMetricsLogger.notifyWindowsDrawn(getStackId());
if (displayStartTime != 0) {
reportLaunchTimeLocked(SystemClock.uptimeMillis());
}
diff --git a/services/core/java/com/android/server/fingerprint/AuthenticationClient.java b/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
index 14f2e86..fb355b9 100644
--- a/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
+++ b/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
@@ -83,6 +83,7 @@
if (inLockoutMode) {
try {
Slog.w(TAG, "Forcing lockout (fp driver code should do this!)");
+ stop(false); // cancel fingerprint authentication
receiver.onError(getHalDeviceId(),
FingerprintManager.FINGERPRINT_ERROR_LOCKOUT, 0 /* vendorCode */);
} catch (RemoteException e) {
diff --git a/services/core/java/com/android/server/pm/dex/DexManager.java b/services/core/java/com/android/server/pm/dex/DexManager.java
index 755c486..83dd392 100644
--- a/services/core/java/com/android/server/pm/dex/DexManager.java
+++ b/services/core/java/com/android/server/pm/dex/DexManager.java
@@ -432,7 +432,7 @@
// Ignore framework code.
// TODO(calin): is there a better way to detect it?
if (dexPath.startsWith("/system/framework/")) {
- new DexSearchResult("framework", DEX_SEARCH_NOT_FOUND);
+ return new DexSearchResult("framework", DEX_SEARCH_NOT_FOUND);
}
// First, check if the package which loads the dex file actually owns it.
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerController.java b/services/core/java/com/android/server/wm/AppWindowContainerController.java
index 266ab4c..b90a82a 100644
--- a/services/core/java/com/android/server/wm/AppWindowContainerController.java
+++ b/services/core/java/com/android/server/wm/AppWindowContainerController.java
@@ -59,6 +59,15 @@
private final IApplicationToken mToken;
private final Handler mHandler;
+ private final Runnable mOnStartingWindowDrawn = () -> {
+ if (mListener == null) {
+ return;
+ }
+ if (DEBUG_VISIBILITY) Slog.v(TAG_WM, "Reporting drawn in "
+ + AppWindowContainerController.this.mToken);
+ mListener.onStartingWindowDrawn();
+ };
+
private final Runnable mOnWindowsDrawn = () -> {
if (mListener == null) {
return;
@@ -655,6 +664,9 @@
}
}
+ void reportStartingWindowDrawn() {
+ mHandler.post(mOnStartingWindowDrawn);
+ }
void reportWindowsDrawn() {
mHandler.post(mOnWindowsDrawn);
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerListener.java b/services/core/java/com/android/server/wm/AppWindowContainerListener.java
index 12d4b2f..9d459cf 100644
--- a/services/core/java/com/android/server/wm/AppWindowContainerListener.java
+++ b/services/core/java/com/android/server/wm/AppWindowContainerListener.java
@@ -24,6 +24,12 @@
void onWindowsVisible();
/** Called when the windows associated app window container are no longer visible. */
void onWindowsGone();
+
+ /**
+ * Called when the starting window for this container is drawn.
+ */
+ void onStartingWindowDrawn();
+
/**
* Called when the key dispatching to a window associated with the app window container
* timed-out.
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 4aa013a..2f221df 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -42,7 +42,6 @@
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.H.NOTIFY_ACTIVITY_DRAWN;
-import static com.android.server.wm.WindowManagerService.H.NOTIFY_STARTING_WINDOW_DRAWN;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.logWithStack;
@@ -668,6 +667,15 @@
return (Task) getParent();
}
+ TaskStack getStack() {
+ final Task task = getTask();
+ if (task != null) {
+ return task.mStack;
+ } else {
+ return null;
+ }
+ }
+
@Override
void onParentSet() {
super.onParentSet();
@@ -1329,7 +1337,9 @@
}
}
} else if (w.isDrawnLw()) {
- mService.mH.sendEmptyMessage(NOTIFY_STARTING_WINDOW_DRAWN);
+ if (getController() != null) {
+ getController().reportStartingWindowDrawn();
+ }
startingDisplayed = true;
}
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index f9c4efd..64614fe 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -5253,7 +5253,6 @@
public static final int NOTIFY_APP_TRANSITION_STARTING = 47;
public static final int NOTIFY_APP_TRANSITION_CANCELLED = 48;
public static final int NOTIFY_APP_TRANSITION_FINISHED = 49;
- public static final int NOTIFY_STARTING_WINDOW_DRAWN = 50;
public static final int UPDATE_ANIMATION_SCALE = 51;
public static final int WINDOW_HIDE_TIMEOUT = 52;
public static final int NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED = 53;
@@ -5682,7 +5681,7 @@
}
}
case NOTIFY_APP_TRANSITION_STARTING: {
- mAmInternal.notifyAppTransitionStarting(msg.arg1);
+ mAmInternal.notifyAppTransitionStarting((SparseIntArray) msg.obj);
}
break;
case NOTIFY_APP_TRANSITION_CANCELLED: {
@@ -5693,10 +5692,6 @@
mAmInternal.notifyAppTransitionFinished();
}
break;
- case NOTIFY_STARTING_WINDOW_DRAWN: {
- mAmInternal.notifyStartingWindowDrawn();
- }
- break;
case WINDOW_HIDE_TIMEOUT: {
final WindowState window = (WindowState) msg.obj;
synchronized(mWindowMap) {
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index f7d3343..c9863c5 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -566,7 +566,10 @@
pw.print(" rect=("); pw.print(mSurfaceX);
pw.print(","); pw.print(mSurfaceY);
pw.print(") "); pw.print(mSurfaceW);
- pw.print(" x "); pw.println(mSurfaceH);
+ pw.print(" x "); pw.print(mSurfaceH);
+ pw.print(" transform=("); pw.print(mLastDsdx); pw.print(", ");
+ pw.print(mLastDtdx); pw.print(", "); pw.print(mLastDsdy);
+ pw.print(", "); pw.print(mLastDtdy); pw.println(")");
}
@Override
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
index f247ebe..3cb96a1 100644
--- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
+++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
@@ -1,9 +1,10 @@
package com.android.server.wm;
+import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManagerInternal.APP_TRANSITION_SAVED_SURFACE;
-import static android.app.ActivityManagerInternal.APP_TRANSITION_STARTING_WINDOW;
-import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT;
+import static android.app.ActivityManagerInternal.APP_TRANSITION_SNAPSHOT;
+import static android.app.ActivityManagerInternal.APP_TRANSITION_SPLASH_SCREEN;
import static android.app.ActivityManagerInternal.APP_TRANSITION_WINDOWS_DRAWN;
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG;
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
@@ -45,6 +46,7 @@
import android.os.Trace;
import android.util.ArraySet;
import android.util.Slog;
+import android.util.SparseIntArray;
import android.view.Display;
import android.view.DisplayInfo;
import android.view.Surface;
@@ -93,6 +95,7 @@
private final LayerAndToken mTmpLayerAndToken = new LayerAndToken();
private final ArrayList<SurfaceControl> mPendingDestroyingSurfaces = new ArrayList<>();
+ private final SparseIntArray mTempTransitionReasons = new SparseIntArray();
public WindowSurfacePlacer(WindowManagerService service) {
mService = service;
@@ -495,7 +498,7 @@
mService.mAnimator.getScreenRotationAnimationLocked(
Display.DEFAULT_DISPLAY);
- int reason = APP_TRANSITION_TIMEOUT;
+ final SparseIntArray reasons = mTempTransitionReasons;
if (!mService.mAppTransition.isTimeout()) {
// Imagine the case where we are changing orientation due to an app transition, but a previous
// orientation change is still in progress. We won't process the orientation change
@@ -526,11 +529,15 @@
if (!allDrawn && !wtoken.startingDisplayed && !wtoken.startingMoved) {
return false;
}
+ final TaskStack stack = wtoken.getStack();
+ final int stackId = stack != null ? stack.mStackId : INVALID_STACK_ID;
if (allDrawn) {
- reason = drawnBeforeRestoring ? APP_TRANSITION_WINDOWS_DRAWN
- : APP_TRANSITION_SAVED_SURFACE;
+ reasons.put(stackId, drawnBeforeRestoring ? APP_TRANSITION_WINDOWS_DRAWN
+ : APP_TRANSITION_SAVED_SURFACE);
} else {
- reason = APP_TRANSITION_STARTING_WINDOW;
+ reasons.put(stackId, wtoken.startingData instanceof SplashScreenStartingData
+ ? APP_TRANSITION_SPLASH_SCREEN
+ : APP_TRANSITION_SNAPSHOT);
}
}
@@ -552,12 +559,13 @@
boolean wallpaperReady = !mWallpaperControllerLocked.isWallpaperVisible() ||
mWallpaperControllerLocked.wallpaperTransitionReady();
if (wallpaperReady) {
- mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reason, 0).sendToTarget();
+ mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reasons.clone())
+ .sendToTarget();
return true;
}
return false;
}
- mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reason, 0).sendToTarget();
+ mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reasons.clone()).sendToTarget();
return true;
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 7ad0292..0e6a542 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -3141,6 +3141,10 @@
throw new IllegalArgumentException("Only apps in internal storage can be active admin: "
+ adminReceiver);
}
+ if (info.getActivityInfo().applicationInfo.isInstantApp()) {
+ throw new IllegalArgumentException("Instant apps cannot be device admins: "
+ + adminReceiver);
+ }
synchronized (this) {
long ident = mInjector.binderClearCallingIdentity();
try {
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
index fa0bd39..72fb78e 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
@@ -61,7 +61,6 @@
@Before
public void setup() {
-
mUser0 = 0;
mUser1 = 1;
@@ -352,6 +351,15 @@
assertNull(pui);
}
+ @Test
+ public void testNotifyFrameworkLoad() {
+ String frameworkDex = "/system/framework/com.android.location.provider.jar";
+ // Load a dex file from framework.
+ notifyDexLoad(mFooUser0, Arrays.asList(frameworkDex), mUser0);
+ // The dex file should not be recognized as a package.
+ assertNull(mDexManager.getPackageUseInfo(frameworkDex));
+ }
+
private void assertSecondaryUse(TestData testData, PackageUseInfo pui,
List<String> secondaries, boolean isUsedByOtherApps, int ownerUserId) {
for (String dex : secondaries) {
diff --git a/services/usage/java/com/android/server/usage/StorageStatsService.java b/services/usage/java/com/android/server/usage/StorageStatsService.java
index ebd4b01..ecc2b7f 100644
--- a/services/usage/java/com/android/server/usage/StorageStatsService.java
+++ b/services/usage/java/com/android/server/usage/StorageStatsService.java
@@ -208,7 +208,8 @@
final ApplicationInfo appInfo;
try {
- appInfo = mPackage.getApplicationInfoAsUser(packageName, 0, userId);
+ appInfo = mPackage.getApplicationInfoAsUser(packageName,
+ PackageManager.MATCH_UNINSTALLED_PACKAGES, userId);
} catch (NameNotFoundException e) {
throw new IllegalStateException(e);
}
@@ -251,8 +252,8 @@
for (int i = 0; i < packageNames.length; i++) {
try {
- codePaths[i] = mPackage.getApplicationInfoAsUser(packageNames[i], 0,
- userId).getCodePath();
+ codePaths[i] = mPackage.getApplicationInfoAsUser(packageNames[i],
+ PackageManager.MATCH_UNINSTALLED_PACKAGES, userId).getCodePath();
} catch (NameNotFoundException e) {
throw new IllegalStateException(e);
}
@@ -284,7 +285,8 @@
}
int[] appIds = null;
- for (ApplicationInfo app : mPackage.getInstalledApplicationsAsUser(0, userId)) {
+ for (ApplicationInfo app : mPackage.getInstalledApplicationsAsUser(
+ PackageManager.MATCH_UNINSTALLED_PACKAGES, userId)) {
final int appId = UserHandle.getAppId(app.uid);
if (!ArrayUtils.contains(appIds, appId)) {
appIds = ArrayUtils.appendInt(appIds, appId);
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 632a1d6..748e32a 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -1312,6 +1312,68 @@
public static final String KEY_CALL_FORWARDING_BLOCKS_WHILE_ROAMING_STRING_ARRAY =
"call_forwarding_blocks_while_roaming_string_array";
+ /**
+ * The day of the month (1-31) on which the data cycle rolls over.
+ * <p>
+ * If the current month does not have this day, the cycle will roll over at the start of the
+ * next month.
+ * <p>
+ * This setting may be still overridden by explicit user choice. By default, the platform value
+ * will be used.
+ */
+ public static final String KEY_MONTHLY_DATA_CYCLE_DAY_INT =
+ "monthly_data_cycle_day_int";
+
+ /**
+ * When {@link #KEY_MONTHLY_DATA_CYCLE_DAY_INT}, {@link #KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG},
+ * or {@link #KEY_DATA_WARNING_THRESHOLD_BYTES_LONG} are set to this value, the platform default
+ * value will be used for that key.
+ *
+ * @hide
+ */
+ public static final int DATA_CYCLE_USE_PLATFORM_DEFAULT = -1;
+
+ /**
+ * Flag indicating that a data cycle threshold should be disabled.
+ * <p>
+ * If {@link #KEY_DATA_WARNING_THRESHOLD_BYTES_LONG} is set to this value, the platform's
+ * default data warning, if one exists, will be disabled. A user selected data warning will not
+ * be overridden.
+ * <p>
+ * If {@link #KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG} is set to this value, the platform's
+ * default data limit, if one exists, will be disabled. A user selected data limit will not be
+ * overridden.
+ */
+ public static final int DATA_CYCLE_THRESHOLD_DISABLED = -2;
+
+ /**
+ * Controls the data usage warning.
+ * <p>
+ * If the user uses more than this amount of data in their billing cycle, as defined by
+ * {@link #KEY_MONTHLY_DATA_CYCLE_DAY_INT}, the user will be alerted about the usage.
+ * If the value is set to {@link #DATA_CYCLE_THRESHOLD_DISABLED}, the data usage warning will
+ * be disabled.
+ * <p>
+ * This setting may be overridden by explicit user choice. By default, the platform value
+ * will be used.
+ */
+ public static final String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG =
+ "data_warning_threshold_bytes_long";
+
+ /**
+ * Controls the cellular data limit.
+ * <p>
+ * If the user uses more than this amount of data in their billing cycle, as defined by
+ * {@link #KEY_MONTHLY_DATA_CYCLE_DAY_INT}, cellular data will be turned off by the user's
+ * phone. If the value is set to {@link #DATA_CYCLE_THRESHOLD_DISABLED}, the data limit will be
+ * disabled.
+ * <p>
+ * This setting may be overridden by explicit user choice. By default, the platform value
+ * will be used.
+ */
+ public static final String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG =
+ "data_limit_threshold_bytes_long";
+
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -1515,6 +1577,10 @@
});
sDefaults.putStringArray(KEY_CARRIER_DEFAULT_REDIRECTION_URL_STRING_ARRAY, null);
+ sDefaults.putInt(KEY_MONTHLY_DATA_CYCLE_DAY_INT, DATA_CYCLE_USE_PLATFORM_DEFAULT);
+ sDefaults.putLong(KEY_DATA_WARNING_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT);
+ sDefaults.putLong(KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT);
+
// Rat families: {GPRS, EDGE}, {EVDO, EVDO_A, EVDO_B}, {UMTS, HSPA, HSDPA, HSUPA, HSPAP},
// {LTE, LTE_CA}
// Order is important - lowest precidence first