Merge "Move more hidden APIs into light greylist"
diff --git a/api/current.txt b/api/current.txt
index 449c761..9204289 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -6705,7 +6705,6 @@
field public static final int USER_OPERATION_ERROR_MAX_RUNNING_USERS = 3; // 0x3
field public static final int USER_OPERATION_ERROR_UNKNOWN = 1; // 0x1
field public static final int USER_OPERATION_SUCCESS = 0; // 0x0
- field public static final int WIPE_EUICC = 4; // 0x4
field public static final int WIPE_EXTERNAL_STORAGE = 1; // 0x1
field public static final int WIPE_RESET_PROTECTION_DATA = 2; // 0x2
}
@@ -6740,6 +6739,7 @@
field public static final int TAG_APP_PROCESS_START = 210005; // 0x33455
field public static final int TAG_CERT_AUTHORITY_INSTALLED = 210029; // 0x3346d
field public static final int TAG_CERT_AUTHORITY_REMOVED = 210030; // 0x3346e
+ field public static final int TAG_CRYPTO_SELF_TEST_COMPLETED = 210031; // 0x3346f
field public static final int TAG_KEYGUARD_DISABLED_FEATURES_SET = 210021; // 0x33465
field public static final int TAG_KEYGUARD_DISMISSED = 210006; // 0x33456
field public static final int TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT = 210007; // 0x33457
@@ -9440,7 +9440,6 @@
field public static final java.lang.String DISPLAY_SERVICE = "display";
field public static final java.lang.String DOWNLOAD_SERVICE = "download";
field public static final java.lang.String DROPBOX_SERVICE = "dropbox";
- field public static final java.lang.String EUICC_SERVICE = "euicc";
field public static final java.lang.String FINGERPRINT_SERVICE = "fingerprint";
field public static final java.lang.String HARDWARE_PROPERTIES_SERVICE = "hardware_properties";
field public static final java.lang.String INPUT_METHOD_SERVICE = "input_method";
@@ -11266,7 +11265,6 @@
field public static final java.lang.String FEATURE_STRONGBOX_KEYSTORE = "android.hardware.strongbox_keystore";
field public static final java.lang.String FEATURE_TELEPHONY = "android.hardware.telephony";
field public static final java.lang.String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
- field public static final java.lang.String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc";
field public static final java.lang.String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
field public static final java.lang.String FEATURE_TELEPHONY_MBMS = "android.hardware.telephony.mbms";
field public static final deprecated java.lang.String FEATURE_TELEVISION = "android.hardware.type.television";
@@ -42199,16 +42197,13 @@
method public java.lang.String getNumber();
method public int getSimSlotIndex();
method public int getSubscriptionId();
- method public boolean isEmbedded();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR;
}
public class SubscriptionManager {
method public void addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
- method public boolean canManageSubscription(android.telephony.SubscriptionInfo);
method public static deprecated android.telephony.SubscriptionManager from(android.content.Context);
- method public java.util.List<android.telephony.SubscriptionInfo> getAccessibleSubscriptionInfoList();
method public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int);
method public int getActiveSubscriptionInfoCount();
method public int getActiveSubscriptionInfoCountMax();
@@ -42593,44 +42588,6 @@
}
-package android.telephony.euicc {
-
- public final class DownloadableSubscription implements android.os.Parcelable {
- method public int describeContents();
- method public static android.telephony.euicc.DownloadableSubscription forActivationCode(java.lang.String);
- method public java.lang.String getConfirmationCode();
- method public java.lang.String getEncodedActivationCode();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.euicc.DownloadableSubscription> CREATOR;
- }
-
- public final class EuiccInfo implements android.os.Parcelable {
- ctor public EuiccInfo(java.lang.String);
- method public int describeContents();
- method public java.lang.String getOsVersion();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccInfo> CREATOR;
- }
-
- public class EuiccManager {
- method public void deleteSubscription(int, android.app.PendingIntent);
- method public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent);
- method public java.lang.String getEid();
- method public android.telephony.euicc.EuiccInfo getEuiccInfo();
- method public boolean isEnabled();
- method public void startResolutionActivity(android.app.Activity, int, android.content.Intent, android.app.PendingIntent) throws android.content.IntentSender.SendIntentException;
- method public void switchToSubscription(int, android.app.PendingIntent);
- field public static final java.lang.String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
- field public static final java.lang.String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE = "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE";
- field public static final int EMBEDDED_SUBSCRIPTION_RESULT_ERROR = 2; // 0x2
- field public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0; // 0x0
- field public static final int EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR = 1; // 0x1
- field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
- field public static final java.lang.String META_DATA_CARRIER_ICON = "android.telephony.euicc.carriericon";
- }
-
-}
-
package android.telephony.gsm {
public class GsmCellLocation extends android.telephony.CellLocation {
diff --git a/api/system-current.txt b/api/system-current.txt
index 7211500..6b229af 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -20,7 +20,6 @@
field public static final java.lang.String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
field public static final deprecated java.lang.String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE";
field public static final java.lang.String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH";
- field public static final java.lang.String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE";
field public static final java.lang.String BIND_IMS_SERVICE = "android.permission.BIND_IMS_SERVICE";
field public static final java.lang.String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
field public static final java.lang.String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE";
@@ -187,7 +186,6 @@
field public static final java.lang.String USE_RESERVED_DISK = "android.permission.USE_RESERVED_DISK";
field public static final java.lang.String WRITE_APN_SETTINGS = "android.permission.WRITE_APN_SETTINGS";
field public static final java.lang.String WRITE_DREAM_STATE = "android.permission.WRITE_DREAM_STATE";
- field public static final java.lang.String WRITE_EMBEDDED_SUBSCRIPTIONS = "android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS";
field public static final java.lang.String WRITE_GSERVICES = "android.permission.WRITE_GSERVICES";
field public static final java.lang.String WRITE_MEDIA_STORAGE = "android.permission.WRITE_MEDIA_STORAGE";
field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
@@ -363,11 +361,12 @@
}
public final class StatsManager {
- method public boolean addConfiguration(long, byte[], java.lang.String, java.lang.String);
+ method public boolean addConfiguration(long, byte[]);
method public byte[] getData(long);
method public byte[] getMetadata();
method public boolean removeConfiguration(long);
method public boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
+ method public boolean setDataFetchOperation(long, android.app.PendingIntent);
field public static final java.lang.String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
field public static final java.lang.String EXTRA_STATS_CONFIG_KEY = "android.app.extra.STATS_CONFIG_KEY";
field public static final java.lang.String EXTRA_STATS_CONFIG_UID = "android.app.extra.STATS_CONFIG_UID";
@@ -785,7 +784,6 @@
method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
field public static final java.lang.String BACKUP_SERVICE = "backup";
field public static final java.lang.String CONTEXTHUB_SERVICE = "contexthub";
- field public static final java.lang.String EUICC_CARD_SERVICE = "euicc_card";
field public static final java.lang.String HDMI_CONTROL_SERVICE = "hdmi_control";
field public static final java.lang.String NETWORK_SCORE_SERVICE = "network_score";
field public static final java.lang.String OEM_LOCK_SERVICE = "oem_lock";
@@ -794,7 +792,7 @@
field public static final java.lang.String STATS_MANAGER = "stats";
field public static final java.lang.String SYSTEM_UPDATE_SERVICE = "system_update";
field public static final java.lang.String VR_SERVICE = "vrmanager";
- field public static final java.lang.String WIFI_RTT_SERVICE = "rttmanager";
+ field public static final deprecated java.lang.String WIFI_RTT_SERVICE = "rttmanager";
field public static final java.lang.String WIFI_SCANNING_SERVICE = "wifiscanner";
}
@@ -3094,7 +3092,7 @@
package android.net.wifi {
- public class RttManager {
+ public deprecated class RttManager {
method public void disableResponder(android.net.wifi.RttManager.ResponderCallback);
method public void enableResponder(android.net.wifi.RttManager.ResponderCallback);
method public deprecated android.net.wifi.RttManager.Capabilities getCapabilities();
@@ -3170,22 +3168,22 @@
field public int supportedType;
}
- public static class RttManager.ParcelableRttParams implements android.os.Parcelable {
+ public static deprecated class RttManager.ParcelableRttParams implements android.os.Parcelable {
field public android.net.wifi.RttManager.RttParams[] mParams;
}
- public static class RttManager.ParcelableRttResults implements android.os.Parcelable {
+ public static deprecated class RttManager.ParcelableRttResults implements android.os.Parcelable {
ctor public RttManager.ParcelableRttResults(android.net.wifi.RttManager.RttResult[]);
field public android.net.wifi.RttManager.RttResult[] mResults;
}
- public static abstract class RttManager.ResponderCallback {
+ public static abstract deprecated class RttManager.ResponderCallback {
ctor public RttManager.ResponderCallback();
method public abstract void onResponderEnableFailure(int);
method public abstract void onResponderEnabled(android.net.wifi.RttManager.ResponderConfig);
}
- public static class RttManager.ResponderConfig implements android.os.Parcelable {
+ public static deprecated class RttManager.ResponderConfig implements android.os.Parcelable {
ctor public RttManager.ResponderConfig();
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
@@ -3198,7 +3196,7 @@
field public int preamble;
}
- public static class RttManager.RttCapabilities implements android.os.Parcelable {
+ public static deprecated class RttManager.RttCapabilities implements android.os.Parcelable {
ctor public RttManager.RttCapabilities();
field public int bwSupported;
field public boolean lciSupported;
@@ -3213,13 +3211,13 @@
field public boolean twoSided11McRttSupported;
}
- public static abstract interface RttManager.RttListener {
+ public static abstract deprecated interface RttManager.RttListener {
method public abstract void onAborted();
method public abstract void onFailure(int, java.lang.String);
method public abstract void onSuccess(android.net.wifi.RttManager.RttResult[]);
}
- public static class RttManager.RttParams {
+ public static deprecated class RttManager.RttParams {
ctor public RttManager.RttParams();
field public boolean LCIRequest;
field public boolean LCRRequest;
@@ -3243,7 +3241,7 @@
field public boolean secure;
}
- public static class RttManager.RttResult {
+ public static deprecated class RttManager.RttResult {
ctor public RttManager.RttResult();
field public android.net.wifi.RttManager.WifiInformationElement LCI;
field public android.net.wifi.RttManager.WifiInformationElement LCR;
@@ -3280,7 +3278,7 @@
field public deprecated int tx_rate;
}
- public static class RttManager.WifiInformationElement {
+ public static deprecated class RttManager.WifiInformationElement {
ctor public RttManager.WifiInformationElement();
field public byte[] data;
field public byte id;
@@ -4127,7 +4125,6 @@
method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String, boolean);
method public static void resetToDefaults(android.content.ContentResolver, java.lang.String);
field public static final java.lang.String AUTOFILL_COMPAT_ALLOWED_PACKAGES = "autofill_compat_allowed_packages";
- field public static final java.lang.String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
field public static final java.lang.String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
field public static final java.lang.String THEATER_MODE_ON = "theater_mode_on";
field public static final java.lang.String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
@@ -4301,124 +4298,6 @@
}
-package android.service.euicc {
-
- public final class EuiccProfileInfo implements android.os.Parcelable {
- method public int describeContents();
- method public android.service.carrier.CarrierIdentifier getCarrierIdentifier();
- method public java.lang.String getIccid();
- method public java.lang.String getNickname();
- method public int getPolicyRules();
- method public int getProfileClass();
- method public java.lang.String getProfileName();
- method public java.lang.String getServiceProviderName();
- method public int getState();
- method public java.util.List<android.telephony.UiccAccessRule> getUiccAccessRules();
- method public boolean hasPolicyRule(int);
- method public boolean hasPolicyRules();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.euicc.EuiccProfileInfo> CREATOR;
- field public static final int POLICY_RULE_DELETE_AFTER_DISABLING = 4; // 0x4
- field public static final int POLICY_RULE_DO_NOT_DELETE = 2; // 0x2
- field public static final int POLICY_RULE_DO_NOT_DISABLE = 1; // 0x1
- field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
- field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
- field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
- field public static final int PROFILE_STATE_DISABLED = 0; // 0x0
- field public static final int PROFILE_STATE_ENABLED = 1; // 0x1
- }
-
- public static final class EuiccProfileInfo.Builder {
- ctor public EuiccProfileInfo.Builder(java.lang.String);
- ctor public EuiccProfileInfo.Builder(android.service.euicc.EuiccProfileInfo);
- method public android.service.euicc.EuiccProfileInfo build();
- method public android.service.euicc.EuiccProfileInfo.Builder setCarrierIdentifier(android.service.carrier.CarrierIdentifier);
- method public android.service.euicc.EuiccProfileInfo.Builder setIccid(java.lang.String);
- method public android.service.euicc.EuiccProfileInfo.Builder setNickname(java.lang.String);
- method public android.service.euicc.EuiccProfileInfo.Builder setPolicyRules(int);
- method public android.service.euicc.EuiccProfileInfo.Builder setProfileClass(int);
- method public android.service.euicc.EuiccProfileInfo.Builder setProfileName(java.lang.String);
- method public android.service.euicc.EuiccProfileInfo.Builder setServiceProviderName(java.lang.String);
- method public android.service.euicc.EuiccProfileInfo.Builder setState(int);
- method public android.service.euicc.EuiccProfileInfo.Builder setUiccAccessRule(java.util.List<android.telephony.UiccAccessRule>);
- }
-
- public static abstract class EuiccProfileInfo.PolicyRule implements java.lang.annotation.Annotation {
- }
-
- public static abstract class EuiccProfileInfo.ProfileClass implements java.lang.annotation.Annotation {
- }
-
- public static abstract class EuiccProfileInfo.ProfileState implements java.lang.annotation.Annotation {
- }
-
- public abstract class EuiccService extends android.app.Service {
- ctor public EuiccService();
- method public android.os.IBinder onBind(android.content.Intent);
- method public abstract int onDeleteSubscription(int, java.lang.String);
- method public abstract int onDownloadSubscription(int, android.telephony.euicc.DownloadableSubscription, boolean, boolean);
- method public abstract int onEraseSubscriptions(int);
- method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean);
- method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean);
- method public abstract java.lang.String onGetEid(int);
- method public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
- method public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
- method public abstract int onGetOtaStatus(int);
- method public abstract int onRetainSubscriptionsForFactoryReset(int);
- method public abstract void onStartOtaIfNecessary(int, android.service.euicc.EuiccService.OtaStatusChangedCallback);
- method public abstract int onSwitchToSubscription(int, java.lang.String, boolean);
- method public abstract int onUpdateSubscriptionNickname(int, java.lang.String, java.lang.String);
- field public static final java.lang.String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
- field public static final java.lang.String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
- field public static final java.lang.String ACTION_RESOLVE_CONFIRMATION_CODE = "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
- field public static final java.lang.String ACTION_RESOLVE_DEACTIVATE_SIM = "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
- field public static final java.lang.String ACTION_RESOLVE_NO_PRIVILEGES = "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
- field public static final java.lang.String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
- field public static final java.lang.String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
- field public static final java.lang.String EXTRA_RESOLUTION_CALLING_PACKAGE = "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
- field public static final java.lang.String EXTRA_RESOLUTION_CONFIRMATION_CODE = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
- field public static final java.lang.String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED";
- field public static final java.lang.String EXTRA_RESOLUTION_CONSENT = "android.service.euicc.extra.RESOLUTION_CONSENT";
- field public static final int RESULT_FIRST_USER = 1; // 0x1
- field public static final int RESULT_MUST_DEACTIVATE_SIM = -1; // 0xffffffff
- field public static final int RESULT_NEED_CONFIRMATION_CODE = -2; // 0xfffffffe
- field public static final int RESULT_OK = 0; // 0x0
- }
-
- public static abstract class EuiccService.OtaStatusChangedCallback {
- ctor public EuiccService.OtaStatusChangedCallback();
- }
-
- public final class GetDefaultDownloadableSubscriptionListResult implements android.os.Parcelable {
- ctor public GetDefaultDownloadableSubscriptionListResult(int, android.telephony.euicc.DownloadableSubscription[]);
- method public int describeContents();
- method public java.util.List<android.telephony.euicc.DownloadableSubscription> getDownloadableSubscriptions();
- method public int getResult();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.euicc.GetDefaultDownloadableSubscriptionListResult> CREATOR;
- }
-
- public final class GetDownloadableSubscriptionMetadataResult implements android.os.Parcelable {
- ctor public GetDownloadableSubscriptionMetadataResult(int, android.telephony.euicc.DownloadableSubscription);
- method public int describeContents();
- method public android.telephony.euicc.DownloadableSubscription getDownloadableSubscription();
- method public int getResult();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.euicc.GetDownloadableSubscriptionMetadataResult> CREATOR;
- }
-
- public final class GetEuiccProfileInfoListResult implements android.os.Parcelable {
- ctor public GetEuiccProfileInfoListResult(int, android.service.euicc.EuiccProfileInfo[], boolean);
- method public int describeContents();
- method public boolean getIsRemovable();
- method public java.util.List<android.service.euicc.EuiccProfileInfo> getProfiles();
- method public int getResult();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.euicc.GetEuiccProfileInfoListResult> CREATOR;
- }
-
-}
-
package android.service.notification {
public final class Adjustment implements android.os.Parcelable {
@@ -5019,14 +4898,8 @@
field public static final int RESULT_SYSTEM_ERROR = 15; // 0xf
}
- public class SubscriptionInfo implements android.os.Parcelable {
- method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
- }
-
public class SubscriptionManager {
- method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
- method public void requestEmbeddedSubscriptionInfoListRefresh();
method public void setSubscriptionOverrideCongested(int, boolean, long);
method public void setSubscriptionOverrideUnmetered(int, boolean, long);
method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>);
@@ -5162,16 +5035,6 @@
field public static final int SIM_STATE_PRESENT = 11; // 0xb
}
- public final class UiccAccessRule implements android.os.Parcelable {
- ctor public UiccAccessRule(byte[], java.lang.String, long);
- method public int describeContents();
- method public int getCarrierPrivilegeStatus(android.content.pm.PackageInfo);
- method public int getCarrierPrivilegeStatus(android.content.pm.Signature, java.lang.String);
- method public java.lang.String getPackageName();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.UiccAccessRule> CREATOR;
- }
-
public class UiccSlotInfo implements android.os.Parcelable {
ctor public UiccSlotInfo(boolean, boolean, java.lang.String, int, int);
method public int describeContents();
@@ -5282,125 +5145,6 @@
}
-package android.telephony.euicc {
-
- public final class DownloadableSubscription implements android.os.Parcelable {
- method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
- method public java.lang.String getCarrierName();
- }
-
- public static final class DownloadableSubscription.Builder {
- ctor public DownloadableSubscription.Builder();
- ctor public DownloadableSubscription.Builder(android.telephony.euicc.DownloadableSubscription);
- method public android.telephony.euicc.DownloadableSubscription build();
- method public android.telephony.euicc.DownloadableSubscription.Builder setAccessRules(java.util.List<android.telephony.UiccAccessRule>);
- method public android.telephony.euicc.DownloadableSubscription.Builder setCarrierName(java.lang.String);
- method public android.telephony.euicc.DownloadableSubscription.Builder setConfirmationCode(java.lang.String);
- method public android.telephony.euicc.DownloadableSubscription.Builder setEncodedActivationCode(java.lang.String);
- }
-
- public class EuiccCardManager {
- method public void authenticateServer(java.lang.String, java.lang.String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void cancelSession(java.lang.String, byte[], int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void deleteProfile(java.lang.String, java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void disableProfile(java.lang.String, java.lang.String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void listNotifications(java.lang.String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
- method public void loadBoundProfilePackage(java.lang.String, byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void prepareDownload(java.lang.String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void removeNotificationFromList(java.lang.String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void requestAllProfiles(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo[]>);
- method public void requestDefaultSmdpAddress(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
- method public void requestEuiccChallenge(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void requestEuiccInfo1(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void requestEuiccInfo2(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
- method public void requestProfile(java.lang.String, java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
- method public void requestRulesAuthTable(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccRulesAuthTable>);
- method public void requestSmdsAddress(java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
- method public void resetMemory(java.lang.String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void retrieveNotification(java.lang.String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification>);
- method public void retrieveNotificationList(java.lang.String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
- method public void setDefaultSmdpAddress(java.lang.String, java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void setNickname(java.lang.String, java.lang.String, java.lang.String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
- method public void switchToProfile(java.lang.String, java.lang.String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
- field public static final int CANCEL_REASON_END_USER_REJECTED = 0; // 0x0
- field public static final int CANCEL_REASON_POSTPONED = 1; // 0x1
- field public static final int CANCEL_REASON_PPR_NOT_ALLOWED = 3; // 0x3
- field public static final int CANCEL_REASON_TIMEOUT = 2; // 0x2
- field public static final int RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES = 2; // 0x2
- field public static final int RESET_OPTION_DELETE_OPERATIONAL_PROFILES = 1; // 0x1
- field public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 4; // 0x4
- field public static final int RESULT_OK = 0; // 0x0
- field public static final int RESULT_UNKNOWN_ERROR = -1; // 0xffffffff
- }
-
- public static abstract class EuiccCardManager.CancelReason implements java.lang.annotation.Annotation {
- }
-
- public static abstract class EuiccCardManager.ResetOption implements java.lang.annotation.Annotation {
- }
-
- public static abstract interface EuiccCardManager.ResultCallback<T> {
- method public abstract void onComplete(int, T);
- }
-
- public class EuiccManager {
- method public void continueOperation(android.content.Intent, android.os.Bundle);
- method public void getDefaultDownloadableSubscriptionList(android.app.PendingIntent);
- method public void getDownloadableSubscriptionMetadata(android.telephony.euicc.DownloadableSubscription, android.app.PendingIntent);
- method public int getOtaStatus();
- field public static final java.lang.String ACTION_OTA_STATUS_CHANGED = "android.telephony.euicc.action.OTA_STATUS_CHANGED";
- field public static final java.lang.String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
- field public static final int EUICC_OTA_FAILED = 2; // 0x2
- field public static final int EUICC_OTA_IN_PROGRESS = 1; // 0x1
- field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
- field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
- field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
- field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
- field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
- }
-
- public static abstract class EuiccManager.OtaStatus implements java.lang.annotation.Annotation {
- }
-
- public final class EuiccNotification implements android.os.Parcelable {
- ctor public EuiccNotification(int, java.lang.String, int, byte[]);
- method public int describeContents();
- method public byte[] getData();
- method public int getEvent();
- method public int getSeq();
- method public java.lang.String getTargetAddr();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int ALL_EVENTS = 15; // 0xf
- field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccNotification> CREATOR;
- field public static final int EVENT_DELETE = 8; // 0x8
- field public static final int EVENT_DISABLE = 4; // 0x4
- field public static final int EVENT_ENABLE = 2; // 0x2
- field public static final int EVENT_INSTALL = 1; // 0x1
- }
-
- public static abstract class EuiccNotification.Event implements java.lang.annotation.Annotation {
- }
-
- public final class EuiccRulesAuthTable implements android.os.Parcelable {
- method public int describeContents();
- method public int findIndex(int, android.service.carrier.CarrierIdentifier);
- method public boolean hasPolicyRuleFlag(int, int);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccRulesAuthTable> CREATOR;
- field public static final int POLICY_RULE_FLAG_CONSENT_REQUIRED = 1; // 0x1
- }
-
- public static final class EuiccRulesAuthTable.Builder {
- ctor public EuiccRulesAuthTable.Builder(int);
- method public android.telephony.euicc.EuiccRulesAuthTable.Builder add(int, java.util.List<android.service.carrier.CarrierIdentifier>, int);
- method public android.telephony.euicc.EuiccRulesAuthTable build();
- }
-
- public static abstract class EuiccRulesAuthTable.PolicyRuleFlag implements java.lang.annotation.Annotation {
- }
-
-}
-
package android.telephony.ims {
public final class ImsCallForwardInfo implements android.os.Parcelable {
diff --git a/api/test-current.txt b/api/test-current.txt
index 4cfe401..b02da04 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1038,6 +1038,7 @@
public class AccessibilityNodeInfo implements android.os.Parcelable {
method public static void setNumInstancesInUseCounter(java.util.concurrent.atomic.AtomicInteger);
+ method public void writeToParcelNoRecycle(android.os.Parcel, int);
}
public final class AccessibilityWindowInfo implements android.os.Parcelable {
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index f24bb04..183a995 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -84,12 +84,11 @@
auto receiver = mConfigManager->GetConfigReceiver(key);
if (sc == nullptr) {
VLOG("Could not find StatsCompanionService");
- } else if (receiver.first.size() == 0) {
+ } else if (receiver == nullptr) {
VLOG("Statscompanion could not find a broadcast receiver for %s",
key.ToString().c_str());
} else {
- sc->sendBroadcast(String16(receiver.first.c_str()),
- String16(receiver.second.c_str()));
+ sc->sendDataBroadcast(receiver);
}
});
@@ -367,12 +366,14 @@
}
auto receiver = mConfigManager->GetConfigReceiver(ConfigKey(uid, StrToInt64(name)));
sp<IStatsCompanionService> sc = getStatsCompanionService();
- if (sc != nullptr) {
- sc->sendBroadcast(String16(receiver.first.c_str()), String16(receiver.second.c_str()));
+ if (sc == nullptr) {
+ VLOG("Could not access statsCompanion");
+ } else if (receiver == nullptr) {
+ VLOG("Could not find receiver for %s, %s", args[1].c_str(), args[2].c_str())
+ } else {
+ sc->sendDataBroadcast(receiver);
VLOG("StatsService::trigger broadcast succeeded to %s, %s", args[1].c_str(),
args[2].c_str());
- } else {
- VLOG("Could not access statsCompanion");
}
return NO_ERROR;
@@ -800,7 +801,6 @@
Status StatsService::addConfiguration(int64_t key,
const vector <uint8_t>& config,
- const String16& package, const String16& cls,
bool* success) {
IPCThreadState* ipc = IPCThreadState::self();
if (checkCallingPermission(String16(kPermissionDump))) {
@@ -811,8 +811,33 @@
return Status::ok();
}
mConfigManager->UpdateConfig(configKey, cfg);
- mConfigManager->SetConfigReceiver(configKey, string(String8(package).string()),
- string(String8(cls).string()));
+ *success = true;
+ return Status::ok();
+ } else {
+ *success = false;
+ return Status::fromExceptionCode(binder::Status::EX_SECURITY);
+ }
+}
+
+Status StatsService::removeDataFetchOperation(int64_t key, bool* success) {
+ IPCThreadState* ipc = IPCThreadState::self();
+ if (checkCallingPermission(String16(kPermissionDump))) {
+ ConfigKey configKey(ipc->getCallingUid(), key);
+ mConfigManager->RemoveConfigReceiver(configKey);
+ *success = true;
+ return Status::ok();
+ } else {
+ *success = false;
+ return Status::fromExceptionCode(binder::Status::EX_SECURITY);
+ }
+}
+
+Status StatsService::setDataFetchOperation(int64_t key, const sp<android::IBinder>& intentSender,
+ bool* success) {
+ IPCThreadState* ipc = IPCThreadState::self();
+ if (checkCallingPermission(String16(kPermissionDump))) {
+ ConfigKey configKey(ipc->getCallingUid(), key);
+ mConfigManager->SetConfigReceiver(configKey, intentSender);
*success = true;
return Status::ok();
} else {
diff --git a/cmds/statsd/src/StatsService.h b/cmds/statsd/src/StatsService.h
index 109752b..3dc19fe 100644
--- a/cmds/statsd/src/StatsService.h
+++ b/cmds/statsd/src/StatsService.h
@@ -90,9 +90,19 @@
* Binder call to let clients send a configuration and indicate they're interested when they
* should requestData for this configuration.
*/
- virtual Status addConfiguration(int64_t key, const vector <uint8_t>& config,
- const String16& package, const String16& cls, bool* success)
- override;
+ virtual Status addConfiguration(int64_t key, const vector<uint8_t>& config,
+ bool* success) override;
+
+ /**
+ * Binder call to let clients register the data fetch operation for a configuration.
+ */
+ virtual Status setDataFetchOperation(int64_t key, const sp<android::IBinder>& intentSender,
+ bool* success) override;
+
+ /**
+ * Binder call to remove the data fetch operation for the specified config key.
+ */
+ virtual Status removeDataFetchOperation(int64_t key, bool* success) override;
/**
* Binder call to allow clients to remove the specified configuration.
diff --git a/cmds/statsd/src/config/ConfigManager.cpp b/cmds/statsd/src/config/ConfigManager.cpp
index 61eeee3..06ff603 100644
--- a/cmds/statsd/src/config/ConfigManager.cpp
+++ b/cmds/statsd/src/config/ConfigManager.cpp
@@ -75,8 +75,8 @@
}
}
-void ConfigManager::SetConfigReceiver(const ConfigKey& key, const string& pkg, const string& cls) {
- mConfigReceivers[key] = pair<string, string>(pkg, cls);
+void ConfigManager::SetConfigReceiver(const ConfigKey& key, const sp<IBinder>& intentSender) {
+ mConfigReceivers[key] = intentSender;
}
void ConfigManager::RemoveConfigReceiver(const ConfigKey& key) {
@@ -159,10 +159,10 @@
return ret;
}
-const pair<string, string> ConfigManager::GetConfigReceiver(const ConfigKey& key) const {
+const sp<android::IBinder> ConfigManager::GetConfigReceiver(const ConfigKey& key) const {
auto it = mConfigReceivers.find(key);
if (it == mConfigReceivers.end()) {
- return pair<string,string>();
+ return nullptr;
} else {
return it->second;
}
@@ -175,8 +175,7 @@
fprintf(out, " %6d %lld\n", key.GetUid(), (long long)key.GetId());
auto receiverIt = mConfigReceivers.find(key);
if (receiverIt != mConfigReceivers.end()) {
- fprintf(out, " -> received by %s, %s\n", receiverIt->second.first.c_str(),
- receiverIt->second.second.c_str());
+ fprintf(out, " -> received by PendingIntent as binder\n");
}
}
}
diff --git a/cmds/statsd/src/config/ConfigManager.h b/cmds/statsd/src/config/ConfigManager.h
index ad666bc..a2b2a0c 100644
--- a/cmds/statsd/src/config/ConfigManager.h
+++ b/cmds/statsd/src/config/ConfigManager.h
@@ -16,6 +16,7 @@
#pragma once
+#include "binder/IBinder.h"
#include "config/ConfigKey.h"
#include "config/ConfigListener.h"
@@ -68,12 +69,12 @@
/**
* Sets the broadcast receiver for a configuration key.
*/
- void SetConfigReceiver(const ConfigKey& key, const std::string& pkg, const std::string& cls);
+ void SetConfigReceiver(const ConfigKey& key, const sp<IBinder>& intentSender);
/**
* Returns the package name and class name representing the broadcast receiver for this config.
*/
- const std::pair<std::string, std::string> GetConfigReceiver(const ConfigKey& key) const;
+ const sp<android::IBinder> GetConfigReceiver(const ConfigKey& key) const;
/**
* Returns all config keys registered.
@@ -124,10 +125,10 @@
std::set<ConfigKey> mConfigs;
/**
- * Each config key can be subscribed by up to one receiver, specified as the package name and
- * class name.
+ * Each config key can be subscribed by up to one receiver, specified as IBinder from
+ * PendingIntent.
*/
- std::map<ConfigKey, std::pair<std::string, std::string>> mConfigReceivers;
+ std::map<ConfigKey, sp<android::IBinder>> mConfigReceivers;
/**
* The ConfigListeners that will be told about changes.
diff --git a/cmds/statsd/tools/dogfood/AndroidManifest.xml b/cmds/statsd/tools/dogfood/AndroidManifest.xml
index cd76c9d..52673fb 100644
--- a/cmds/statsd/tools/dogfood/AndroidManifest.xml
+++ b/cmds/statsd/tools/dogfood/AndroidManifest.xml
@@ -37,5 +37,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+
+ <service android:name=".MainActivity$ReceiverIntentService" android:exported="true" />
</application>
</manifest>
diff --git a/cmds/statsd/tools/dogfood/res/layout/activity_main.xml b/cmds/statsd/tools/dogfood/res/layout/activity_main.xml
index 5d35c29..784ed40 100644
--- a/cmds/statsd/tools/dogfood/res/layout/activity_main.xml
+++ b/cmds/statsd/tools/dogfood/res/layout/activity_main.xml
@@ -31,6 +31,18 @@
android:layout_height="wrap_content"
android:background="@android:color/holo_green_light"
android:text="@string/push_config"/>
+ <Button
+ android:id="@+id/set_receiver"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@android:color/holo_green_light"
+ android:text="@string/set_receiver"/>
+ <Button
+ android:id="@+id/remove_receiver"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@android:color/holo_green_light"
+ android:text="@string/remove_receiver"/>
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/cmds/statsd/tools/dogfood/res/values/strings.xml b/cmds/statsd/tools/dogfood/res/values/strings.xml
index 0eab0f4..60948a1 100644
--- a/cmds/statsd/tools/dogfood/res/values/strings.xml
+++ b/cmds/statsd/tools/dogfood/res/values/strings.xml
@@ -24,6 +24,8 @@
<string name="statsd_not_running">Statsd NOT Running</string>
<string name="push_config">Push baseline config</string>
+ <string name="set_receiver">Set pendingintent</string>
+ <string name="remove_receiver">Remove pendingintent</string>
<string name="app_a_foreground">App A foreground</string>
<string name="app_b_foreground">App B foreground</string>
diff --git a/cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/MainActivity.java b/cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/MainActivity.java
index 57575ae..0e6c933 100644
--- a/cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/MainActivity.java
+++ b/cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/MainActivity.java
@@ -16,7 +16,10 @@
package com.android.statsd.dogfood;
import android.app.Activity;
+import android.app.PendingIntent;
+import android.app.IntentService;
import android.app.StatsManager;
+import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
@@ -48,69 +51,69 @@
findViewById(R.id.app_a_wake_lock_acquire1).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockAcquire(0, "wl_1");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockAcquire(0, "wl_1");
+ }
+ });
findViewById(R.id.app_b_wake_lock_acquire1).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockAcquire(1, "wl_1");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockAcquire(1, "wl_1");
+ }
+ });
findViewById(R.id.app_a_wake_lock_acquire2).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockAcquire(0, "wl_2");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockAcquire(0, "wl_2");
+ }
+ });
findViewById(R.id.app_b_wake_lock_acquire2).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockAcquire(1, "wl_2");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockAcquire(1, "wl_2");
+ }
+ });
findViewById(R.id.app_a_wake_lock_release1).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockRelease(0, "wl_1");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockRelease(0, "wl_1");
+ }
+ });
findViewById(R.id.app_b_wake_lock_release1).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockRelease(1, "wl_1");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockRelease(1, "wl_1");
+ }
+ });
findViewById(R.id.app_a_wake_lock_release2).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockRelease(0, "wl_2");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockRelease(0, "wl_2");
+ }
+ });
findViewById(R.id.app_b_wake_lock_release2).setOnClickListener(
new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- onWakeLockRelease(1, "wl_2");
- }
- });
+ @Override
+ public void onClick(View view) {
+ onWakeLockRelease(1, "wl_2");
+ }
+ });
findViewById(R.id.plug).setOnClickListener(new View.OnClickListener() {
@@ -191,8 +194,7 @@
byte[] config = new byte[inputStream.available()];
inputStream.read(config);
if (mStatsManager != null) {
- if (mStatsManager.addConfiguration(CONFIG_ID,
- config, getPackageName(), MainActivity.this.getClass().getName())) {
+ if (mStatsManager.addConfiguration(CONFIG_ID, config)) {
Toast.makeText(
MainActivity.this, "Config pushed", Toast.LENGTH_LONG).show();
} else {
@@ -205,6 +207,55 @@
}
}
});
+
+ PendingIntent pi = PendingIntent.getService(this, 0,
+ new Intent(this, ReceiverIntentService.class), PendingIntent.FLAG_UPDATE_CURRENT);
+ findViewById(R.id.set_receiver).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ try {
+ if (!statsdRunning()) {
+ return;
+ }
+ if (mStatsManager != null) {
+ if (mStatsManager.setDataFetchOperation(CONFIG_ID, pi)) {
+ Toast.makeText(MainActivity.this,
+ "Receiver specified to pending intent", Toast.LENGTH_LONG)
+ .show();
+ } else {
+ Toast.makeText(MainActivity.this, "Statsd did not set receiver",
+ Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+ } catch (Exception e) {
+ Toast.makeText(MainActivity.this, "failed to set receiver", Toast.LENGTH_LONG);
+ }
+ }
+ });
+ findViewById(R.id.remove_receiver).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ try {
+ if (!statsdRunning()) {
+ return;
+ }
+ if (mStatsManager != null) {
+ if (mStatsManager.setDataFetchOperation(CONFIG_ID, null)) {
+ Toast.makeText(MainActivity.this, "Receiver remove", Toast.LENGTH_LONG)
+ .show();
+ } else {
+ Toast.makeText(MainActivity.this, "Statsd did not remove receiver",
+ Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+ } catch (Exception e) {
+ Toast.makeText(
+ MainActivity.this, "failed to remove receiver", Toast.LENGTH_LONG);
+ }
+ }
+ });
mStatsManager = (StatsManager) getSystemService("stats");
}
@@ -257,8 +308,8 @@
Log.d(TAG, "invalid pkg id");
return;
}
- int[] uids = new int[] {mUids[id]};
- String[] tags = new String[] {"acquire"};
+ int[] uids = new int[]{mUids[id]};
+ String[] tags = new String[]{"acquire"};
StatsLog.write(StatsLog.WAKELOCK_STATE_CHANGED, uids, tags,
StatsLog.WAKELOCK_STATE_CHANGED__LEVEL__PARTIAL_WAKE_LOCK, name,
StatsLog.WAKELOCK_STATE_CHANGED__STATE__ACQUIRE);
@@ -273,8 +324,8 @@
Log.d(TAG, "invalid pkg id");
return;
}
- int[] uids = new int[] {mUids[id]};
- String[] tags = new String[] {"release"};
+ int[] uids = new int[]{mUids[id]};
+ String[] tags = new String[]{"release"};
StatsLog.write(StatsLog.WAKELOCK_STATE_CHANGED, uids, tags,
StatsLog.WAKELOCK_STATE_CHANGED__LEVEL__PARTIAL_WAKE_LOCK, name,
StatsLog.WAKELOCK_STATE_CHANGED__STATE__RELEASE);
@@ -283,4 +334,20 @@
.append(", ").append(name).append(", 0);");
Toast.makeText(this, sb.toString(), Toast.LENGTH_LONG).show();
}
+
+ public static class ReceiverIntentService extends IntentService {
+ public ReceiverIntentService() {
+ super("ReceiverIntentService");
+ }
+
+ /**
+ * The IntentService calls this method from the default worker thread with
+ * the intent that started the service. When this method returns, IntentService
+ * stops the service, as appropriate.
+ */
+ @Override
+ protected void onHandleIntent(Intent intent) {
+ Log.i(TAG, "Received notification that we should call getData");
+ }
+ }
}
diff --git a/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java b/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
index 652f6b2..bed4d98 100644
--- a/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
+++ b/cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java
@@ -47,10 +47,12 @@
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
+
import com.android.os.StatsLog.ConfigMetricsReport;
import com.android.os.StatsLog.ConfigMetricsReportList;
import com.android.os.StatsLog.StatsdStatsReport;
import com.android.internal.os.StatsdConfigProto.TimeUnit;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -60,18 +62,18 @@
* Runs a load test for statsd.
* How it works:
* <ul>
- * <li> Sets up and pushes a custom config with metrics that exercise a large swath of code paths.
- * <li> Periodically logs certain atoms into logd.
- * <li> Impact on battery can be printed to logcat, or a bug report can be filed and analyzed
- * in battery Historian.
+ * <li> Sets up and pushes a custom config with metrics that exercise a large swath of code paths.
+ * <li> Periodically logs certain atoms into logd.
+ * <li> Impact on battery can be printed to logcat, or a bug report can be filed and analyzed
+ * in battery Historian.
* </ul>
* The load depends on how demanding the config is, as well as how frequently atoms are pushsed
* to logd. Those are all controlled by 4 adjustable parameters:
* <ul>
- * <li> The 'replication' parameter artificially multiplies the number of metrics in the config.
- * <li> The bucket size controls the time-bucketing the aggregate metrics.
- * <li> The period parameter controls how frequently atoms are pushed to logd.
- * <li> The 'burst' parameter controls how many atoms are pushed at the same time (per period).
+ * <li> The 'replication' parameter artificially multiplies the number of metrics in the config.
+ * <li> The bucket size controls the time-bucketing the aggregate metrics.
+ * <li> The period parameter controls how frequently atoms are pushed to logd.
+ * <li> The 'burst' parameter controls how many atoms are pushed at the same time (per period).
* </ul>
*/
public class LoadtestActivity extends Activity implements AdapterView.OnItemSelectedListener {
@@ -93,7 +95,7 @@
Intent activityIntent = new Intent(context, LoadtestActivity.class);
activityIntent.putExtra(TYPE, PUSH_ALARM);
context.startActivity(activityIntent);
- }
+ }
}
public final static class StopperAlarmReceiver extends BroadcastReceiver {
@@ -102,7 +104,7 @@
Intent activityIntent = new Intent(context, LoadtestActivity.class);
activityIntent.putExtra(TYPE, STOP);
context.startActivity(activityIntent);
- }
+ }
}
private static Map<String, TimeUnit> initializeTimeUnitMap() {
@@ -119,6 +121,7 @@
labels.put("1s", TimeUnit.CTS);
return labels;
}
+
private static List<String> initializeTimeUnitLabels() {
List<String> labels = new ArrayList();
labels.add("1s");
@@ -136,10 +139,14 @@
private AlarmManager mAlarmMgr;
- /** Used to periodically log atoms to logd. */
+ /**
+ * Used to periodically log atoms to logd.
+ */
private PendingIntent mPushPendingIntent;
- /** Used to end the loadtest. */
+ /**
+ * Used to end the loadtest.
+ */
private PendingIntent mStopPendingIntent;
private Button mStartStop;
@@ -156,13 +163,19 @@
private CheckBox mValueMetricCheckBox;
private CheckBox mGaugeMetricCheckBox;
- /** When the load test started. */
+ /**
+ * When the load test started.
+ */
private long mStartedTimeMillis;
- /** For measuring perf data. */
+ /**
+ * For measuring perf data.
+ */
private PerfData mPerfData;
- /** For communicating with statsd. */
+ /**
+ * For communicating with statsd.
+ */
private StatsManager mStatsManager;
private PowerManager mPowerManager;
@@ -199,34 +212,54 @@
*/
private boolean mIncludeGaugeMetric;
- /** The burst size. */
+ /**
+ * The burst size.
+ */
private int mBurst;
- /** The metrics replication. */
+ /**
+ * The metrics replication.
+ */
private int mReplication;
- /** The period, in seconds, at which batches of atoms are pushed. */
+ /**
+ * The period, in seconds, at which batches of atoms are pushed.
+ */
private long mPeriodSecs;
- /** The bucket size, in minutes, for aggregate metrics. */
+ /**
+ * The bucket size, in minutes, for aggregate metrics.
+ */
private TimeUnit mBucket;
- /** The duration, in minutes, of the loadtest. */
+ /**
+ * The duration, in minutes, of the loadtest.
+ */
private long mDurationMins;
- /** Whether the loadtest has started. */
+ /**
+ * Whether the loadtest has started.
+ */
private boolean mStarted = false;
- /** Orchestrates the logging of pushed events into logd. */
+ /**
+ * Orchestrates the logging of pushed events into logd.
+ */
private SequencePusher mPusher;
- /** Generates statsd configs. */
+ /**
+ * Generates statsd configs.
+ */
private ConfigFactory mFactory;
- /** For intra-minute periods. */
+ /**
+ * For intra-minute periods.
+ */
private final Handler mHandler = new Handler();
- /** Number of metrics in the current config. */
+ /**
+ * Number of metrics in the current config.
+ */
private int mNumMetrics;
@Override
@@ -250,7 +283,7 @@
@Override
public boolean onTouch(View v, MotionEvent event) {
InputMethodManager imm =
- (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+ (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (getCurrentFocus() != null) {
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
}
@@ -380,10 +413,10 @@
}
// Piggy-back on that alarm to show the elapsed time.
long elapsedTimeMins = (long) Math.floor(
- (SystemClock.elapsedRealtime() - mStartedTimeMillis) / 60 / 1000);
+ (SystemClock.elapsedRealtime() - mStartedTimeMillis) / 60 / 1000);
mReportText.setText("Loadtest in progress.\n"
- + "num metrics =" + mNumMetrics
- + "\nElapsed time = " + elapsedTimeMins + " min(s)");
+ + "num metrics =" + mNumMetrics
+ + "\nElapsed time = " + elapsedTimeMins + " min(s)");
}
private void onAlarm() {
@@ -402,12 +435,14 @@
mWakeLock = null;
}
- /** Schedules the next cycle of pushing atoms into logd. */
+ /**
+ * Schedules the next cycle of pushing atoms into logd.
+ */
private void scheduleNext() {
Intent intent = new Intent(this, PusherAlarmReceiver.class);
intent.putExtra(TYPE, PUSH_ALARM);
mPushPendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
- long nextTime = SystemClock.elapsedRealtime() + mPeriodSecs * 1000;
+ long nextTime = SystemClock.elapsedRealtime() + mPeriodSecs * 1000;
mAlarmMgr.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextTime, mPushPendingIntent);
}
@@ -433,7 +468,7 @@
Intent intent = new Intent(this, StopperAlarmReceiver.class);
intent.putExtra(TYPE, STOP);
mStopPendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
- long nextTime = SystemClock.elapsedRealtime() + mDurationMins * 60 * 1000;
+ long nextTime = SystemClock.elapsedRealtime() + mDurationMins * 60 * 1000;
mAlarmMgr.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextTime, mStopPendingIntent);
// Log atoms.
@@ -441,8 +476,8 @@
// Start tracking performance.
mPerfData = new PerfData(this, mPlacebo, mReplication, mBucket, mPeriodSecs, mBurst,
- mIncludeCountMetric, mIncludeDurationMetric, mIncludeEventMetric, mIncludeValueMetric,
- mIncludeGaugeMetric);
+ mIncludeCountMetric, mIncludeDurationMetric, mIncludeEventMetric, mIncludeValueMetric,
+ mIncludeGaugeMetric);
mPerfData.startRecording(this);
mReportText.setText("Loadtest in progress.\nnum metrics =" + mNumMetrics);
@@ -476,7 +511,7 @@
getData();
long elapsedTimeMins = (long) Math.floor(
- (SystemClock.elapsedRealtime() - mStartedTimeMillis) / 60 / 1000);
+ (SystemClock.elapsedRealtime() - mStartedTimeMillis) / 60 / 1000);
mReportText.setText("Loadtest ended. Elapsed time = " + elapsedTimeMins + " min(s)");
clearConfigs();
updateStarted(false);
@@ -485,7 +520,7 @@
private synchronized void updateStarted(boolean started) {
mStarted = started;
mStartStop.setBackgroundColor(started ?
- Color.parseColor("#FFFF0000") : Color.parseColor("#FF00FF00"));
+ Color.parseColor("#FFFF0000") : Color.parseColor("#FF00FF00"));
mStartStop.setText(started ? getString(R.string.stop) : getString(R.string.start));
updateControlsEnabled();
}
@@ -538,22 +573,21 @@
}
private boolean setConfig(ConfigFactory.ConfigMetadata configData) {
- if (mStatsManager != null) {
- if (mStatsManager.addConfiguration(ConfigFactory.CONFIG_ID,
- configData.bytes, getPackageName(), LoadtestActivity.this.getClass().getName())) {
+ if (mStatsManager != null) {
+ if (mStatsManager.addConfiguration(ConfigFactory.CONFIG_ID, configData.bytes)) {
mNumMetrics = configData.numMetrics;
Log.d(TAG, "Config pushed to statsd");
return true;
} else {
Log.d(TAG, "Failed to push config to statsd");
}
- }
- return false;
+ }
+ return false;
}
private synchronized void setReplication(int replication) {
if (mStarted) {
- return;
+ return;
}
mReplicationText.setText("" + replication);
}
@@ -614,13 +648,13 @@
mBucketSpinner = (Spinner) findViewById(R.id.bucket_spinner);
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(
- this, R.layout.spinner_item, TIME_UNIT_LABELS);
+ this, R.layout.spinner_item, TIME_UNIT_LABELS);
mBucketSpinner.setAdapter(dataAdapter);
mBucketSpinner.setOnItemSelectedListener(this);
for (String label : TIME_UNIT_MAP.keySet()) {
- if (defaultValue.equals(TIME_UNIT_MAP.get(label).toString())) {
+ if (defaultValue.equals(TIME_UNIT_MAP.get(label).toString())) {
mBucketSpinner.setSelection(dataAdapter.getPosition(label));
}
}
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f4836b7..c805658 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -4616,10 +4616,15 @@
if (N>MAX_ACTION_BUTTONS) N=MAX_ACTION_BUTTONS;
for (int i=0; i<N; i++) {
Action action = mActions.get(i);
- validRemoteInput |= hasValidRemoteInput(action);
+ boolean actionHasValidInput = hasValidRemoteInput(action);
+ validRemoteInput |= actionHasValidInput;
final RemoteViews button = generateActionButton(action, emphazisedMode,
i % 2 != 0, p.ambient);
+ if (actionHasValidInput) {
+ // Clear the drawable
+ button.setInt(R.id.action0, "setBackgroundResource", 0);
+ }
big.addView(R.id.actions, button);
}
} else {
diff --git a/core/java/android/app/StatsManager.java b/core/java/android/app/StatsManager.java
index c525c89..88e42d5 100644
--- a/core/java/android/app/StatsManager.java
+++ b/core/java/android/app/StatsManager.java
@@ -30,20 +30,26 @@
* @hide
*/
@SystemApi
-public final class StatsManager extends android.util.StatsManager { // TODO: Remove the extends.
+public final class StatsManager {
IStatsManager mService;
private static final String TAG = "StatsManager";
- /** Long extra of uid that added the relevant stats config. */
- public static final String EXTRA_STATS_CONFIG_UID =
- "android.app.extra.STATS_CONFIG_UID";
- /** Long extra of the relevant stats config's configKey. */
- public static final String EXTRA_STATS_CONFIG_KEY =
- "android.app.extra.STATS_CONFIG_KEY";
- /** Long extra of the relevant statsd_config.proto's Subscription.id. */
+ /**
+ * Long extra of uid that added the relevant stats config.
+ */
+ public static final String EXTRA_STATS_CONFIG_UID = "android.app.extra.STATS_CONFIG_UID";
+ /**
+ * Long extra of the relevant stats config's configKey.
+ */
+ public static final String EXTRA_STATS_CONFIG_KEY = "android.app.extra.STATS_CONFIG_KEY";
+ /**
+ * Long extra of the relevant statsd_config.proto's Subscription.id.
+ */
public static final String EXTRA_STATS_SUBSCRIPTION_ID =
"android.app.extra.STATS_SUBSCRIPTION_ID";
- /** Long extra of the relevant statsd_config.proto's Subscription.rule_id. */
+ /**
+ * Long extra of the relevant statsd_config.proto's Subscription.rule_id.
+ */
public static final String EXTRA_STATS_SUBSCRIPTION_RULE_ID =
"android.app.extra.STATS_SUBSCRIPTION_RULE_ID";
/**
@@ -74,12 +80,10 @@
* @param configKey An arbitrary integer that allows clients to track the configuration.
* @param config Wire-encoded StatsDConfig proto that specifies metrics (and all
* dependencies eg, conditions and matchers).
- * @param pkg The package name to receive the broadcast.
- * @param cls The name of the class that receives the broadcast.
* @return true if successful
*/
@RequiresPermission(Manifest.permission.DUMP)
- public boolean addConfiguration(long configKey, byte[] config, String pkg, String cls) {
+ public boolean addConfiguration(long configKey, byte[] config) {
synchronized (this) {
try {
IStatsManager service = getIStatsManagerLocked();
@@ -87,7 +91,7 @@
Slog.d(TAG, "Failed to find statsd when adding configuration");
return false;
}
- return service.addConfiguration(configKey, config, pkg, cls);
+ return service.addConfiguration(configKey, config);
} catch (RemoteException e) {
Slog.d(TAG, "Failed to connect to statsd when adding configuration");
return false;
@@ -121,38 +125,34 @@
/**
* Set the PendingIntent to be used when broadcasting subscriber information to the given
* subscriberId within the given config.
- *
* <p>
* Suppose that the calling uid has added a config with key configKey, and that in this config
* it is specified that when a particular anomaly is detected, a broadcast should be sent to
* a BroadcastSubscriber with id subscriberId. This function links the given pendingIntent with
* that subscriberId (for that config), so that this pendingIntent is used to send the broadcast
* when the anomaly is detected.
- *
* <p>
* When statsd sends the broadcast, the PendingIntent will used to send an intent with
* information of
- * {@link #EXTRA_STATS_CONFIG_UID},
- * {@link #EXTRA_STATS_CONFIG_KEY},
- * {@link #EXTRA_STATS_SUBSCRIPTION_ID},
- * {@link #EXTRA_STATS_SUBSCRIPTION_RULE_ID}, and
- * {@link #EXTRA_STATS_DIMENSIONS_VALUE}.
- *
+ * {@link #EXTRA_STATS_CONFIG_UID},
+ * {@link #EXTRA_STATS_CONFIG_KEY},
+ * {@link #EXTRA_STATS_SUBSCRIPTION_ID},
+ * {@link #EXTRA_STATS_SUBSCRIPTION_RULE_ID}, and
+ * {@link #EXTRA_STATS_DIMENSIONS_VALUE}.
* <p>
* This function can only be called by the owner (uid) of the config. It must be called each
* time statsd starts. The config must have been added first (via addConfiguration()).
*
- * @param configKey The integer naming the config to which this subscriber is attached.
- * @param subscriberId ID of the subscriber, as used in the config.
+ * @param configKey The integer naming the config to which this subscriber is attached.
+ * @param subscriberId ID of the subscriber, as used in the config.
* @param pendingIntent the PendingIntent to use when broadcasting info to the subscriber
* associated with the given subscriberId. May be null, in which case
* it undoes any previous setting of this subscriberId.
* @return true if successful
*/
@RequiresPermission(Manifest.permission.DUMP)
- public boolean setBroadcastSubscriber(long configKey,
- long subscriberId,
- PendingIntent pendingIntent) {
+ public boolean setBroadcastSubscriber(
+ long configKey, long subscriberId, PendingIntent pendingIntent) {
synchronized (this) {
try {
IStatsManager service = getIStatsManagerLocked();
@@ -175,6 +175,44 @@
}
/**
+ * Registers the operation that is called to retrieve the metrics data. This must be called
+ * each time statsd starts. The config must have been added first (via addConfiguration(),
+ * although addConfiguration could have been called on a previous boot). This operation allows
+ * statsd to send metrics data whenever statsd determines that the metrics in memory are
+ * approaching the memory limits. The fetch operation should call {@link #getData} to fetch the
+ * data, which also deletes the retrieved metrics from statsd's memory.
+ *
+ * @param configKey The integer naming the config to which this operation is attached.
+ * @param pendingIntent the PendingIntent to use when broadcasting info to the subscriber
+ * associated with the given subscriberId. May be null, in which case
+ * it removes any associated pending intent with this configKey.
+ * @return true if successful
+ */
+ @RequiresPermission(Manifest.permission.DUMP)
+ public boolean setDataFetchOperation(long configKey, PendingIntent pendingIntent) {
+ synchronized (this) {
+ try {
+ IStatsManager service = getIStatsManagerLocked();
+ if (service == null) {
+ Slog.d(TAG, "Failed to find statsd when registering data listener.");
+ return false;
+ }
+ if (pendingIntent == null) {
+ return service.removeDataFetchOperation(configKey);
+ } else {
+ // Extracts IIntentSender from the PendingIntent and turns it into an IBinder.
+ IBinder intentSender = pendingIntent.getTarget().asBinder();
+ return service.setDataFetchOperation(configKey, intentSender);
+ }
+
+ } catch (RemoteException e) {
+ Slog.d(TAG, "Failed to connect to statsd when registering data listener.");
+ return false;
+ }
+ }
+ }
+
+ /**
* Clients can request data with a binder call. This getter is destructive and also clears
* the retrieved metrics from statsd memory.
*
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index b29644b..77e118c 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -3444,6 +3444,9 @@
/**
* Flag for {@link #wipeData(int)}: also erase the device's eUICC data.
+ *
+ * TODO(b/35851809): make this public.
+ * @hide
*/
public static final int WIPE_EUICC = 0x0004;
diff --git a/core/java/android/app/admin/SecurityLog.java b/core/java/android/app/admin/SecurityLog.java
index 08effd9..202b894 100644
--- a/core/java/android/app/admin/SecurityLog.java
+++ b/core/java/android/app/admin/SecurityLog.java
@@ -77,6 +77,7 @@
TAG_KEY_DESTRUCTION,
TAG_CERT_AUTHORITY_INSTALLED,
TAG_CERT_AUTHORITY_REMOVED,
+ TAG_CRYPTO_SELF_TEST_COMPLETED,
})
public @interface SecurityLogTag {}
@@ -400,6 +401,14 @@
SecurityLogTags.SECURITY_USER_RESTRICTION_REMOVED;
/**
+ * Indicates that cryptographic functionality self test has completed. The log entry contains an
+ * {@code Integer} payload, indicating the result of the test (0 if the test failed, 1 if
+ * succeeded) and accessible via {@link SecurityEvent#getData()}.
+ */
+ public static final int TAG_CRYPTO_SELF_TEST_COMPLETED =
+ SecurityLogTags.SECURITY_CRYPTO_SELF_TEST_COMPLETED;
+
+ /**
* Event severity level indicating that the event corresponds to normal workflow.
*/
public static final int LEVEL_INFO = 1;
@@ -529,6 +538,7 @@
case TAG_USER_RESTRICTION_REMOVED:
return LEVEL_INFO;
case TAG_CERT_AUTHORITY_REMOVED:
+ case TAG_CRYPTO_SELF_TEST_COMPLETED:
return getSuccess() ? LEVEL_INFO : LEVEL_ERROR;
case TAG_CERT_AUTHORITY_INSTALLED:
case TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT:
diff --git a/core/java/android/app/admin/SecurityLogTags.logtags b/core/java/android/app/admin/SecurityLogTags.logtags
index be62678..b64b7e3 100644
--- a/core/java/android/app/admin/SecurityLogTags.logtags
+++ b/core/java/android/app/admin/SecurityLogTags.logtags
@@ -34,4 +34,5 @@
210027 security_user_restriction_added (package|3),(admin_user|1),(restriction|3)
210028 security_user_restriction_removed (package|3),(admin_user|1),(restriction|3)
210029 security_cert_authority_installed (success|1),(subject|3)
-210030 security_cert_authority_removed (success|1),(subject|3)
\ No newline at end of file
+210030 security_cert_authority_removed (success|1),(subject|3)
+210031 security_crypto_self_test_completed (success|1)
\ No newline at end of file
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 7b406df..bb37eb3 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -3539,6 +3539,7 @@
* @hide
*/
@SystemApi
+ @Deprecated
public static final String WIFI_RTT_SERVICE = "rttmanager";
/**
@@ -3671,8 +3672,10 @@
*
* @see #getSystemService(String)
* @see android.telephony.euicc.EuiccManager
+ * TODO(b/35851809): Unhide this API.
+ * @hide
*/
- public static final String EUICC_SERVICE = "euicc";
+ public static final String EUICC_SERVICE = "euicc_service";
/**
* Use with {@link #getSystemService(String)} to retrieve a
@@ -3680,10 +3683,10 @@
*
* @see #getSystemService(String)
* @see android.telephony.euicc.EuiccCardManager
+ * TODO(b/35851809): Make this a SystemApi.
* @hide
*/
- @SystemApi
- public static final String EUICC_CARD_SERVICE = "euicc_card";
+ public static final String EUICC_CARD_SERVICE = "euicc_card_service";
/**
* Use with {@link #getSystemService(String)} to retrieve a
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 08fccab..486c86c 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -2108,6 +2108,8 @@
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device
* supports embedded subscriptions on eUICCs.
+ * TODO(b/35851809): Make this public.
+ * @hide
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc";
diff --git a/core/java/android/content/pm/VerifierDeviceIdentity.java b/core/java/android/content/pm/VerifierDeviceIdentity.java
index a8cdb6a..90be6f31 100644
--- a/core/java/android/content/pm/VerifierDeviceIdentity.java
+++ b/core/java/android/content/pm/VerifierDeviceIdentity.java
@@ -19,6 +19,8 @@
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.internal.annotations.VisibleForTesting;
+
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.Random;
@@ -86,6 +88,7 @@
* @return verifier device identity based on the input from the provided
* random number generator
*/
+ @VisibleForTesting
static VerifierDeviceIdentity generate(Random rng) {
long identity = rng.nextLong();
return new VerifierDeviceIdentity(identity);
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index fd0e5ae..5d7cf1e 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -1537,6 +1537,7 @@
public static final int STATE2_BLUETOOTH_ON_FLAG = 1<<22;
public static final int STATE2_CAMERA_FLAG = 1<<21;
public static final int STATE2_BLUETOOTH_SCAN_FLAG = 1 << 20;
+ public static final int STATE2_CELLULAR_HIGH_TX_POWER_FLAG = 1 << 19;
public static final int MOST_INTERESTING_STATES2 =
STATE2_POWER_SAVE_FLAG | STATE2_WIFI_ON_FLAG | STATE2_DEVICE_IDLE_MASK
@@ -2353,9 +2354,11 @@
WIFI_SUPPL_STATE_NAMES, WIFI_SUPPL_STATE_SHORT_NAMES),
new BitDescription(HistoryItem.STATE2_CAMERA_FLAG, "camera", "ca"),
new BitDescription(HistoryItem.STATE2_BLUETOOTH_SCAN_FLAG, "ble_scan", "bles"),
+ new BitDescription(HistoryItem.STATE2_CELLULAR_HIGH_TX_POWER_FLAG,
+ "cellular_high_tx_power", "Chtp"),
new BitDescription(HistoryItem.STATE2_GPS_SIGNAL_QUALITY_MASK,
HistoryItem.STATE2_GPS_SIGNAL_QUALITY_SHIFT, "gps_signal_quality", "Gss",
- new String[] { "poor", "good"}, new String[] { "poor", "good"}),
+ new String[] { "poor", "good"}, new String[] { "poor", "good"})
};
public static final String[] HISTORY_EVENT_NAMES = new String[] {
diff --git a/core/java/android/os/IStatsCompanionService.aidl b/core/java/android/os/IStatsCompanionService.aidl
index 8a27700..eae5217 100644
--- a/core/java/android/os/IStatsCompanionService.aidl
+++ b/core/java/android/os/IStatsCompanionService.aidl
@@ -55,9 +55,8 @@
/** Pull the specified data. Results will be sent to statsd when complete. */
StatsLogEventWrapper[] pullData(int pullCode);
- /** Send a broadcast to the specified pkg and class that it should getData now. */
- // TODO: Rename this and use a pending intent instead.
- oneway void sendBroadcast(String pkg, String cls);
+ /** Send a broadcast to the specified PendingIntent's as IBinder that it should getData now. */
+ oneway void sendDataBroadcast(in IBinder intentSender);
/**
* Requests StatsCompanionService to send a broadcast using the given intentSender
diff --git a/core/java/android/os/IStatsManager.aidl b/core/java/android/os/IStatsManager.aidl
index 679b49d..682a24f1 100644
--- a/core/java/android/os/IStatsManager.aidl
+++ b/core/java/android/os/IStatsManager.aidl
@@ -81,12 +81,26 @@
/**
* Sets a configuration with the specified config key and subscribes to updates for this
* configuration key. Broadcasts will be sent if this configuration needs to be collected.
- * The configuration must be a wire-encoded StatsdConfig. The caller specifies the name of the
- * package and class that should receive these broadcasts.
+ * The configuration must be a wire-encoded StatsDConfig. The receiver for this data is
+ * registered in a separate function.
*
* Returns if this configuration was correctly registered.
*/
- boolean addConfiguration(in long configKey, in byte[] config, in String pkg, in String cls);
+ boolean addConfiguration(in long configKey, in byte[] config);
+
+ /**
+ * Registers the given pending intent for this config key. This intent is invoked when the
+ * memory consumed by the metrics for this configuration approach the pre-defined limits. There
+ * can be at most one listener per config key.
+ *
+ * Returns if this listener was correctly registered.
+ */
+ boolean setDataFetchOperation(long configKey, in IBinder intentSender);
+
+ /**
+ * Removes the data fetch operation for the specified configuration.
+ */
+ boolean removeDataFetchOperation(long configKey);
/**
* Removes the configuration with the matching config key. No-op if this config key does not
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d14ac20..84996e0 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -8563,8 +8563,9 @@
*
* @see android.service.euicc.EuiccService
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
/**
diff --git a/core/java/android/service/euicc/EuiccProfileInfo.java b/core/java/android/service/euicc/EuiccProfileInfo.java
index cb4f104..8e752d1 100644
--- a/core/java/android/service/euicc/EuiccProfileInfo.java
+++ b/core/java/android/service/euicc/EuiccProfileInfo.java
@@ -17,7 +17,6 @@
import android.annotation.IntDef;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.service.carrier.CarrierIdentifier;
@@ -27,15 +26,15 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
-import java.util.List;
import java.util.Objects;
/**
* Information about an embedded profile (subscription) on an eUICC.
*
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public final class EuiccProfileInfo implements Parcelable {
/** Profile policy rules (bit mask) */
@@ -45,7 +44,6 @@
POLICY_RULE_DO_NOT_DELETE,
POLICY_RULE_DELETE_AFTER_DISABLING
})
- /** @hide */
public @interface PolicyRule {}
/** Once this profile is enabled, it cannot be disabled. */
public static final int POLICY_RULE_DO_NOT_DISABLE = 1;
@@ -62,7 +60,6 @@
PROFILE_CLASS_OPERATIONAL,
PROFILE_CLASS_UNSET
})
- /** @hide */
public @interface ProfileClass {}
/** Testing profiles */
public static final int PROFILE_CLASS_TESTING = 0;
@@ -83,7 +80,6 @@
PROFILE_STATE_ENABLED,
PROFILE_STATE_UNSET
})
- /** @hide */
public @interface ProfileState {}
/** Disabled profiles */
public static final int PROFILE_STATE_DISABLED = 0;
@@ -96,34 +92,34 @@
public static final int PROFILE_STATE_UNSET = -1;
/** The iccid of the subscription. */
- private final String mIccid;
+ public final String iccid;
/** An optional nickname for the subscription. */
- private final @Nullable String mNickname;
+ public final @Nullable String nickname;
/** The service provider name for the subscription. */
- private final String mServiceProviderName;
+ public final String serviceProviderName;
/** The profile name for the subscription. */
- private final String mProfileName;
+ public final String profileName;
/** Profile class for the subscription. */
- @ProfileClass private final int mProfileClass;
+ @ProfileClass public final int profileClass;
/** The profile state of the subscription. */
- @ProfileState private final int mState;
+ @ProfileState public final int state;
/** The operator Id of the subscription. */
- private final CarrierIdentifier mCarrierIdentifier;
+ public final CarrierIdentifier carrierIdentifier;
/** The policy rules of the subscription. */
- @PolicyRule private final int mPolicyRules;
+ @PolicyRule public final int policyRules;
/**
* Optional access rules defining which apps can manage this subscription. If unset, only the
* platform can manage it.
*/
- private final @Nullable UiccAccessRule[] mAccessRules;
+ public final @Nullable UiccAccessRule[] accessRules;
public static final Creator<EuiccProfileInfo> CREATOR = new Creator<EuiccProfileInfo>() {
@Override
@@ -148,51 +144,51 @@
if (!TextUtils.isDigitsOnly(iccid)) {
throw new IllegalArgumentException("iccid contains invalid characters: " + iccid);
}
- this.mIccid = iccid;
- this.mAccessRules = accessRules;
- this.mNickname = nickname;
+ this.iccid = iccid;
+ this.accessRules = accessRules;
+ this.nickname = nickname;
- this.mServiceProviderName = null;
- this.mProfileName = null;
- this.mProfileClass = PROFILE_CLASS_UNSET;
- this.mState = PROFILE_STATE_UNSET;
- this.mCarrierIdentifier = null;
- this.mPolicyRules = 0;
+ this.serviceProviderName = null;
+ this.profileName = null;
+ this.profileClass = PROFILE_CLASS_UNSET;
+ this.state = PROFILE_CLASS_UNSET;
+ this.carrierIdentifier = null;
+ this.policyRules = 0;
}
private EuiccProfileInfo(Parcel in) {
- mIccid = in.readString();
- mNickname = in.readString();
- mServiceProviderName = in.readString();
- mProfileName = in.readString();
- mProfileClass = in.readInt();
- mState = in.readInt();
+ iccid = in.readString();
+ nickname = in.readString();
+ serviceProviderName = in.readString();
+ profileName = in.readString();
+ profileClass = in.readInt();
+ state = in.readInt();
byte exist = in.readByte();
if (exist == (byte) 1) {
- mCarrierIdentifier = CarrierIdentifier.CREATOR.createFromParcel(in);
+ carrierIdentifier = CarrierIdentifier.CREATOR.createFromParcel(in);
} else {
- mCarrierIdentifier = null;
+ carrierIdentifier = null;
}
- mPolicyRules = in.readInt();
- mAccessRules = in.createTypedArray(UiccAccessRule.CREATOR);
+ policyRules = in.readInt();
+ accessRules = in.createTypedArray(UiccAccessRule.CREATOR);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(mIccid);
- dest.writeString(mNickname);
- dest.writeString(mServiceProviderName);
- dest.writeString(mProfileName);
- dest.writeInt(mProfileClass);
- dest.writeInt(mState);
- if (mCarrierIdentifier != null) {
+ dest.writeString(iccid);
+ dest.writeString(nickname);
+ dest.writeString(serviceProviderName);
+ dest.writeString(profileName);
+ dest.writeInt(profileClass);
+ dest.writeInt(state);
+ if (carrierIdentifier != null) {
dest.writeByte((byte) 1);
- mCarrierIdentifier.writeToParcel(dest, flags);
+ carrierIdentifier.writeToParcel(dest, flags);
} else {
dest.writeByte((byte) 0);
}
- dest.writeInt(mPolicyRules);
- dest.writeTypedArray(mAccessRules, flags);
+ dest.writeInt(policyRules);
+ dest.writeTypedArray(accessRules, flags);
}
@Override
@@ -202,50 +198,45 @@
/** The builder to build a new {@link EuiccProfileInfo} instance. */
public static final class Builder {
- private String mIccid;
- private List<UiccAccessRule> mAccessRules;
- private String mNickname;
- private String mServiceProviderName;
- private String mProfileName;
- @ProfileClass private int mProfileClass;
- @ProfileState private int mState;
- private CarrierIdentifier mCarrierIdentifier;
- @PolicyRule private int mPolicyRules;
+ public String iccid;
+ public UiccAccessRule[] accessRules;
+ public String nickname;
+ public String serviceProviderName;
+ public String profileName;
+ @ProfileClass public int profileClass;
+ @ProfileState public int state;
+ public CarrierIdentifier carrierIdentifier;
+ @PolicyRule public int policyRules;
- public Builder(String value) {
- if (!TextUtils.isDigitsOnly(value)) {
- throw new IllegalArgumentException("iccid contains invalid characters: " + value);
- }
- mIccid = value;
- }
+ public Builder() {}
public Builder(EuiccProfileInfo baseProfile) {
- mIccid = baseProfile.mIccid;
- mNickname = baseProfile.mNickname;
- mServiceProviderName = baseProfile.mServiceProviderName;
- mProfileName = baseProfile.mProfileName;
- mProfileClass = baseProfile.mProfileClass;
- mState = baseProfile.mState;
- mCarrierIdentifier = baseProfile.mCarrierIdentifier;
- mPolicyRules = baseProfile.mPolicyRules;
- mAccessRules = Arrays.asList(baseProfile.mAccessRules);
+ iccid = baseProfile.iccid;
+ nickname = baseProfile.nickname;
+ serviceProviderName = baseProfile.serviceProviderName;
+ profileName = baseProfile.profileName;
+ profileClass = baseProfile.profileClass;
+ state = baseProfile.state;
+ carrierIdentifier = baseProfile.carrierIdentifier;
+ policyRules = baseProfile.policyRules;
+ accessRules = baseProfile.accessRules;
}
/** Builds the profile instance. */
public EuiccProfileInfo build() {
- if (mIccid == null) {
+ if (iccid == null) {
throw new IllegalStateException("ICCID must be set for a profile.");
}
return new EuiccProfileInfo(
- mIccid,
- mNickname,
- mServiceProviderName,
- mProfileName,
- mProfileClass,
- mState,
- mCarrierIdentifier,
- mPolicyRules,
- mAccessRules);
+ iccid,
+ nickname,
+ serviceProviderName,
+ profileName,
+ profileClass,
+ state,
+ carrierIdentifier,
+ policyRules,
+ accessRules);
}
/** Sets the iccId of the subscription. */
@@ -253,55 +244,55 @@
if (!TextUtils.isDigitsOnly(value)) {
throw new IllegalArgumentException("iccid contains invalid characters: " + value);
}
- mIccid = value;
+ iccid = value;
return this;
}
/** Sets the nickname of the subscription. */
public Builder setNickname(String value) {
- mNickname = value;
+ nickname = value;
return this;
}
/** Sets the service provider name of the subscription. */
public Builder setServiceProviderName(String value) {
- mServiceProviderName = value;
+ serviceProviderName = value;
return this;
}
/** Sets the profile name of the subscription. */
public Builder setProfileName(String value) {
- mProfileName = value;
+ profileName = value;
return this;
}
/** Sets the profile class of the subscription. */
public Builder setProfileClass(@ProfileClass int value) {
- mProfileClass = value;
+ profileClass = value;
return this;
}
/** Sets the state of the subscription. */
public Builder setState(@ProfileState int value) {
- mState = value;
+ state = value;
return this;
}
/** Sets the carrier identifier of the subscription. */
public Builder setCarrierIdentifier(CarrierIdentifier value) {
- mCarrierIdentifier = value;
+ carrierIdentifier = value;
return this;
}
/** Sets the policy rules of the subscription. */
public Builder setPolicyRules(@PolicyRule int value) {
- mPolicyRules = value;
+ policyRules = value;
return this;
}
/** Sets the access rules of the subscription. */
- public Builder setUiccAccessRule(@Nullable List<UiccAccessRule> value) {
- mAccessRules = value;
+ public Builder setUiccAccessRule(@Nullable UiccAccessRule[] value) {
+ accessRules = value;
return this;
}
}
@@ -315,81 +306,75 @@
@ProfileState int state,
CarrierIdentifier carrierIdentifier,
@PolicyRule int policyRules,
- @Nullable List<UiccAccessRule> accessRules) {
- this.mIccid = iccid;
- this.mNickname = nickname;
- this.mServiceProviderName = serviceProviderName;
- this.mProfileName = profileName;
- this.mProfileClass = profileClass;
- this.mState = state;
- this.mCarrierIdentifier = carrierIdentifier;
- this.mPolicyRules = policyRules;
- if (accessRules != null && accessRules.size() > 0) {
- this.mAccessRules = accessRules.toArray(new UiccAccessRule[accessRules.size()]);
- } else {
- this.mAccessRules = null;
- }
+ @Nullable UiccAccessRule[] accessRules) {
+ this.iccid = iccid;
+ this.nickname = nickname;
+ this.serviceProviderName = serviceProviderName;
+ this.profileName = profileName;
+ this.profileClass = profileClass;
+ this.state = state;
+ this.carrierIdentifier = carrierIdentifier;
+ this.policyRules = policyRules;
+ this.accessRules = accessRules;
}
/** Gets the ICCID string. */
public String getIccid() {
- return mIccid;
+ return iccid;
}
/** Gets the access rules. */
@Nullable
- public List<UiccAccessRule> getUiccAccessRules() {
- if (mAccessRules == null) return null;
- return Arrays.asList(mAccessRules);
+ public UiccAccessRule[] getUiccAccessRules() {
+ return accessRules;
}
/** Gets the nickname. */
- @Nullable
public String getNickname() {
- return mNickname;
+ return nickname;
}
/** Gets the service provider name. */
public String getServiceProviderName() {
- return mServiceProviderName;
+ return serviceProviderName;
}
/** Gets the profile name. */
public String getProfileName() {
- return mProfileName;
+ return profileName;
}
/** Gets the profile class. */
@ProfileClass
public int getProfileClass() {
- return mProfileClass;
+ return profileClass;
}
/** Gets the state of the subscription. */
@ProfileState
public int getState() {
- return mState;
+ return state;
}
/** Gets the carrier identifier. */
public CarrierIdentifier getCarrierIdentifier() {
- return mCarrierIdentifier;
+ return carrierIdentifier;
}
/** Gets the policy rules. */
@PolicyRule
public int getPolicyRules() {
- return mPolicyRules;
+ return policyRules;
}
/** Returns whether any policy rule exists. */
public boolean hasPolicyRules() {
- return mPolicyRules != 0;
+ return policyRules != 0;
}
/** Checks whether a certain policy rule exists. */
public boolean hasPolicyRule(@PolicyRule int policy) {
- return (mPolicyRules & policy) != 0;
+ return (policyRules & policy) != 0;
}
@Override
@@ -402,50 +387,50 @@
}
EuiccProfileInfo that = (EuiccProfileInfo) obj;
- return Objects.equals(mIccid, that.mIccid)
- && Objects.equals(mNickname, that.mNickname)
- && Objects.equals(mServiceProviderName, that.mServiceProviderName)
- && Objects.equals(mProfileName, that.mProfileName)
- && mProfileClass == that.mProfileClass
- && mState == that.mState
- && Objects.equals(mCarrierIdentifier, that.mCarrierIdentifier)
- && mPolicyRules == that.mPolicyRules
- && Arrays.equals(mAccessRules, that.mAccessRules);
+ return Objects.equals(iccid, that.iccid)
+ && Objects.equals(nickname, that.nickname)
+ && Objects.equals(serviceProviderName, that.serviceProviderName)
+ && Objects.equals(profileName, that.profileName)
+ && profileClass == that.profileClass
+ && state == that.state
+ && Objects.equals(carrierIdentifier, that.carrierIdentifier)
+ && policyRules == that.policyRules
+ && Arrays.equals(accessRules, that.accessRules);
}
@Override
public int hashCode() {
int result = 1;
- result = 31 * result + Objects.hashCode(mIccid);
- result = 31 * result + Objects.hashCode(mNickname);
- result = 31 * result + Objects.hashCode(mServiceProviderName);
- result = 31 * result + Objects.hashCode(mProfileName);
- result = 31 * result + mProfileClass;
- result = 31 * result + mState;
- result = 31 * result + Objects.hashCode(mCarrierIdentifier);
- result = 31 * result + mPolicyRules;
- result = 31 * result + Arrays.hashCode(mAccessRules);
+ result = 31 * result + Objects.hashCode(iccid);
+ result = 31 * result + Objects.hashCode(nickname);
+ result = 31 * result + Objects.hashCode(serviceProviderName);
+ result = 31 * result + Objects.hashCode(profileName);
+ result = 31 * result + profileClass;
+ result = 31 * result + state;
+ result = 31 * result + Objects.hashCode(carrierIdentifier);
+ result = 31 * result + policyRules;
+ result = 31 * result + Arrays.hashCode(accessRules);
return result;
}
@Override
public String toString() {
return "EuiccProfileInfo (nickname="
- + mNickname
+ + nickname
+ ", serviceProviderName="
- + mServiceProviderName
+ + serviceProviderName
+ ", profileName="
- + mProfileName
+ + profileName
+ ", profileClass="
- + mProfileClass
+ + profileClass
+ ", state="
- + mState
+ + state
+ ", CarrierIdentifier="
- + mCarrierIdentifier.toString()
+ + carrierIdentifier.toString()
+ ", policyRules="
- + mPolicyRules
+ + policyRules
+ ", accessRules="
- + Arrays.toString(mAccessRules)
+ + Arrays.toString(accessRules)
+ ")";
}
}
diff --git a/core/java/android/service/euicc/EuiccService.java b/core/java/android/service/euicc/EuiccService.java
index ce6b285..be85800 100644
--- a/core/java/android/service/euicc/EuiccService.java
+++ b/core/java/android/service/euicc/EuiccService.java
@@ -17,7 +17,6 @@
import android.annotation.CallSuper;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
@@ -42,11 +41,8 @@
* <p>To implement the LPA backend, you must extend this class and declare this service in your
* manifest file. The service must require the
* {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission and include an intent filter
- * with the {@link #EUICC_SERVICE_INTERFACE} action. It's suggested that the priority of the intent
- * filter to be set to a non-zero value in case multiple implementations are present on the device.
- * See the below example. Note that there will be problem if two LPAs are present and they have the
- * same priority.
- * Example:
+ * with the {@link #EUICC_SERVICE_INTERFACE} action. The priority of the intent filter must be set
+ * to a non-zero value in case multiple implementations are present on the device. For example:
*
* <pre>{@code
* <service android:name=".MyEuiccService"
@@ -69,9 +65,9 @@
* filter with the appropriate action, the {@link #CATEGORY_EUICC_UI} category, and a non-zero
* priority.
*
+ * TODO(b/35851809): Make this a SystemApi.
* @hide
*/
-@SystemApi
public abstract class EuiccService extends Service {
/** Action which must be included in this service's intent filter. */
public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
@@ -81,10 +77,7 @@
// LUI actions. These are passthroughs of the corresponding EuiccManager actions.
- /**
- * @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS
- * The difference is this one is used by system to bring up the LUI.
- */
+ /** @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS */
public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS =
"android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
/** @see android.telephony.euicc.EuiccManager#ACTION_PROVISION_EMBEDDED_SUBSCRIPTION */
@@ -95,10 +88,7 @@
// require user interaction.
// TODO(b/33075886): Define extras for any input parameters to these dialogs once they are
// more scoped out.
- /**
- * Alert the user that this action will result in an active SIM being deactivated.
- * To implement the LUI triggered by the system, you need to define this in AndroidManifest.xml.
- */
+ /** Alert the user that this action will result in an active SIM being deactivated. */
public static final String ACTION_RESOLVE_DEACTIVATE_SIM =
"android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
/**
@@ -112,11 +102,7 @@
public static final String ACTION_RESOLVE_CONFIRMATION_CODE =
"android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
- /**
- * Intent extra set for resolution requests containing the package name of the calling app.
- * This is used by the above actions including ACTION_RESOLVE_DEACTIVATE_SIM,
- * ACTION_RESOLVE_NO_PRIVILEGES and ACTION_RESOLVE_CONFIRMATION_CODE.
- */
+ /** Intent extra set for resolution requests containing the package name of the calling app. */
public static final String EXTRA_RESOLUTION_CALLING_PACKAGE =
"android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
@@ -150,18 +136,10 @@
RESOLUTION_ACTIONS.add(EuiccService.ACTION_RESOLVE_CONFIRMATION_CODE);
}
- /**
- * Boolean extra for resolution actions indicating whether the user granted consent.
- * This is used and set by the implementation and used in {@code EuiccOperation}.
- */
- public static final String EXTRA_RESOLUTION_CONSENT =
- "android.service.euicc.extra.RESOLUTION_CONSENT";
- /**
- * String extra for resolution actions indicating the carrier confirmation code.
- * This is used and set by the implementation and used in {@code EuiccOperation}.
- */
- public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE =
- "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
+ /** Boolean extra for resolution actions indicating whether the user granted consent. */
+ public static final String RESOLUTION_EXTRA_CONSENT = "consent";
+ /** String extra for resolution actions indicating the carrier confirmation code. */
+ public static final String RESOLUTION_EXTRA_CONFIRMATION_CODE = "confirmation_code";
private final IEuiccService.Stub mStubWrapper;
@@ -221,9 +199,9 @@
*
* @see IEuiccService#startOtaIfNecessary
*/
- public abstract static class OtaStatusChangedCallback {
+ public interface OtaStatusChangedCallback {
/** Called when OTA status is changed. */
- abstract void onOtaStatusChanged(int status);
+ void onOtaStatusChanged(int status);
}
/**
@@ -260,7 +238,8 @@
/**
* Populate {@link DownloadableSubscription} metadata for the given downloadable subscription.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @param subscription A subscription whose metadata needs to be populated.
* @param forceDeactivateSim If true, and if an active SIM must be deactivated to access the
* eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)}
@@ -288,7 +267,8 @@
/**
* Download the given subscription.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @param subscription The subscription to download.
* @param switchAfterDownload If true, the subscription should be enabled upon successful
* download.
@@ -306,7 +286,8 @@
/**
* Return a list of all @link EuiccProfileInfo}s.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @return The result of the operation.
* @see android.telephony.SubscriptionManager#getAvailableSubscriptionInfoList
* @see android.telephony.SubscriptionManager#getAccessibleSubscriptionInfoList
@@ -316,7 +297,8 @@
/**
* Return info about the eUICC chip/device.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @return the {@link EuiccInfo} for the eUICC chip/device.
* @see android.telephony.euicc.EuiccManager#getEuiccInfo
*/
@@ -328,7 +310,8 @@
* <p>If the subscription is currently active, it should be deactivated first (equivalent to a
* physical SIM being ejected).
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @param iccid the ICCID of the subscription to delete.
* @return the result of the delete operation. May be one of the predefined {@code RESULT_}
* constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}.
@@ -339,7 +322,8 @@
/**
* Switch to the given subscription.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @param iccid the ICCID of the subscription to enable. May be null, in which case the current
* profile should be deactivated and no profile should be activated to replace it - this is
* equivalent to a physical SIM being ejected.
@@ -356,7 +340,8 @@
/**
* Update the nickname of the given subscription.
*
- * @param slotId ID of the SIM slot to use for the operation.
+ * @param slotId ID of the SIM slot to use for the operation. This is currently not populated
+ * but is here to future-proof the APIs.
* @param iccid the ICCID of the subscription to update.
* @param nickname the new nickname to apply.
* @return the result of the update operation. May be one of the predefined {@code RESULT_}
diff --git a/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java
index e2171ae..5a24492 100644
--- a/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java
+++ b/core/java/android/service/euicc/GetDefaultDownloadableSubscriptionListResult.java
@@ -16,19 +16,16 @@
package android.service.euicc;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.euicc.DownloadableSubscription;
-import java.util.Arrays;
-import java.util.List;
-
/**
* Result of a {@link EuiccService#onGetDefaultDownloadableSubscriptionList} operation.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public final class GetDefaultDownloadableSubscriptionListResult implements Parcelable {
public static final Creator<GetDefaultDownloadableSubscriptionListResult> CREATOR =
@@ -45,35 +42,20 @@
};
/**
- * @hide
- * @deprecated - Do no use. Use getResult() instead.
- */
- @Deprecated
- public final int result;
-
- @Nullable
- private final DownloadableSubscription[] mSubscriptions;
-
- /**
- * Gets the result of the operation.
+ * Result of the operation.
*
* <p>May be one of the predefined {@code RESULT_} constants in EuiccService or any
* implementation-specific code starting with {@link EuiccService#RESULT_FIRST_USER}.
*/
- public int getResult() {
- return result;
- }
+ public final int result;
/**
- * Gets the available {@link DownloadableSubscription}s (with filled-in metadata).
+ * The available {@link DownloadableSubscription}s (with filled-in metadata).
*
* <p>Only non-null if {@link #result} is {@link EuiccService#RESULT_OK}.
*/
@Nullable
- public List<DownloadableSubscription> getDownloadableSubscriptions() {
- if (mSubscriptions == null) return null;
- return Arrays.asList(mSubscriptions);
- }
+ public final DownloadableSubscription[] subscriptions;
/**
* Construct a new {@link GetDefaultDownloadableSubscriptionListResult}.
@@ -88,25 +70,25 @@
@Nullable DownloadableSubscription[] subscriptions) {
this.result = result;
if (this.result == EuiccService.RESULT_OK) {
- this.mSubscriptions = subscriptions;
+ this.subscriptions = subscriptions;
} else {
if (subscriptions != null) {
throw new IllegalArgumentException(
"Error result with non-null subscriptions: " + result);
}
- this.mSubscriptions = null;
+ this.subscriptions = null;
}
}
private GetDefaultDownloadableSubscriptionListResult(Parcel in) {
this.result = in.readInt();
- this.mSubscriptions = in.createTypedArray(DownloadableSubscription.CREATOR);
+ this.subscriptions = in.createTypedArray(DownloadableSubscription.CREATOR);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(result);
- dest.writeTypedArray(mSubscriptions, flags);
+ dest.writeTypedArray(subscriptions, flags);
}
@Override
diff --git a/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java b/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
index 1edb539..de8a307 100644
--- a/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
+++ b/core/java/android/service/euicc/GetDownloadableSubscriptionMetadataResult.java
@@ -16,7 +16,6 @@
package android.service.euicc;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.euicc.DownloadableSubscription;
@@ -24,8 +23,9 @@
/**
* Result of a {@link EuiccService#onGetDownloadableSubscriptionMetadata} operation.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public final class GetDownloadableSubscriptionMetadataResult implements Parcelable {
public static final Creator<GetDownloadableSubscriptionMetadataResult> CREATOR =
@@ -42,34 +42,20 @@
};
/**
- * @hide
- * @deprecated - Do no use. Use getResult() instead.
- */
- @Deprecated
- public final int result;
-
- @Nullable
- private final DownloadableSubscription mSubscription;
-
- /**
- * Gets the result of the operation.
+ * Result of the operation.
*
* <p>May be one of the predefined {@code RESULT_} constants in EuiccService or any
* implementation-specific code starting with {@link EuiccService#RESULT_FIRST_USER}.
*/
- public int getResult() {
- return result;
- }
+ public final int result;
/**
- * Gets the {@link DownloadableSubscription} with filled-in metadata.
+ * The {@link DownloadableSubscription} with filled-in metadata.
*
* <p>Only non-null if {@link #result} is {@link EuiccService#RESULT_OK}.
*/
@Nullable
- public DownloadableSubscription getDownloadableSubscription() {
- return mSubscription;
- }
+ public final DownloadableSubscription subscription;
/**
* Construct a new {@link GetDownloadableSubscriptionMetadataResult}.
@@ -84,25 +70,25 @@
@Nullable DownloadableSubscription subscription) {
this.result = result;
if (this.result == EuiccService.RESULT_OK) {
- this.mSubscription = subscription;
+ this.subscription = subscription;
} else {
if (subscription != null) {
throw new IllegalArgumentException(
"Error result with non-null subscription: " + result);
}
- this.mSubscription = null;
+ this.subscription = null;
}
}
private GetDownloadableSubscriptionMetadataResult(Parcel in) {
this.result = in.readInt();
- this.mSubscription = in.readTypedObject(DownloadableSubscription.CREATOR);
+ this.subscription = in.readTypedObject(DownloadableSubscription.CREATOR);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(result);
- dest.writeTypedObject(this.mSubscription, flags);
+ dest.writeTypedObject(this.subscription, flags);
}
@Override
diff --git a/core/java/android/service/euicc/GetEuiccProfileInfoListResult.java b/core/java/android/service/euicc/GetEuiccProfileInfoListResult.java
index 464d136..7ad8488 100644
--- a/core/java/android/service/euicc/GetEuiccProfileInfoListResult.java
+++ b/core/java/android/service/euicc/GetEuiccProfileInfoListResult.java
@@ -16,18 +16,15 @@
package android.service.euicc;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
-import java.util.Arrays;
-import java.util.List;
-
/**
* Result of a {@link EuiccService#onGetEuiccProfileInfoList} operation.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public final class GetEuiccProfileInfoListResult implements Parcelable {
public static final Creator<GetEuiccProfileInfoListResult> CREATOR =
@@ -44,38 +41,19 @@
};
/**
- * @hide
- * @deprecated - Do no use. Use getResult() instead.
- */
- @Deprecated
- public final int result;
-
- @Nullable
- private final EuiccProfileInfo[] mProfiles;
-
- private final boolean mIsRemovable;
-
- /**
- * Gets the result of the operation.
+ * Result of the operation.
*
* <p>May be one of the predefined {@code RESULT_} constants in EuiccService or any
* implementation-specific code starting with {@link EuiccService#RESULT_FIRST_USER}.
*/
- public int getResult() {
- return result;
- }
+ public final int result;
- /** Gets the profile list (only upon success). */
+ /** The profile list (only upon success). */
@Nullable
- public List<EuiccProfileInfo> getProfiles() {
- if (mProfiles == null) return null;
- return Arrays.asList(mProfiles);
- }
+ public final EuiccProfileInfo[] profiles;
- /** Gets whether the eUICC is removable. */
- public boolean getIsRemovable() {
- return mIsRemovable;
- }
+ /** Whether the eUICC is removable. */
+ public final boolean isRemovable;
/**
* Construct a new {@link GetEuiccProfileInfoListResult}.
@@ -93,29 +71,30 @@
public GetEuiccProfileInfoListResult(
int result, @Nullable EuiccProfileInfo[] profiles, boolean isRemovable) {
this.result = result;
- this.mIsRemovable = isRemovable;
+ this.isRemovable = isRemovable;
if (this.result == EuiccService.RESULT_OK) {
- this.mProfiles = profiles;
+ this.profiles = profiles;
} else {
if (profiles != null) {
throw new IllegalArgumentException(
"Error result with non-null profiles: " + result);
}
- this.mProfiles = null;
+ this.profiles = null;
}
+
}
private GetEuiccProfileInfoListResult(Parcel in) {
this.result = in.readInt();
- this.mProfiles = in.createTypedArray(EuiccProfileInfo.CREATOR);
- this.mIsRemovable = in.readBoolean();
+ this.profiles = in.createTypedArray(EuiccProfileInfo.CREATOR);
+ this.isRemovable = in.readBoolean();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(result);
- dest.writeTypedArray(mProfiles, flags);
- dest.writeBoolean(mIsRemovable);
+ dest.writeTypedArray(profiles, flags);
+ dest.writeBoolean(isRemovable);
}
@Override
diff --git a/core/java/android/text/OWNERS b/core/java/android/text/OWNERS
index 0f85e1f..9f2182e 100644
--- a/core/java/android/text/OWNERS
+++ b/core/java/android/text/OWNERS
@@ -1,4 +1,3 @@
siyamed@google.com
nona@google.com
clarabayarri@google.com
-toki@google.com
diff --git a/core/java/android/transition/ArcMotion.java b/core/java/android/transition/ArcMotion.java
index da14834..172c837 100644
--- a/core/java/android/transition/ArcMotion.java
+++ b/core/java/android/transition/ArcMotion.java
@@ -216,7 +216,13 @@
boolean isMovingUpwards = startY > endY;
- if ((Math.abs(deltaX) < Math.abs(deltaY))) {
+ if (deltaY == 0) {
+ ex = dx;
+ ey = dy + (Math.abs(deltaX) * 0.5f * mMinimumHorizontalTangent);
+ } else if (deltaX == 0) {
+ ex = dx + (Math.abs(deltaY) * 0.5f * mMinimumVerticalTangent);
+ ey = dy;
+ } else if ((Math.abs(deltaX) < Math.abs(deltaY))) {
// Similar triangles bfa and bde mean that (ab/fb = eb/bd)
// Therefore, eb = ab * bd / fb
// ab = hypotenuse
@@ -254,7 +260,7 @@
float maximumArcDist2 = midDist2 * mMaximumTangent * mMaximumTangent;
float newArcDistance2 = 0;
- if (arcDist2 < minimumArcDist2) {
+ if (arcDist2 != 0 && arcDist2 < minimumArcDist2) {
newArcDistance2 = minimumArcDist2;
} else if (arcDist2 > maximumArcDist2) {
newArcDistance2 = maximumArcDist2;
diff --git a/core/java/android/util/StatsManager.java b/core/java/android/util/StatsManager.java
deleted file mode 100644
index 51fb18a..0000000
--- a/core/java/android/util/StatsManager.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.util;
-
-import android.Manifest;
-import android.annotation.RequiresPermission;
-import android.os.IBinder;
-import android.os.IStatsManager;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-
-
-/*
- *
- *
- *
- *
- * THIS ENTIRE FILE IS ONLY TEMPORARY TO PREVENT BREAKAGES OF DEPENDENCIES ON OLD APIS.
- * The new StatsManager is to be found in android.app.StatsManager.
- * TODO: Delete this file!
- *
- *
- *
- *
- */
-
-
-/**
- * API for StatsD clients to send configurations and retrieve data.
- *
- * @hide
- */
-public class StatsManager {
- IStatsManager mService;
- private static final String TAG = "StatsManager";
-
- /**
- * Constructor for StatsManagerClient.
- *
- * @hide
- */
- public StatsManager() {
- }
-
- /**
- * Temporary to prevent build failures. Will be deleted.
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public boolean addConfiguration(String configKey, byte[] config, String pkg, String cls) {
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when adding configuration");
- return false;
- }
- return service.addConfiguration(Long.parseLong(configKey), config, pkg, cls);
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connect to statsd when adding configuration");
- return false;
- }
- }
- }
-
- /**
- * Clients can send a configuration and simultaneously registers the name of a broadcast
- * receiver that listens for when it should request data.
- *
- * @param configKey An arbitrary integer that allows clients to track the configuration.
- * @param config Wire-encoded StatsDConfig proto that specifies metrics (and all
- * dependencies eg, conditions and matchers).
- * @param pkg The package name to receive the broadcast.
- * @param cls The name of the class that receives the broadcast.
- * @return true if successful
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public boolean addConfiguration(long configKey, byte[] config, String pkg, String cls) {
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when adding configuration");
- return false;
- }
- return service.addConfiguration(configKey, config, pkg, cls);
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connect to statsd when adding configuration");
- return false;
- }
- }
- }
-
- /**
- * Temporary to prevent build failures. Will be deleted.
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public boolean removeConfiguration(String configKey) {
- // To prevent breakages of old dependencies.
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when removing configuration");
- return false;
- }
- return service.removeConfiguration(Long.parseLong(configKey));
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connect to statsd when removing configuration");
- return false;
- }
- }
- }
-
- /**
- * Remove a configuration from logging.
- *
- * @param configKey Configuration key to remove.
- * @return true if successful
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public boolean removeConfiguration(long configKey) {
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when removing configuration");
- return false;
- }
- return service.removeConfiguration(configKey);
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connect to statsd when removing configuration");
- return false;
- }
- }
- }
-
- /**
- * Temporary to prevent build failures. Will be deleted.
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public byte[] getData(String configKey) {
- // TODO: remove this and all other methods with String-based config keys.
- // To prevent build breakages of dependencies.
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when getting data");
- return null;
- }
- return service.getData(Long.parseLong(configKey));
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connecto statsd when getting data");
- return null;
- }
- }
- }
-
- /**
- * Clients can request data with a binder call. This getter is destructive and also clears
- * the retrieved metrics from statsd memory.
- *
- * @param configKey Configuration key to retrieve data from.
- * @return Serialized ConfigMetricsReportList proto. Returns null on failure.
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public byte[] getData(long configKey) {
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when getting data");
- return null;
- }
- return service.getData(configKey);
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connecto statsd when getting data");
- return null;
- }
- }
- }
-
- /**
- * Clients can request metadata for statsd. Will contain stats across all configurations but not
- * the actual metrics themselves (metrics must be collected via {@link #getData(String)}.
- * This getter is not destructive and will not reset any metrics/counters.
- *
- * @return Serialized StatsdStatsReport proto. Returns null on failure.
- */
- @RequiresPermission(Manifest.permission.DUMP)
- public byte[] getMetadata() {
- synchronized (this) {
- try {
- IStatsManager service = getIStatsManagerLocked();
- if (service == null) {
- Slog.d(TAG, "Failed to find statsd when getting metadata");
- return null;
- }
- return service.getMetadata();
- } catch (RemoteException e) {
- Slog.d(TAG, "Failed to connecto statsd when getting metadata");
- return null;
- }
- }
- }
-
- private class StatsdDeathRecipient implements IBinder.DeathRecipient {
- @Override
- public void binderDied() {
- synchronized (this) {
- mService = null;
- }
- }
- }
-
- private IStatsManager getIStatsManagerLocked() throws RemoteException {
- if (mService != null) {
- return mService;
- }
- mService = IStatsManager.Stub.asInterface(ServiceManager.getService("stats"));
- if (mService != null) {
- mService.asBinder().linkToDeath(new StatsdDeathRecipient(), 0);
- }
- return mService;
- }
-}
diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/core/java/android/view/IRecentsAnimationRunner.aidl
index ea6226b..69973e6 100644
--- a/core/java/android/view/IRecentsAnimationRunner.aidl
+++ b/core/java/android/view/IRecentsAnimationRunner.aidl
@@ -16,6 +16,7 @@
package android.view;
+import android.graphics.Rect;
import android.view.RemoteAnimationTarget;
import android.view.IRecentsAnimationController;
@@ -28,15 +29,26 @@
oneway interface IRecentsAnimationRunner {
/**
- * Called when the system is ready for the handler to start animating all the visible tasks.
+ * Deprecated, to be removed once Launcher updates
*/
void onAnimationStart(in IRecentsAnimationController controller,
- in RemoteAnimationTarget[] apps);
+ in RemoteAnimationTarget[] apps) = 0;
/**
* Called when the system needs to cancel the current animation. This can be due to the
* wallpaper not drawing in time, or the handler not finishing the animation within a predefined
* amount of time.
*/
- void onAnimationCanceled();
+ void onAnimationCanceled() = 1;
+
+ /**
+ * Called when the system is ready for the handler to start animating all the visible tasks.
+ *
+ * @param homeContentInsets The current home app content insets
+ * @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
+ * {@code null} if the device is not currently in split screen
+ */
+ void onAnimationStart_New(in IRecentsAnimationController controller,
+ in RemoteAnimationTarget[] apps, in Rect homeContentInsets,
+ in Rect minimizedHomeBounds) = 2;
}
diff --git a/core/java/android/view/RemoteAnimationTarget.java b/core/java/android/view/RemoteAnimationTarget.java
index c28c389..facf575 100644
--- a/core/java/android/view/RemoteAnimationTarget.java
+++ b/core/java/android/view/RemoteAnimationTarget.java
@@ -79,6 +79,11 @@
public final Rect clipRect;
/**
+ * The insets of the main app window.
+ */
+ public final Rect contentInsets;
+
+ /**
* The index of the element in the tree in prefix order. This should be used for z-layering
* to preserve original z-layer order in the hierarchy tree assuming no "boosting" needs to
* happen.
@@ -105,13 +110,14 @@
public final WindowConfiguration windowConfiguration;
public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
- Rect clipRect, int prefixOrderIndex, Point position, Rect sourceContainerBounds,
- WindowConfiguration windowConfig) {
+ Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
+ Rect sourceContainerBounds, WindowConfiguration windowConfig) {
this.mode = mode;
this.taskId = taskId;
this.leash = leash;
this.isTranslucent = isTranslucent;
this.clipRect = new Rect(clipRect);
+ this.contentInsets = new Rect(contentInsets);
this.prefixOrderIndex = prefixOrderIndex;
this.position = new Point(position);
this.sourceContainerBounds = new Rect(sourceContainerBounds);
@@ -124,6 +130,7 @@
leash = in.readParcelable(null);
isTranslucent = in.readBoolean();
clipRect = in.readParcelable(null);
+ contentInsets = in.readParcelable(null);
prefixOrderIndex = in.readInt();
position = in.readParcelable(null);
sourceContainerBounds = in.readParcelable(null);
@@ -142,6 +149,7 @@
dest.writeParcelable(leash, 0 /* flags */);
dest.writeBoolean(isTranslucent);
dest.writeParcelable(clipRect, 0 /* flags */);
+ dest.writeParcelable(contentInsets, 0 /* flags */);
dest.writeInt(prefixOrderIndex);
dest.writeParcelable(position, 0 /* flags */);
dest.writeParcelable(sourceContainerBounds, 0 /* flags */);
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 23e7d61..417a725 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -3173,6 +3173,15 @@
*/
@Override
public void writeToParcel(Parcel parcel, int flags) {
+ writeToParcelNoRecycle(parcel, flags);
+ // Since instances of this class are fetched via synchronous i.e. blocking
+ // calls in IPCs we always recycle as soon as the instance is marshaled.
+ recycle();
+ }
+
+ /** @hide */
+ @TestApi
+ public void writeToParcelNoRecycle(Parcel parcel, int flags) {
// Write bit set of indices of fields with values differing from default
long nonDefaultFields = 0;
int fieldIndex = 0; // index of the current field
@@ -3406,10 +3415,6 @@
+ " vs " + fieldIndex);
}
}
-
- // Since instances of this class are fetched via synchronous i.e. blocking
- // calls in IPCs we always recycle as soon as the instance is marshaled.
- recycle();
}
/**
@@ -3557,7 +3562,7 @@
if (isBitSet(nonDefaultFields, fieldIndex++)) {
mContentDescription = parcel.readCharSequence();
}
- if (isBitSet(nonDefaultFields, fieldIndex++)) mPaneTitle = parcel.readString();
+ if (isBitSet(nonDefaultFields, fieldIndex++)) mPaneTitle = parcel.readCharSequence();
if (isBitSet(nonDefaultFields, fieldIndex++)) mTooltipText = parcel.readCharSequence();
if (isBitSet(nonDefaultFields, fieldIndex++)) mViewIdResourceName = parcel.readString();
diff --git a/core/java/android/widget/OWNERS b/core/java/android/widget/OWNERS
index 8f0d02f..2789bae 100644
--- a/core/java/android/widget/OWNERS
+++ b/core/java/android/widget/OWNERS
@@ -1,12 +1,9 @@
per-file TextView.java = siyamed@google.com
per-file TextView.java = nona@google.com
per-file TextView.java = clarabayarri@google.com
-per-file TextView.java = toki@google.com
per-file EditText.java = siyamed@google.com
per-file EditText.java = nona@google.com
per-file EditText.java = clarabayarri@google.com
-per-file EditText.java = toki@google.com
per-file Editor.java = siyamed@google.com
per-file Editor.java = nona@google.com
per-file Editor.java = clarabayarri@google.com
-per-file Editor.java = toki@google.com
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index ecab15f..467e2a4 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -678,7 +678,8 @@
StopwatchTimer mCameraOnTimer;
int mGpsSignalQualityBin = -1;
- final StopwatchTimer[] mGpsSignalQualityTimer =
+ @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
+ protected final StopwatchTimer[] mGpsSignalQualityTimer =
new StopwatchTimer[GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS];
int mPhoneSignalStrengthBin = -1;
@@ -760,6 +761,8 @@
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
protected StopwatchTimer mBluetoothScanTimer;
+ boolean mIsCellularTxPowerHigh = false;
+
int mMobileRadioPowerState = DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
long mMobileRadioActiveStartTime;
StopwatchTimer mMobileRadioActiveTimer;
@@ -11211,6 +11214,9 @@
Slog.d(TAG, "Updating mobile radio stats with " + activityInfo);
}
+ // Add modem tx power to history.
+ addModemTxPowerToHistory(activityInfo);
+
// Grab a separate lock to acquire the network stats, which may do I/O.
NetworkStats delta = null;
synchronized (mModemNetworkLock) {
@@ -11385,6 +11391,44 @@
new BluetoothActivityEnergyInfo(0, 0, 0, 0, 0, 0);
/**
+ * Add modem tx power to history
+ * Device is said to be in high cellular transmit power when it has spent most of the transmit
+ * time at the highest power level.
+ * @param activityInfo
+ */
+ private void addModemTxPowerToHistory(final ModemActivityInfo activityInfo) {
+ if (activityInfo == null) {
+ return;
+ }
+ int[] txTimeMs = activityInfo.getTxTimeMillis();
+ if (txTimeMs == null || txTimeMs.length != ModemActivityInfo.TX_POWER_LEVELS) {
+ return;
+ }
+ final long elapsedRealtime = mClocks.elapsedRealtime();
+ final long uptime = mClocks.uptimeMillis();
+ int levelMaxTimeSpent = 0;
+ for (int i = 1; i < txTimeMs.length; i++) {
+ if (txTimeMs[i] > txTimeMs[levelMaxTimeSpent]) {
+ levelMaxTimeSpent = i;
+ }
+ }
+ if (levelMaxTimeSpent == ModemActivityInfo.TX_POWER_LEVELS - 1) {
+ if (!mIsCellularTxPowerHigh) {
+ mHistoryCur.states2 |= HistoryItem.STATE2_CELLULAR_HIGH_TX_POWER_FLAG;
+ addHistoryRecordLocked(elapsedRealtime, uptime);
+ mIsCellularTxPowerHigh = true;
+ }
+ return;
+ }
+ if (mIsCellularTxPowerHigh) {
+ mHistoryCur.states2 &= ~HistoryItem.STATE2_CELLULAR_HIGH_TX_POWER_FLAG;
+ addHistoryRecordLocked(elapsedRealtime, uptime);
+ mIsCellularTxPowerHigh = false;
+ }
+ return;
+ }
+
+ /**
* Distribute Bluetooth energy info and network traffic to apps.
* @param info The energy information from the bluetooth controller.
*/
@@ -13537,6 +13581,7 @@
mCameraOnTimer.readSummaryFromParcelLocked(in);
mBluetoothScanNesting = 0;
mBluetoothScanTimer.readSummaryFromParcelLocked(in);
+ mIsCellularTxPowerHigh = false;
int NRPMS = in.readInt();
if (NRPMS > 10000) {
@@ -14473,6 +14518,7 @@
mCameraOnTimer = new StopwatchTimer(mClocks, null, -13, null, mOnBatteryTimeBase, in);
mBluetoothScanNesting = 0;
mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase, in);
+ mIsCellularTxPowerHigh = false;
mDischargeUnplugLevel = in.readInt();
mDischargePlugLevel = in.readInt();
mDischargeCurrentLevel = in.readInt();
diff --git a/core/jni/android/graphics/FontFamily.cpp b/core/jni/android/graphics/FontFamily.cpp
index f6223fa..ed032c7 100644
--- a/core/jni/android/graphics/FontFamily.cpp
+++ b/core/jni/android/graphics/FontFamily.cpp
@@ -90,7 +90,7 @@
}
static bool addSkTypeface(NativeFamilyBuilder* builder, sk_sp<SkData>&& data, int ttcIndex,
- jint givenWeight, jint givenItalic) {
+ jint weight, jint italic) {
uirenderer::FatVector<SkFontArguments::Axis, 2> skiaAxes;
for (const auto& axis : builder->axes) {
skiaAxes.emplace_back(SkFontArguments::Axis{axis.axisTag, axis.value});
@@ -114,27 +114,15 @@
std::shared_ptr<minikin::MinikinFont> minikinFont =
std::make_shared<MinikinFontSkia>(std::move(face), fontPtr, fontSize, ttcIndex,
builder->axes);
+ minikin::Font::Builder fontBuilder(minikinFont);
- int weight = givenWeight;
- bool italic = givenItalic == 1;
- if (givenWeight == RESOLVE_BY_FONT_TABLE || givenItalic == RESOLVE_BY_FONT_TABLE) {
- int os2Weight;
- bool os2Italic;
- if (!minikin::FontFamily::analyzeStyle(minikinFont, &os2Weight, &os2Italic)) {
- ALOGE("analyzeStyle failed. Using default style");
- os2Weight = 400;
- os2Italic = false;
- }
- if (givenWeight == RESOLVE_BY_FONT_TABLE) {
- weight = os2Weight;
- }
- if (givenItalic == RESOLVE_BY_FONT_TABLE) {
- italic = os2Italic;
- }
+ if (weight != RESOLVE_BY_FONT_TABLE) {
+ fontBuilder.setWeight(weight);
}
-
- builder->fonts.push_back(minikin::Font(minikinFont,
- minikin::FontStyle(weight, static_cast<minikin::FontStyle::Slant>(italic))));
+ if (italic != RESOLVE_BY_FONT_TABLE) {
+ fontBuilder.setSlant(static_cast<minikin::FontStyle::Slant>(italic != 0));
+ }
+ builder->fonts.push_back(fontBuilder.build());
builder->axes.clear();
return true;
}
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 115d0d5..482d028 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -576,7 +576,7 @@
minikin::FakedFont baseFont = typeface->fFontCollection->baseFontFaked(typeface->fStyle);
float saveSkewX = paint->getTextSkewX();
bool savefakeBold = paint->isFakeBoldText();
- MinikinFontSkia::populateSkPaint(paint, baseFont.font, baseFont.fakery);
+ MinikinFontSkia::populateSkPaint(paint, baseFont.font->typeface().get(), baseFont.fakery);
SkScalar spacing = paint->getFontMetrics(metrics);
// The populateSkPaint call may have changed fake bold / text skew
// because we want to measure with those effects applied, so now
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index a718442..deefddb 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1811,20 +1811,19 @@
<permission android:name="android.permission.BIND_TELEPHONY_NETWORK_SERVICE"
android:protectionLevel="signature" />
- <!-- @SystemApi Allows an application to manage embedded subscriptions (those on a eUICC)
- through EuiccManager APIs.
+ <!-- Allows an application to manage embedded subscriptions (those on a eUICC) through
+ EuiccManager APIs.
<p>Protection level: signature|privileged|development
- @hide
- -->
- <permission android:name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"
+ TODO(b/35851809): Mark this as a SystemApi and remove com. prefix.
+ @hide -->
+ <permission android:name="com.android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"
android:protectionLevel="signature|privileged|development" />
- <!-- @SystemApi Must be required by an EuiccService to ensure that only the system can bind to
- it.
+ <!-- Must be required by an EuiccService to ensure that only the system can bind to it.
<p>Protection level: signature
- @hide
- -->
- <permission android:name="android.permission.BIND_EUICC_SERVICE"
+ TODO(b/35851809): Mark this as a SystemApi and remove com. prefix.
+ @hide -->
+ <permission android:name="com.android.permission.BIND_EUICC_SERVICE"
android:protectionLevel="signature" />
<!-- ================================== -->
diff --git a/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java b/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
index e69d1e7..1e3ddf3 100644
--- a/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
+++ b/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
@@ -30,15 +30,14 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.util.Arrays;
-
@SmallTest
@RunWith(AndroidJUnit4.class)
public class EuiccProfileInfoTest {
@Test
public void testWriteToParcel() {
EuiccProfileInfo p =
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
+ .setIccid("21430000000000006587")
.setNickname("profile nickname")
.setServiceProviderName("service provider")
.setProfileName("profile name")
@@ -51,7 +50,9 @@
"45"))
.setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
.setUiccAccessRule(
- Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L)))
+ new UiccAccessRule[] {
+ new UiccAccessRule(new byte[] {}, "package", 12345L)
+ })
.build();
Parcel parcel = Parcel.obtain();
@@ -67,7 +68,8 @@
@Test
public void testWriteToParcelNullCarrierId() {
EuiccProfileInfo p =
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
+ .setIccid("21430000000000006587")
.setNickname("profile nickname")
.setServiceProviderName("service provider")
.setProfileName("profile name")
@@ -75,8 +77,9 @@
.setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
.setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
.setUiccAccessRule(
- Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L))
- )
+ new UiccAccessRule[] {
+ new UiccAccessRule(new byte[] {}, "package", 12345L)
+ })
.build();
Parcel parcel = Parcel.obtain();
@@ -92,7 +95,8 @@
@Test
public void testBuilderAndGetters() {
EuiccProfileInfo p =
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
+ .setIccid("21430000000000006587")
.setNickname("profile nickname")
.setProfileName("profile name")
.setServiceProviderName("service provider")
@@ -104,7 +108,10 @@
.setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
.setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
.setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
- .setUiccAccessRule(Arrays.asList(new UiccAccessRule(new byte[0], null, 0)))
+ .setUiccAccessRule(
+ new UiccAccessRule[] {
+ new UiccAccessRule(new byte[0], null, 0)
+ })
.build();
assertEquals("21430000000000006587", p.getIccid());
@@ -123,13 +130,14 @@
assertFalse(p.hasPolicyRule(EuiccProfileInfo.POLICY_RULE_DO_NOT_DISABLE));
assertArrayEquals(
new UiccAccessRule[] {new UiccAccessRule(new byte[0], null, 0)},
- p.getUiccAccessRules().toArray());
+ p.getUiccAccessRules());
}
@Test
public void testBuilder_BasedOnAnotherProfile() {
EuiccProfileInfo p =
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
+ .setIccid("21430000000000006587")
.setNickname("profile nickname")
.setProfileName("profile name")
.setServiceProviderName("service provider")
@@ -142,7 +150,9 @@
.setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL)
.setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
.setUiccAccessRule(
- Arrays.asList(new UiccAccessRule(new byte[] {}, "package", 12345L)))
+ new UiccAccessRule[] {
+ new UiccAccessRule(new byte[0], null, 0)
+ })
.build();
EuiccProfileInfo copied = new EuiccProfileInfo.Builder(p).build();
@@ -154,7 +164,8 @@
@Test
public void testEqualsHashCode() {
EuiccProfileInfo p =
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
+ .setIccid("21430000000000006587")
.setNickname("profile nickname")
.setProfileName("profile name")
.setServiceProviderName("service provider")
@@ -166,7 +177,10 @@
.setState(EuiccProfileInfo.PROFILE_STATE_ENABLED)
.setProfileClass(EuiccProfileInfo.PROFILE_STATE_ENABLED)
.setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE)
- .setUiccAccessRule(Arrays.asList(new UiccAccessRule(new byte[0], null, 0)))
+ .setUiccAccessRule(
+ new UiccAccessRule[] {
+ new UiccAccessRule(new byte[0], null, 0)
+ })
.build();
assertTrue(p.equals(p));
@@ -215,13 +229,13 @@
}
@Test(expected = IllegalStateException.class)
- public void testBuilderBuild_IllegalIccid() {
- new EuiccProfileInfo.Builder("abc").build();
+ public void testBuilderBuild_NoIccid() {
+ new EuiccProfileInfo.Builder().build();
}
@Test(expected = IllegalArgumentException.class)
public void testBuilderSetOperatorMccMnc_Illegal() {
- new EuiccProfileInfo.Builder("21430000000000006587")
+ new EuiccProfileInfo.Builder()
.setCarrierIdentifier(new CarrierIdentifier(new byte[] {1, 2, 3, 4}, null, null));
}
diff --git a/core/tests/coretests/src/android/text/OWNERS b/core/tests/coretests/src/android/text/OWNERS
index 0f85e1f..9f2182e 100644
--- a/core/tests/coretests/src/android/text/OWNERS
+++ b/core/tests/coretests/src/android/text/OWNERS
@@ -1,4 +1,3 @@
siyamed@google.com
nona@google.com
clarabayarri@google.com
-toki@google.com
diff --git a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
index 660c744..7b239f0 100644
--- a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
+++ b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
@@ -20,6 +20,7 @@
import android.os.Looper;
import android.util.SparseIntArray;
+import com.android.internal.location.gnssmetrics.GnssMetrics;
import java.util.ArrayList;
import java.util.concurrent.Future;
@@ -40,6 +41,11 @@
mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase);
setExternalStatsSyncLocked(new DummyExternalStatsSync());
+ for (int i=0; i< GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS; i++) {
+ mGpsSignalQualityTimer[i] = new StopwatchTimer(clocks, null, -1000-i, null,
+ mOnBatteryTimeBase);
+ }
+
// A no-op handler.
mHandler = new Handler(Looper.getMainLooper()) {};
}
diff --git a/graphics/java/android/graphics/drawable/RippleForeground.java b/graphics/java/android/graphics/drawable/RippleForeground.java
index 4129868..a8dc34a 100644
--- a/graphics/java/android/graphics/drawable/RippleForeground.java
+++ b/graphics/java/android/graphics/drawable/RippleForeground.java
@@ -110,6 +110,7 @@
// Take 60% of the maximum of the width and height, then divided half to get the radius.
mStartRadius = Math.max(bounds.width(), bounds.height()) * 0.3f;
+ clampStartingPosition();
}
@Override
@@ -350,7 +351,7 @@
final float cY = mBounds.exactCenterY();
final float dX = mStartingX - cX;
final float dY = mStartingY - cY;
- final float r = mTargetRadius;
+ final float r = mTargetRadius - mStartRadius;
if (dX * dX + dY * dY > r * r) {
// Point is outside the circle, clamp to the perimeter.
final double angle = Math.atan2(dY, dX);
diff --git a/libs/hwui/hwui/Typeface.cpp b/libs/hwui/hwui/Typeface.cpp
index 091b526..dca9ef5 100644
--- a/libs/hwui/hwui/Typeface.cpp
+++ b/libs/hwui/hwui/Typeface.cpp
@@ -132,8 +132,8 @@
bool italicFromFont;
const minikin::FontStyle defaultStyle;
- const minikin::MinikinFont* mf =
- families.empty() ? nullptr : families[0]->getClosestMatch(defaultStyle).font;
+ const minikin::MinikinFont* mf = families.empty() ? nullptr
+ : families[0]->getClosestMatch(defaultStyle).font->typeface().get();
if (mf != nullptr) {
SkTypeface* skTypeface = reinterpret_cast<const MinikinFontSkia*>(mf)->GetSkTypeface();
const SkFontStyle& style = skTypeface->fontStyle();
@@ -183,7 +183,7 @@
std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
std::vector<minikin::Font> fonts;
- fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));
+ fonts.push_back(minikin::Font::Builder(font).build());
std::shared_ptr<minikin::FontCollection> collection = std::make_shared<minikin::FontCollection>(
std::make_shared<minikin::FontFamily>(std::move(fonts)));
diff --git a/libs/hwui/tests/unit/TypefaceTests.cpp b/libs/hwui/tests/unit/TypefaceTests.cpp
index 2232c25..e424a26 100644
--- a/libs/hwui/tests/unit/TypefaceTests.cpp
+++ b/libs/hwui/tests/unit/TypefaceTests.cpp
@@ -57,7 +57,7 @@
std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
std::vector<minikin::Font> fonts;
- fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));
+ fonts.push_back(minikin::Font::Builder(font).build());
return std::make_shared<minikin::FontFamily>(std::move(fonts));
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
index ed3696c..f7aa297 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
@@ -158,6 +158,9 @@
usage.startDate = start;
usage.usageLevel = totalBytes;
usage.period = formatDateRange(start, end);
+ usage.cycleStart = start;
+ usage.cycleEnd = end;
+
if (policy != null) {
usage.limitLevel = policy.limitBytes > 0 ? policy.limitBytes : 0;
usage.warningLevel = policy.warningBytes > 0 ? policy.warningBytes : 0;
@@ -245,6 +248,8 @@
public long limitLevel;
public long warningLevel;
public long usageLevel;
+ public long cycleStart;
+ public long cycleEnd;
}
public interface Callback {
diff --git a/packages/SystemUI/Android.mk b/packages/SystemUI/Android.mk
index 2bcf4ef..1e48213 100644
--- a/packages/SystemUI/Android.mk
+++ b/packages/SystemUI/Android.mk
@@ -56,7 +56,6 @@
SystemUI-proto
LOCAL_JAVA_LIBRARIES := telephony-common
-LOCAL_JAVA_LIBRARIES += android.car
LOCAL_PACKAGE_NAME := SystemUI
LOCAL_CERTIFICATE := platform
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 9613a6a..cbb3e8f 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -176,9 +176,6 @@
<!-- It's like, reality, but, you know, virtual -->
<uses-permission android:name="android.permission.ACCESS_VR_MANAGER" />
- <!-- To control car audio module volume -->
- <uses-permission android:name="android.car.permission.CAR_CONTROL_AUDIO_VOLUME" />
-
<!-- the ability to rename notifications posted by other apps -->
<uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" />
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
index 90e3b1e..62bd72f 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
@@ -43,6 +43,7 @@
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Bitmap;
+import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -57,6 +58,7 @@
import android.view.IRecentsAnimationRunner;
import android.view.RemoteAnimationTarget;
+import android.view.WindowManagerGlobal;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -271,11 +273,20 @@
runner = new IRecentsAnimationRunner.Stub() {
public void onAnimationStart(IRecentsAnimationController controller,
RemoteAnimationTarget[] apps) {
+ final Rect stableInsets = new Rect();
+ WindowManagerWrapper.getInstance().getStableInsets(stableInsets);
+ onAnimationStart_New(controller, apps, stableInsets, null);
+ }
+
+ public void onAnimationStart_New(IRecentsAnimationController controller,
+ RemoteAnimationTarget[] apps, Rect homeContentInsets,
+ Rect minimizedHomeBounds) {
final RecentsAnimationControllerCompat controllerCompat =
new RecentsAnimationControllerCompat(controller);
final RemoteAnimationTargetCompat[] appsCompat =
RemoteAnimationTargetCompat.wrap(apps);
- animationHandler.onAnimationStart(controllerCompat, appsCompat);
+ animationHandler.onAnimationStart(controllerCompat, appsCompat,
+ homeContentInsets, minimizedHomeBounds);
}
public void onAnimationCanceled() {
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
index bf6179d..a473db1 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
@@ -16,13 +16,15 @@
package com.android.systemui.shared.system;
+import android.graphics.Rect;
+
public interface RecentsAnimationListener {
/**
* Called when the animation into Recents can start. This call is made on the binder thread.
*/
void onAnimationStart(RecentsAnimationControllerCompat controller,
- RemoteAnimationTargetCompat[] apps);
+ RemoteAnimationTargetCompat[] apps, Rect homeContentInsets, Rect minimizedHomeBounds);
/**
* Called when the animation into Recents was canceled. This call is made on the binder thread.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
index 3871980..b8c5049 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
@@ -16,6 +16,9 @@
package com.android.systemui.shared.system;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
+
+import android.app.WindowConfiguration;
import android.graphics.Point;
import android.graphics.Rect;
import android.view.RemoteAnimationTarget;
@@ -37,7 +40,10 @@
public final Point position;
public final Rect sourceContainerBounds;
+ private final RemoteAnimationTarget mTarget;
+
public RemoteAnimationTargetCompat(RemoteAnimationTarget app) {
+ mTarget = app;
taskId = app.taskId;
mode = app.mode;
leash = new SurfaceControlCompat(app.leash);
@@ -56,4 +62,18 @@
}
return appsCompat;
}
+
+ /**
+ * TODO: Get as a method for compatibility (will move into ctor once Launcher updates)
+ */
+ public Rect getContentInsets() {
+ return mTarget.contentInsets;
+ }
+
+ /**
+ * TODO: Get as a method for compatibility (will move into ctor once Launcher updates)
+ */
+ public boolean isAssistantActivityType() {
+ return mTarget.windowConfiguration.getActivityType() == ACTIVITY_TYPE_ASSISTANT;
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/shared/tests/Android.mk b/packages/SystemUI/shared/tests/Android.mk
index 239a4e3..1715983 100644
--- a/packages/SystemUI/shared/tests/Android.mk
+++ b/packages/SystemUI/shared/tests/Android.mk
@@ -41,7 +41,7 @@
testables \
truth-prebuilt \
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common
# sign this with platform cert, so this test is allowed to inject key events into
# UI it doesn't own. This is necessary to allow screenshots to be taken
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java b/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
index a44fd9a..b8f6784 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
@@ -14,8 +14,11 @@
package com.android.systemui.qs;
+import android.animation.ObjectAnimator;
import android.content.Context;
+import android.graphics.Canvas;
import android.support.v4.widget.NestedScrollView;
+import android.util.Property;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@@ -23,6 +26,8 @@
import android.widget.LinearLayout;
import com.android.systemui.R;
+import com.android.systemui.qs.touch.OverScroll;
+import com.android.systemui.qs.touch.SwipeDetector;
/**
* Quick setting scroll view containing the brightness slider and the QS tiles.
@@ -35,6 +40,9 @@
private final int mTouchSlop;
private final int mFooterHeight;
private int mLastMotionY;
+ private final SwipeDetector mSwipeDetector;
+ private final OverScrollHelper mOverScrollHelper;
+ private float mContentTranslationY;
public QSScrollLayout(Context context, View... children) {
super(context);
@@ -49,15 +57,19 @@
linearLayout.addView(view);
}
addView(linearLayout);
+ setOverScrollMode(OVER_SCROLL_NEVER);
+ mOverScrollHelper = new OverScrollHelper();
+ mSwipeDetector = new SwipeDetector(context, mOverScrollHelper, SwipeDetector.VERTICAL);
+ mSwipeDetector.setDetectableScrollConditions(SwipeDetector.DIRECTION_BOTH, true);
}
-
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (canScrollVertically(1) || canScrollVertically(-1)) {
return super.onInterceptTouchEvent(ev);
}
- return false;
+ mSwipeDetector.onTouchEvent(ev);
+ return super.onInterceptTouchEvent(ev) || mOverScrollHelper.isInOverScroll();
}
@Override
@@ -65,7 +77,15 @@
if (canScrollVertically(1) || canScrollVertically(-1)) {
return super.onTouchEvent(ev);
}
- return false;
+ mSwipeDetector.onTouchEvent(ev);
+ return super.onTouchEvent(ev);
+ }
+
+ @Override
+ protected void dispatchDraw(Canvas canvas) {
+ canvas.translate(0, mContentTranslationY);
+ super.dispatchDraw(canvas);
+ canvas.translate(0, -mContentTranslationY);
}
public boolean shouldIntercept(MotionEvent ev) {
@@ -98,4 +118,81 @@
parent.requestDisallowInterceptTouchEvent(disallowIntercept);
}
}
+
+ private void setContentTranslationY(float contentTranslationY) {
+ mContentTranslationY = contentTranslationY;
+ invalidate();
+ }
+
+ private static final Property<QSScrollLayout, Float> CONTENT_TRANS_Y =
+ new Property<QSScrollLayout, Float>(Float.class, "qsScrollLayoutContentTransY") {
+ @Override
+ public Float get(QSScrollLayout qsScrollLayout) {
+ return qsScrollLayout.mContentTranslationY;
+ }
+
+ @Override
+ public void set(QSScrollLayout qsScrollLayout, Float y) {
+ qsScrollLayout.setContentTranslationY(y);
+ }
+ };
+
+ private class OverScrollHelper implements SwipeDetector.Listener {
+ private boolean mIsInOverScroll;
+
+ // We use this value to calculate the actual amount the user has overscrolled.
+ private float mFirstDisplacement = 0;
+
+ @Override
+ public void onDragStart(boolean start) {}
+
+ @Override
+ public boolean onDrag(float displacement, float velocity) {
+ // Only overscroll if the user is scrolling down when they're already at the bottom
+ // or scrolling up when they're already at the top.
+ boolean wasInOverScroll = mIsInOverScroll;
+ mIsInOverScroll = (!canScrollVertically(1) && displacement < 0) ||
+ (!canScrollVertically(-1) && displacement > 0);
+
+ if (wasInOverScroll && !mIsInOverScroll) {
+ // Exit overscroll. This can happen when the user is in overscroll and then
+ // scrolls the opposite way. Note that this causes the reset translation animation
+ // to run while the user is dragging, which feels a bit unnatural.
+ reset();
+ } else if (mIsInOverScroll) {
+ if (Float.compare(mFirstDisplacement, 0) == 0) {
+ // Because users can scroll before entering overscroll, we need to
+ // subtract the amount where the user was not in overscroll.
+ mFirstDisplacement = displacement;
+ }
+ float overscrollY = displacement - mFirstDisplacement;
+ setContentTranslationY(getDampedOverScroll(overscrollY));
+ }
+
+ return mIsInOverScroll;
+ }
+
+ @Override
+ public void onDragEnd(float velocity, boolean fling) {
+ reset();
+ }
+
+ private void reset() {
+ if (Float.compare(mContentTranslationY, 0) != 0) {
+ ObjectAnimator.ofFloat(QSScrollLayout.this, CONTENT_TRANS_Y, 0)
+ .setDuration(100)
+ .start();
+ }
+ mIsInOverScroll = false;
+ mFirstDisplacement = 0;
+ }
+
+ public boolean isInOverScroll() {
+ return mIsInOverScroll;
+ }
+
+ private float getDampedOverScroll(float y) {
+ return OverScroll.dampedScroll(y, getHeight());
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/touch/OverScroll.java b/packages/SystemUI/src/com/android/systemui/qs/touch/OverScroll.java
new file mode 100644
index 0000000..0464886
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/touch/OverScroll.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.qs.touch;
+
+/**
+ * Utility methods for overscroll damping and related effect.
+ *
+ * Copied from packages/apps/Launcher3/src/com/android/launcher3/touch/OverScroll.java
+ */
+public class OverScroll {
+
+ private static final float OVERSCROLL_DAMP_FACTOR = 0.07f;
+
+ /**
+ * This curve determines how the effect of scrolling over the limits of the page diminishes
+ * as the user pulls further and further from the bounds
+ *
+ * @param f The percentage of how much the user has overscrolled.
+ * @return A transformed percentage based on the influence curve.
+ */
+ private static float overScrollInfluenceCurve(float f) {
+ f -= 1.0f;
+ return f * f * f + 1.0f;
+ }
+
+ /**
+ * @param amount The original amount overscrolled.
+ * @param max The maximum amount that the View can overscroll.
+ * @return The dampened overscroll amount.
+ */
+ public static int dampedScroll(float amount, int max) {
+ if (Float.compare(amount, 0) == 0) return 0;
+
+ float f = amount / max;
+ f = f / (Math.abs(f)) * (overScrollInfluenceCurve(Math.abs(f)));
+
+ // Clamp this factor, f, to -1 < f < 1
+ if (Math.abs(f) >= 1) {
+ f /= Math.abs(f);
+ }
+
+ return Math.round(OVERSCROLL_DAMP_FACTOR * f * max);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/touch/SwipeDetector.java b/packages/SystemUI/src/com/android/systemui/qs/touch/SwipeDetector.java
new file mode 100644
index 0000000..2522052
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/touch/SwipeDetector.java
@@ -0,0 +1,356 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.qs.touch;
+
+import static android.view.MotionEvent.INVALID_POINTER_ID;
+
+import android.content.Context;
+import android.graphics.PointF;
+import android.support.annotation.NonNull;
+import android.support.annotation.VisibleForTesting;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+/**
+ * One dimensional scroll/drag/swipe gesture detector.
+ *
+ * Definition of swipe is different from android system in that this detector handles
+ * 'swipe to dismiss', 'swiping up/down a container' but also keeps scrolling state before
+ * swipe action happens
+ *
+ * Copied from packages/apps/Launcher3/src/com/android/launcher3/touch/SwipeDetector.java
+ */
+public class SwipeDetector {
+
+ private static final boolean DBG = false;
+ private static final String TAG = "SwipeDetector";
+
+ private int mScrollConditions;
+ public static final int DIRECTION_POSITIVE = 1 << 0;
+ public static final int DIRECTION_NEGATIVE = 1 << 1;
+ public static final int DIRECTION_BOTH = DIRECTION_NEGATIVE | DIRECTION_POSITIVE;
+
+ private static final float ANIMATION_DURATION = 1200;
+
+ protected int mActivePointerId = INVALID_POINTER_ID;
+
+ /**
+ * The minimum release velocity in pixels per millisecond that triggers fling..
+ */
+ public static final float RELEASE_VELOCITY_PX_MS = 1.0f;
+
+ /**
+ * The time constant used to calculate dampening in the low-pass filter of scroll velocity.
+ * Cutoff frequency is set at 10 Hz.
+ */
+ public static final float SCROLL_VELOCITY_DAMPENING_RC = 1000f / (2f * (float) Math.PI * 10);
+
+ /* Scroll state, this is set to true during dragging and animation. */
+ private ScrollState mState = ScrollState.IDLE;
+
+ enum ScrollState {
+ IDLE,
+ DRAGGING, // onDragStart, onDrag
+ SETTLING // onDragEnd
+ }
+
+ public static abstract class Direction {
+
+ abstract float getDisplacement(MotionEvent ev, int pointerIndex, PointF refPoint);
+
+ /**
+ * Distance in pixels a touch can wander before we think the user is scrolling.
+ */
+ abstract float getActiveTouchSlop(MotionEvent ev, int pointerIndex, PointF downPos);
+ }
+
+ public static final Direction VERTICAL = new Direction() {
+
+ @Override
+ float getDisplacement(MotionEvent ev, int pointerIndex, PointF refPoint) {
+ return ev.getY(pointerIndex) - refPoint.y;
+ }
+
+ @Override
+ float getActiveTouchSlop(MotionEvent ev, int pointerIndex, PointF downPos) {
+ return Math.abs(ev.getX(pointerIndex) - downPos.x);
+ }
+ };
+
+ public static final Direction HORIZONTAL = new Direction() {
+
+ @Override
+ float getDisplacement(MotionEvent ev, int pointerIndex, PointF refPoint) {
+ return ev.getX(pointerIndex) - refPoint.x;
+ }
+
+ @Override
+ float getActiveTouchSlop(MotionEvent ev, int pointerIndex, PointF downPos) {
+ return Math.abs(ev.getY(pointerIndex) - downPos.y);
+ }
+ };
+
+ //------------------- ScrollState transition diagram -----------------------------------
+ //
+ // IDLE -> (mDisplacement > mTouchSlop) -> DRAGGING
+ // DRAGGING -> (MotionEvent#ACTION_UP, MotionEvent#ACTION_CANCEL) -> SETTLING
+ // SETTLING -> (MotionEvent#ACTION_DOWN) -> DRAGGING
+ // SETTLING -> (View settled) -> IDLE
+
+ private void setState(ScrollState newState) {
+ if (DBG) {
+ Log.d(TAG, "setState:" + mState + "->" + newState);
+ }
+ // onDragStart and onDragEnd is reported ONLY on state transition
+ if (newState == ScrollState.DRAGGING) {
+ initializeDragging();
+ if (mState == ScrollState.IDLE) {
+ reportDragStart(false /* recatch */);
+ } else if (mState == ScrollState.SETTLING) {
+ reportDragStart(true /* recatch */);
+ }
+ }
+ if (newState == ScrollState.SETTLING) {
+ reportDragEnd();
+ }
+
+ mState = newState;
+ }
+
+ public boolean isDraggingOrSettling() {
+ return mState == ScrollState.DRAGGING || mState == ScrollState.SETTLING;
+ }
+
+ /**
+ * There's no touch and there's no animation.
+ */
+ public boolean isIdleState() {
+ return mState == ScrollState.IDLE;
+ }
+
+ public boolean isSettlingState() {
+ return mState == ScrollState.SETTLING;
+ }
+
+ public boolean isDraggingState() {
+ return mState == ScrollState.DRAGGING;
+ }
+
+ private final PointF mDownPos = new PointF();
+ private final PointF mLastPos = new PointF();
+ private final Direction mDir;
+
+ private final float mTouchSlop;
+
+ /* Client of this gesture detector can register a callback. */
+ private final Listener mListener;
+
+ private long mCurrentMillis;
+
+ private float mVelocity;
+ private float mLastDisplacement;
+ private float mDisplacement;
+
+ private float mSubtractDisplacement;
+ private boolean mIgnoreSlopWhenSettling;
+
+ public interface Listener {
+ void onDragStart(boolean start);
+
+ boolean onDrag(float displacement, float velocity);
+
+ void onDragEnd(float velocity, boolean fling);
+ }
+
+ public SwipeDetector(@NonNull Context context, @NonNull Listener l, @NonNull Direction dir) {
+ this(ViewConfiguration.get(context).getScaledTouchSlop(), l, dir);
+ }
+
+ @VisibleForTesting
+ protected SwipeDetector(float touchSlope, @NonNull Listener l, @NonNull Direction dir) {
+ mTouchSlop = touchSlope;
+ mListener = l;
+ mDir = dir;
+ }
+
+ public void setDetectableScrollConditions(int scrollDirectionFlags, boolean ignoreSlop) {
+ mScrollConditions = scrollDirectionFlags;
+ mIgnoreSlopWhenSettling = ignoreSlop;
+ }
+
+ private boolean shouldScrollStart(MotionEvent ev, int pointerIndex) {
+ // reject cases where the angle or slop condition is not met.
+ if (Math.max(mDir.getActiveTouchSlop(ev, pointerIndex, mDownPos), mTouchSlop)
+ > Math.abs(mDisplacement)) {
+ return false;
+ }
+
+ // Check if the client is interested in scroll in current direction.
+ if (((mScrollConditions & DIRECTION_NEGATIVE) > 0 && mDisplacement > 0) ||
+ ((mScrollConditions & DIRECTION_POSITIVE) > 0 && mDisplacement < 0)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean onTouchEvent(MotionEvent ev) {
+ switch (ev.getActionMasked()) {
+ case MotionEvent.ACTION_DOWN:
+ mActivePointerId = ev.getPointerId(0);
+ mDownPos.set(ev.getX(), ev.getY());
+ mLastPos.set(mDownPos);
+ mLastDisplacement = 0;
+ mDisplacement = 0;
+ mVelocity = 0;
+
+ if (mState == ScrollState.SETTLING && mIgnoreSlopWhenSettling) {
+ setState(ScrollState.DRAGGING);
+ }
+ break;
+ //case MotionEvent.ACTION_POINTER_DOWN:
+ case MotionEvent.ACTION_POINTER_UP:
+ int ptrIdx = ev.getActionIndex();
+ int ptrId = ev.getPointerId(ptrIdx);
+ if (ptrId == mActivePointerId) {
+ final int newPointerIdx = ptrIdx == 0 ? 1 : 0;
+ mDownPos.set(
+ ev.getX(newPointerIdx) - (mLastPos.x - mDownPos.x),
+ ev.getY(newPointerIdx) - (mLastPos.y - mDownPos.y));
+ mLastPos.set(ev.getX(newPointerIdx), ev.getY(newPointerIdx));
+ mActivePointerId = ev.getPointerId(newPointerIdx);
+ }
+ break;
+ case MotionEvent.ACTION_MOVE:
+ int pointerIndex = ev.findPointerIndex(mActivePointerId);
+ if (pointerIndex == INVALID_POINTER_ID) {
+ break;
+ }
+ mDisplacement = mDir.getDisplacement(ev, pointerIndex, mDownPos);
+ computeVelocity(mDir.getDisplacement(ev, pointerIndex, mLastPos),
+ ev.getEventTime());
+
+ // handle state and listener calls.
+ if (mState != ScrollState.DRAGGING && shouldScrollStart(ev, pointerIndex)) {
+ setState(ScrollState.DRAGGING);
+ }
+ if (mState == ScrollState.DRAGGING) {
+ reportDragging();
+ }
+ mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
+ break;
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ // These are synthetic events and there is no need to update internal values.
+ if (mState == ScrollState.DRAGGING) {
+ setState(ScrollState.SETTLING);
+ }
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+
+ public void finishedScrolling() {
+ setState(ScrollState.IDLE);
+ }
+
+ private boolean reportDragStart(boolean recatch) {
+ mListener.onDragStart(!recatch);
+ if (DBG) {
+ Log.d(TAG, "onDragStart recatch:" + recatch);
+ }
+ return true;
+ }
+
+ private void initializeDragging() {
+ if (mState == ScrollState.SETTLING && mIgnoreSlopWhenSettling) {
+ mSubtractDisplacement = 0;
+ }
+ if (mDisplacement > 0) {
+ mSubtractDisplacement = mTouchSlop;
+ } else {
+ mSubtractDisplacement = -mTouchSlop;
+ }
+ }
+
+ private boolean reportDragging() {
+ if (mDisplacement != mLastDisplacement) {
+ if (DBG) {
+ Log.d(TAG, String.format("onDrag disp=%.1f, velocity=%.1f",
+ mDisplacement, mVelocity));
+ }
+
+ mLastDisplacement = mDisplacement;
+ return mListener.onDrag(mDisplacement - mSubtractDisplacement, mVelocity);
+ }
+ return true;
+ }
+
+ private void reportDragEnd() {
+ if (DBG) {
+ Log.d(TAG, String.format("onScrollEnd disp=%.1f, velocity=%.1f",
+ mDisplacement, mVelocity));
+ }
+ mListener.onDragEnd(mVelocity, Math.abs(mVelocity) > RELEASE_VELOCITY_PX_MS);
+
+ }
+
+ /**
+ * Computes the damped velocity.
+ */
+ public float computeVelocity(float delta, long currentMillis) {
+ long previousMillis = mCurrentMillis;
+ mCurrentMillis = currentMillis;
+
+ float deltaTimeMillis = mCurrentMillis - previousMillis;
+ float velocity = (deltaTimeMillis > 0) ? (delta / deltaTimeMillis) : 0;
+ if (Math.abs(mVelocity) < 0.001f) {
+ mVelocity = velocity;
+ } else {
+ float alpha = computeDampeningFactor(deltaTimeMillis);
+ mVelocity = interpolate(mVelocity, velocity, alpha);
+ }
+ return mVelocity;
+ }
+
+ /**
+ * Returns a time-dependent dampening factor using delta time.
+ */
+ private static float computeDampeningFactor(float deltaTime) {
+ return deltaTime / (SCROLL_VELOCITY_DAMPENING_RC + deltaTime);
+ }
+
+ /**
+ * Returns the linear interpolation between two values
+ */
+ private static float interpolate(float from, float to, float alpha) {
+ return (1.0f - alpha) * from + alpha * to;
+ }
+
+ public static long calculateDuration(float velocity, float progressNeeded) {
+ // TODO: make these values constants after tuning.
+ float velocityDivisor = Math.max(2f, Math.abs(0.5f * velocity));
+ float travelDistance = Math.max(0.2f, progressNeeded);
+ long duration = (long) Math.max(100, ANIMATION_DURATION / velocityDivisor * travelDistance);
+ if (DBG) {
+ Log.d(TAG, String.format("calculateDuration=%d, v=%f, d=%f", duration, velocity, progressNeeded));
+ }
+ return duration;
+ }
+}
+
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index 936ff51..59a7da6 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -65,7 +65,6 @@
LOCAL_JAVA_LIBRARIES := \
android.test.runner \
telephony-common \
- android.car \
android.test.base \
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index 48b5a58..8d22eca 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -55,6 +55,7 @@
import android.view.InputDevice;
import android.media.AudioAttributes;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IAppOpsService;
import com.android.internal.app.IBatteryStats;
import com.android.internal.util.DumpUtils;
@@ -111,6 +112,7 @@
private boolean mVibrateInputDevicesSetting; // guarded by mInputDeviceVibrators
private boolean mInputDeviceListenerRegistered; // guarded by mInputDeviceVibrators
+ @GuardedBy("mLock")
private Vibration mCurrentVibration;
private int mCurVibUid = -1;
private boolean mLowPowerMode;
@@ -435,45 +437,45 @@
// If our current vibration is longer than the new vibration and is the same amplitude,
// then just let the current one finish.
- if (effect instanceof VibrationEffect.OneShot
- && mCurrentVibration != null
- && mCurrentVibration.effect instanceof VibrationEffect.OneShot) {
- VibrationEffect.OneShot newOneShot = (VibrationEffect.OneShot) effect;
- VibrationEffect.OneShot currentOneShot =
- (VibrationEffect.OneShot) mCurrentVibration.effect;
- if (mCurrentVibration.hasTimeoutLongerThan(newOneShot.getDuration())
- && newOneShot.getAmplitude() == currentOneShot.getAmplitude()) {
+ synchronized (mLock) {
+ if (effect instanceof VibrationEffect.OneShot
+ && mCurrentVibration != null
+ && mCurrentVibration.effect instanceof VibrationEffect.OneShot) {
+ VibrationEffect.OneShot newOneShot = (VibrationEffect.OneShot) effect;
+ VibrationEffect.OneShot currentOneShot =
+ (VibrationEffect.OneShot) mCurrentVibration.effect;
+ if (mCurrentVibration.hasTimeoutLongerThan(newOneShot.getDuration())
+ && newOneShot.getAmplitude() == currentOneShot.getAmplitude()) {
+ if (DEBUG) {
+ Slog.d(TAG, "Ignoring incoming vibration in favor of current vibration");
+ }
+ return;
+ }
+ }
+
+ // If the current vibration is repeating and the incoming one is non-repeating, then
+ // ignore the non-repeating vibration. This is so that we don't cancel vibrations that
+ // are meant to grab the attention of the user, like ringtones and alarms, in favor of
+ // one-shot vibrations that are likely quite short.
+ if (!isRepeatingVibration(effect)
+ && mCurrentVibration != null
+ && isRepeatingVibration(mCurrentVibration.effect)) {
if (DEBUG) {
- Slog.d(TAG, "Ignoring incoming vibration in favor of current vibration");
+ Slog.d(TAG, "Ignoring incoming vibration in favor of alarm vibration");
}
return;
}
- }
- // If the current vibration is repeating and the incoming one is non-repeating, then ignore
- // the non-repeating vibration. This is so that we don't cancel vibrations that are meant
- // to grab the attention of the user, like ringtones and alarms, in favor of one-shot
- // vibrations that are likely quite short.
- if (!isRepeatingVibration(effect)
- && mCurrentVibration != null && isRepeatingVibration(mCurrentVibration.effect)) {
- if (DEBUG) {
- Slog.d(TAG, "Ignoring incoming vibration in favor of alarm vibration");
- }
- return;
- }
-
- Vibration vib = new Vibration(token, effect, usageHint, uid, opPkg);
- linkVibration(vib);
-
- long ident = Binder.clearCallingIdentity();
- try {
- synchronized (mLock) {
+ Vibration vib = new Vibration(token, effect, usageHint, uid, opPkg);
+ linkVibration(vib);
+ long ident = Binder.clearCallingIdentity();
+ try {
doCancelVibrateLocked();
startVibrationLocked(vib);
addToPreviousVibrationsLocked(vib);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
}
- } finally {
- Binder.restoreCallingIdentity(ident);
}
}
@@ -516,6 +518,7 @@
}
};
+ @GuardedBy("mLock")
private void doCancelVibrateLocked() {
mH.removeCallbacks(mVibrationEndRunnable);
if (mThread != null) {
@@ -538,6 +541,7 @@
}
}
+ @GuardedBy("mLock")
private void startVibrationLocked(final Vibration vib) {
if (!isAllowedToVibrateLocked(vib)) {
return;
@@ -568,6 +572,7 @@
startVibrationInnerLocked(vib);
}
+ @GuardedBy("mLock")
private void startVibrationInnerLocked(Vibration vib) {
mCurrentVibration = vib;
if (vib.effect instanceof VibrationEffect.OneShot) {
@@ -701,6 +706,7 @@
return mode;
}
+ @GuardedBy("mLock")
private void reportFinishVibrationLocked() {
if (mCurrentVibration != null) {
try {
@@ -880,6 +886,7 @@
}
}
+ @GuardedBy("mLock")
private long doVibratorPrebakedEffectLocked(Vibration vib) {
final VibrationEffect.Prebaked prebaked = (VibrationEffect.Prebaked) vib.effect;
final boolean usingInputDeviceVibrators;
diff --git a/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java
index 9033b55..71fd71b 100644
--- a/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java
@@ -93,7 +93,7 @@
}
try {
systemPropertiesSet(key, value);
- } catch (IllegalArgumentException e) {
+ } catch (Exception e) {
Slog.e(TAG, "Unable to set property " + key + " value '" + value + "'", e);
}
}
diff --git a/services/core/java/com/android/server/am/RecentsAnimation.java b/services/core/java/com/android/server/am/RecentsAnimation.java
index e7b067b..db4e09f 100644
--- a/services/core/java/com/android/server/am/RecentsAnimation.java
+++ b/services/core/java/com/android/server/am/RecentsAnimation.java
@@ -20,6 +20,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
+import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
import static android.view.WindowManager.TRANSIT_NONE;
import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
@@ -27,6 +28,7 @@
import android.content.ComponentName;
import android.content.Intent;
import android.os.Handler;
+import android.os.Trace;
import android.view.IRecentsAnimationRunner;
import com.android.server.wm.RecentsAnimationController.RecentsAnimationCallbacks;
import com.android.server.wm.WindowManagerService;
@@ -70,6 +72,7 @@
void startRecentsActivity(Intent intent, IRecentsAnimationRunner recentsAnimationRunner,
ComponentName recentsComponent, int recentsUid) {
+ Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "RecentsAnimation#startRecentsActivity");
mWindowManager.deferSurfaceLayout();
try {
// Cancel the previous recents animation if necessary
@@ -124,6 +127,7 @@
mHandler.postDelayed(mCancelAnimationRunnable, RECENTS_ANIMATION_TIMEOUT);
} finally {
mWindowManager.continueSurfaceLayout();
+ Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
}
@@ -134,6 +138,8 @@
if (mWindowManager.getRecentsAnimationController() == null) return;
mWindowManager.inSurfaceTransaction(() -> {
+ Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER,
+ "RecentsAnimation#onAnimationFinished_inSurfaceTransaction");
mWindowManager.deferSurfaceLayout();
try {
mWindowManager.cleanupRecentsAnimation();
@@ -167,6 +173,7 @@
mWindowManager.executeAppTransition();
} finally {
mWindowManager.continueSurfaceLayout();
+ Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
}
});
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 2816bbd..0594999 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -16610,6 +16610,12 @@
if (userId != UserHandle.USER_ALL) {
ps.setInstalled(true, userId);
ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, userId, installerPackageName);
+ } else {
+ for (int currentUserId : sUserManager.getUserIds()) {
+ ps.setInstalled(true, currentUserId);
+ ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, currentUserId,
+ installerPackageName);
+ }
}
// When replacing an existing package, preserve the original install reason for all
diff --git a/services/core/java/com/android/server/stats/StatsCompanionService.java b/services/core/java/com/android/server/stats/StatsCompanionService.java
index a87ae1e..a82b559 100644
--- a/services/core/java/com/android/server/stats/StatsCompanionService.java
+++ b/services/core/java/com/android/server/stats/StatsCompanionService.java
@@ -87,9 +87,7 @@
static final String TAG = "StatsCompanionService";
static final boolean DEBUG = true;
- public static final String ACTION_TRIGGER_COLLECTION =
- "com.android.server.stats.action.TRIGGER_COLLECTION";
-
+ public static final int CODE_DATA_BROADCAST = 1;
public static final int CODE_SUBSCRIBER_BROADCAST = 1;
private final Context mContext;
@@ -110,9 +108,9 @@
private TelephonyManager mTelephony = null;
private final StatFs mStatFsData = new StatFs(Environment.getDataDirectory().getAbsolutePath());
private final StatFs mStatFsSystem =
- new StatFs(Environment.getRootDirectory().getAbsolutePath());
+ new StatFs(Environment.getRootDirectory().getAbsolutePath());
private final StatFs mStatFsTemp =
- new StatFs(Environment.getDownloadCacheDirectory().getAbsolutePath());
+ new StatFs(Environment.getDownloadCacheDirectory().getAbsolutePath());
public StatsCompanionService(Context context) {
super();
@@ -122,7 +120,7 @@
mAnomalyAlarmIntent = PendingIntent.getBroadcast(mContext, 0,
new Intent(mContext, AnomalyAlarmReceiver.class), 0);
mPullingAlarmIntent = PendingIntent.getBroadcast(
- mContext, 0, new Intent(mContext, PullingAlarmReceiver.class), 0);
+ mContext, 0, new Intent(mContext, PullingAlarmReceiver.class), 0);
mAppUpdateReceiver = new AppUpdateReceiver();
mUserUpdateReceiver = new BroadcastReceiver() {
@Override
@@ -153,17 +151,21 @@
for (int i = 0; i < numClusters; i++) {
final int numSpeedSteps = powerProfile.getNumSpeedStepsInCpuCluster(i);
mKernelCpuSpeedReaders[i] = new KernelCpuSpeedReader(firstCpuOfCluster,
- numSpeedSteps);
+ numSpeedSteps);
firstCpuOfCluster += powerProfile.getNumCoresInCpuCluster(i);
}
}
@Override
- public void sendBroadcast(String pkg, String cls) {
- // TODO: Use a pending intent.
+ public void sendDataBroadcast(IBinder intentSenderBinder) {
enforceCallingPermission();
- mContext.sendBroadcastAsUser(new Intent(ACTION_TRIGGER_COLLECTION).setClassName(pkg, cls),
- UserHandle.SYSTEM);
+ IntentSender intentSender = new IntentSender(intentSenderBinder);
+ Intent intent = new Intent();
+ try {
+ intentSender.sendIntent(mContext, CODE_DATA_BROADCAST, intent, null, null);
+ } catch (IntentSender.SendIntentException e) {
+ Slog.w(TAG, "Unable to send using IntentSender");
+ }
}
@Override
@@ -305,24 +307,23 @@
}
public final static class PullingAlarmReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (DEBUG)
- Slog.d(TAG, "Time to poll something.");
- synchronized (sStatsdLock) {
- if (sStatsd == null) {
- Slog.w(TAG, "Could not access statsd to inform it of pulling alarm firing.");
- return;
- }
- try {
- // Two-way call to statsd to retain AlarmManager wakelock
- sStatsd.informPollAlarmFired();
- } catch (RemoteException e) {
- Slog.w(TAG, "Failed to inform statsd of pulling alarm firing.", e);
- }
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (DEBUG)
+ Slog.d(TAG, "Time to poll something.");
+ synchronized (sStatsdLock) {
+ if (sStatsd == null) {
+ Slog.w(TAG, "Could not access statsd to inform it of pulling alarm firing.");
+ return;
+ }
+ try {
+ // Two-way call to statsd to retain AlarmManager wakelock
+ sStatsd.informPollAlarmFired();
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Failed to inform statsd of pulling alarm firing.", e);
+ }
+ }
}
- // AlarmManager releases its own wakelock here.
- }
}
private final static class ShutdownEventReceiver extends BroadcastReceiver {
@@ -332,9 +333,9 @@
* Skip immediately if intent is not relevant to device shutdown.
*/
if (!intent.getAction().equals(Intent.ACTION_REBOOT)
- && !(intent.getAction().equals(Intent.ACTION_SHUTDOWN)
- && (intent.getFlags() & Intent.FLAG_RECEIVER_FOREGROUND) != 0)) {
- return;
+ && !(intent.getAction().equals(Intent.ACTION_SHUTDOWN)
+ && (intent.getFlags() & Intent.FLAG_RECEIVER_FOREGROUND) != 0)) {
+ return;
}
Slog.i(TAG, "StatsCompanionService noticed a shutdown.");
@@ -381,50 +382,50 @@
@Override // Binder call
public void setPullingAlarms(long timestampMs, long intervalMs) {
- enforceCallingPermission();
- if (DEBUG)
- Slog.d(TAG, "Setting pulling alarm for " + timestampMs + " every " + intervalMs + "ms");
- final long callingToken = Binder.clearCallingIdentity();
- try {
- // using RTC, not RTC_WAKEUP, so if device is asleep, will only fire when it awakens.
- // This alarm is inexact, leaving its exactness completely up to the OS optimizations.
- // TODO: totally inexact means that stats per bucket could be quite off. Is this okay?
- mAlarmManager.setRepeating(AlarmManager.RTC, timestampMs, intervalMs, mPullingAlarmIntent);
- } finally {
- Binder.restoreCallingIdentity(callingToken);
- }
+ enforceCallingPermission();
+ if (DEBUG)
+ Slog.d(TAG, "Setting pulling alarm for " + timestampMs + " every " + intervalMs + "ms");
+ final long callingToken = Binder.clearCallingIdentity();
+ try {
+ // using RTC, not RTC_WAKEUP, so if device is asleep, will only fire when it awakens.
+ // This alarm is inexact, leaving its exactness completely up to the OS optimizations.
+ // TODO: totally inexact means that stats per bucket could be quite off. Is this okay?
+ mAlarmManager.setRepeating(AlarmManager.RTC, timestampMs, intervalMs, mPullingAlarmIntent);
+ } finally {
+ Binder.restoreCallingIdentity(callingToken);
+ }
}
@Override // Binder call
public void cancelPullingAlarms() {
- enforceCallingPermission();
- if (DEBUG)
- Slog.d(TAG, "Cancelling pulling alarm");
- final long callingToken = Binder.clearCallingIdentity();
- try {
- mAlarmManager.cancel(mPullingAlarmIntent);
- } finally {
- Binder.restoreCallingIdentity(callingToken);
- }
+ enforceCallingPermission();
+ if (DEBUG)
+ Slog.d(TAG, "Cancelling pulling alarm");
+ final long callingToken = Binder.clearCallingIdentity();
+ try {
+ mAlarmManager.cancel(mPullingAlarmIntent);
+ } finally {
+ Binder.restoreCallingIdentity(callingToken);
+ }
}
private void addNetworkStats(
- int tag, List<StatsLogEventWrapper> ret, NetworkStats stats, boolean withFGBG) {
- int size = stats.size();
- NetworkStats.Entry entry = new NetworkStats.Entry(); // For recycling
- for (int j = 0; j < size; j++) {
- stats.getValues(j, entry);
- StatsLogEventWrapper e = new StatsLogEventWrapper(tag, withFGBG ? 6 : 5);
- e.writeInt(entry.uid);
- if (withFGBG) {
- e.writeInt(entry.set);
+ int tag, List<StatsLogEventWrapper> ret, NetworkStats stats, boolean withFGBG) {
+ int size = stats.size();
+ NetworkStats.Entry entry = new NetworkStats.Entry(); // For recycling
+ for (int j = 0; j < size; j++) {
+ stats.getValues(j, entry);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tag, withFGBG ? 6 : 5);
+ e.writeInt(entry.uid);
+ if (withFGBG) {
+ e.writeInt(entry.set);
+ }
+ e.writeLong(entry.rxBytes);
+ e.writeLong(entry.rxPackets);
+ e.writeLong(entry.txBytes);
+ e.writeLong(entry.txPackets);
+ ret.add(e);
}
- e.writeLong(entry.rxBytes);
- e.writeLong(entry.rxPackets);
- e.writeLong(entry.txBytes);
- e.writeLong(entry.txPackets);
- ret.add(e);
- }
}
/**
@@ -491,220 +492,220 @@
}
private void pullKernelWakelock(int tagId, List<StatsLogEventWrapper> pulledData) {
- final KernelWakelockStats wakelockStats =
- mKernelWakelockReader.readKernelWakelockStats(mTmpWakelockStats);
- for (Map.Entry<String, KernelWakelockStats.Entry> ent : wakelockStats.entrySet()) {
- String name = ent.getKey();
- KernelWakelockStats.Entry kws = ent.getValue();
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 4);
- e.writeString(name);
- e.writeInt(kws.mCount);
- e.writeInt(kws.mVersion);
- e.writeLong(kws.mTotalTime);
- pulledData.add(e);
- }
+ final KernelWakelockStats wakelockStats =
+ mKernelWakelockReader.readKernelWakelockStats(mTmpWakelockStats);
+ for (Map.Entry<String, KernelWakelockStats.Entry> ent : wakelockStats.entrySet()) {
+ String name = ent.getKey();
+ KernelWakelockStats.Entry kws = ent.getValue();
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 4);
+ e.writeString(name);
+ e.writeInt(kws.mCount);
+ e.writeInt(kws.mVersion);
+ e.writeLong(kws.mTotalTime);
+ pulledData.add(e);
+ }
}
private void pullWifiBytesTransfer(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- try {
- // TODO: Consider caching the following call to get BatteryStatsInternal.
- BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
- String[] ifaces = bs.getWifiIfaces();
- if (ifaces.length == 0) {
- return;
+ long token = Binder.clearCallingIdentity();
+ try {
+ // TODO: Consider caching the following call to get BatteryStatsInternal.
+ BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
+ String[] ifaces = bs.getWifiIfaces();
+ if (ifaces.length == 0) {
+ return;
+ }
+ NetworkStatsFactory nsf = new NetworkStatsFactory();
+ // Combine all the metrics per Uid into one record.
+ NetworkStats stats =
+ nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null)
+ .groupedByUid();
+ addNetworkStats(tagId, pulledData, stats, false);
+ } catch (java.io.IOException e) {
+ Slog.e(TAG, "Pulling netstats for wifi bytes has error", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
- NetworkStatsFactory nsf = new NetworkStatsFactory();
- // Combine all the metrics per Uid into one record.
- NetworkStats stats =
- nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null)
- .groupedByUid();
- addNetworkStats(tagId, pulledData, stats, false);
- } catch (java.io.IOException e) {
- Slog.e(TAG, "Pulling netstats for wifi bytes has error", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
}
private void pullWifiBytesTransferByFgBg(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- try {
- BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
- String[] ifaces = bs.getWifiIfaces();
- if (ifaces.length == 0) {
- return;
+ long token = Binder.clearCallingIdentity();
+ try {
+ BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
+ String[] ifaces = bs.getWifiIfaces();
+ if (ifaces.length == 0) {
+ return;
+ }
+ NetworkStatsFactory nsf = new NetworkStatsFactory();
+ NetworkStats stats = rollupNetworkStatsByFGBG(
+ nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null));
+ addNetworkStats(tagId, pulledData, stats, true);
+ } catch (java.io.IOException e) {
+ Slog.e(TAG, "Pulling netstats for wifi bytes w/ fg/bg has error", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
- NetworkStatsFactory nsf = new NetworkStatsFactory();
- NetworkStats stats = rollupNetworkStatsByFGBG(
- nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null));
- addNetworkStats(tagId, pulledData, stats, true);
- } catch (java.io.IOException e) {
- Slog.e(TAG, "Pulling netstats for wifi bytes w/ fg/bg has error", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
}
private void pullMobileBytesTransfer(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- try {
- BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
- String[] ifaces = bs.getMobileIfaces();
- if (ifaces.length == 0) {
- return;
+ long token = Binder.clearCallingIdentity();
+ try {
+ BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
+ String[] ifaces = bs.getMobileIfaces();
+ if (ifaces.length == 0) {
+ return;
+ }
+ NetworkStatsFactory nsf = new NetworkStatsFactory();
+ // Combine all the metrics per Uid into one record.
+ NetworkStats stats =
+ nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null)
+ .groupedByUid();
+ addNetworkStats(tagId, pulledData, stats, false);
+ } catch (java.io.IOException e) {
+ Slog.e(TAG, "Pulling netstats for mobile bytes has error", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
- NetworkStatsFactory nsf = new NetworkStatsFactory();
- // Combine all the metrics per Uid into one record.
- NetworkStats stats =
- nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null)
- .groupedByUid();
- addNetworkStats(tagId, pulledData, stats, false);
- } catch (java.io.IOException e) {
- Slog.e(TAG, "Pulling netstats for mobile bytes has error", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
}
private void pullBluetoothBytesTransfer(int tagId, List<StatsLogEventWrapper> pulledData) {
- BluetoothActivityEnergyInfo info = pullBluetoothData();
- for (UidTraffic traffic : info.getUidTraffic()) {
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
- e.writeInt(traffic.getUid());
- e.writeLong(traffic.getRxBytes());
- e.writeLong(traffic.getTxBytes());
- pulledData.add(e);
- }
+ BluetoothActivityEnergyInfo info = pullBluetoothData();
+ for (UidTraffic traffic : info.getUidTraffic()) {
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
+ e.writeInt(traffic.getUid());
+ e.writeLong(traffic.getRxBytes());
+ e.writeLong(traffic.getTxBytes());
+ pulledData.add(e);
+ }
}
private void pullMobileBytesTransferByFgBg(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- try {
- BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
- String[] ifaces = bs.getMobileIfaces();
- if (ifaces.length == 0) {
- return;
+ long token = Binder.clearCallingIdentity();
+ try {
+ BatteryStatsInternal bs = LocalServices.getService(BatteryStatsInternal.class);
+ String[] ifaces = bs.getMobileIfaces();
+ if (ifaces.length == 0) {
+ return;
+ }
+ NetworkStatsFactory nsf = new NetworkStatsFactory();
+ NetworkStats stats = rollupNetworkStatsByFGBG(
+ nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null));
+ addNetworkStats(tagId, pulledData, stats, true);
+ } catch (java.io.IOException e) {
+ Slog.e(TAG, "Pulling netstats for mobile bytes w/ fg/bg has error", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
- NetworkStatsFactory nsf = new NetworkStatsFactory();
- NetworkStats stats = rollupNetworkStatsByFGBG(
- nsf.readNetworkStatsDetail(NetworkStats.UID_ALL, ifaces, NetworkStats.TAG_NONE, null));
- addNetworkStats(tagId, pulledData, stats, true);
- } catch (java.io.IOException e) {
- Slog.e(TAG, "Pulling netstats for mobile bytes w/ fg/bg has error", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
}
private void pullCpuTimePerFreq(int tagId, List<StatsLogEventWrapper> pulledData) {
- for (int cluster = 0; cluster < mKernelCpuSpeedReaders.length; cluster++) {
- long[] clusterTimeMs = mKernelCpuSpeedReaders[cluster].readAbsolute();
- if (clusterTimeMs != null) {
- for (int speed = clusterTimeMs.length - 1; speed >= 0; --speed) {
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
- e.writeInt(cluster);
- e.writeInt(speed);
- e.writeLong(clusterTimeMs[speed]);
- pulledData.add(e);
- }
+ for (int cluster = 0; cluster < mKernelCpuSpeedReaders.length; cluster++) {
+ long[] clusterTimeMs = mKernelCpuSpeedReaders[cluster].readAbsolute();
+ if (clusterTimeMs != null) {
+ for (int speed = clusterTimeMs.length - 1; speed >= 0; --speed) {
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
+ e.writeInt(cluster);
+ e.writeInt(speed);
+ e.writeLong(clusterTimeMs[speed]);
+ pulledData.add(e);
+ }
+ }
}
- }
}
private void pullWifiActivityEnergyInfo(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- if (mWifiManager == null) {
- mWifiManager =
- IWifiManager.Stub.asInterface(ServiceManager.getService(Context.WIFI_SERVICE));
- }
- if (mWifiManager != null) {
- try {
- SynchronousResultReceiver wifiReceiver = new SynchronousResultReceiver("wifi");
- mWifiManager.requestActivityInfo(wifiReceiver);
- final WifiActivityEnergyInfo wifiInfo = awaitControllerInfo(wifiReceiver);
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
- e.writeLong(wifiInfo.getTimeStamp());
- e.writeInt(wifiInfo.getStackState());
- e.writeLong(wifiInfo.getControllerTxTimeMillis());
- e.writeLong(wifiInfo.getControllerRxTimeMillis());
- e.writeLong(wifiInfo.getControllerIdleTimeMillis());
- e.writeLong(wifiInfo.getControllerEnergyUsed());
- pulledData.add(e);
- } catch (RemoteException e) {
- Slog.e(TAG, "Pulling wifiManager for wifi controller activity energy info has error", e);
- } finally {
- Binder.restoreCallingIdentity(token);
+ long token = Binder.clearCallingIdentity();
+ if (mWifiManager == null) {
+ mWifiManager =
+ IWifiManager.Stub.asInterface(ServiceManager.getService(Context.WIFI_SERVICE));
}
- }
+ if (mWifiManager != null) {
+ try {
+ SynchronousResultReceiver wifiReceiver = new SynchronousResultReceiver("wifi");
+ mWifiManager.requestActivityInfo(wifiReceiver);
+ final WifiActivityEnergyInfo wifiInfo = awaitControllerInfo(wifiReceiver);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
+ e.writeLong(wifiInfo.getTimeStamp());
+ e.writeInt(wifiInfo.getStackState());
+ e.writeLong(wifiInfo.getControllerTxTimeMillis());
+ e.writeLong(wifiInfo.getControllerRxTimeMillis());
+ e.writeLong(wifiInfo.getControllerIdleTimeMillis());
+ e.writeLong(wifiInfo.getControllerEnergyUsed());
+ pulledData.add(e);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Pulling wifiManager for wifi controller activity energy info has error", e);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
}
private void pullModemActivityInfo(int tagId, List<StatsLogEventWrapper> pulledData) {
- long token = Binder.clearCallingIdentity();
- if (mTelephony == null) {
- mTelephony = TelephonyManager.from(mContext);
- }
- if (mTelephony != null) {
- SynchronousResultReceiver modemReceiver = new SynchronousResultReceiver("telephony");
- mTelephony.requestModemActivityInfo(modemReceiver);
- final ModemActivityInfo modemInfo = awaitControllerInfo(modemReceiver);
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
- e.writeLong(modemInfo.getTimestamp());
- e.writeLong(modemInfo.getSleepTimeMillis());
- e.writeLong(modemInfo.getIdleTimeMillis());
- e.writeLong(modemInfo.getTxTimeMillis()[0]);
- e.writeLong(modemInfo.getTxTimeMillis()[1]);
- e.writeLong(modemInfo.getTxTimeMillis()[2]);
- e.writeLong(modemInfo.getTxTimeMillis()[3]);
- e.writeLong(modemInfo.getTxTimeMillis()[4]);
- e.writeLong(modemInfo.getRxTimeMillis());
- e.writeLong(modemInfo.getEnergyUsed());
- pulledData.add(e);
- }
+ long token = Binder.clearCallingIdentity();
+ if (mTelephony == null) {
+ mTelephony = TelephonyManager.from(mContext);
+ }
+ if (mTelephony != null) {
+ SynchronousResultReceiver modemReceiver = new SynchronousResultReceiver("telephony");
+ mTelephony.requestModemActivityInfo(modemReceiver);
+ final ModemActivityInfo modemInfo = awaitControllerInfo(modemReceiver);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
+ e.writeLong(modemInfo.getTimestamp());
+ e.writeLong(modemInfo.getSleepTimeMillis());
+ e.writeLong(modemInfo.getIdleTimeMillis());
+ e.writeLong(modemInfo.getTxTimeMillis()[0]);
+ e.writeLong(modemInfo.getTxTimeMillis()[1]);
+ e.writeLong(modemInfo.getTxTimeMillis()[2]);
+ e.writeLong(modemInfo.getTxTimeMillis()[3]);
+ e.writeLong(modemInfo.getTxTimeMillis()[4]);
+ e.writeLong(modemInfo.getRxTimeMillis());
+ e.writeLong(modemInfo.getEnergyUsed());
+ pulledData.add(e);
+ }
}
private void pullBluetoothActivityInfo(int tagId, List<StatsLogEventWrapper> pulledData) {
- BluetoothActivityEnergyInfo info = pullBluetoothData();
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
- e.writeLong(info.getTimeStamp());
- e.writeInt(info.getBluetoothStackState());
- e.writeLong(info.getControllerTxTimeMillis());
- e.writeLong(info.getControllerRxTimeMillis());
- e.writeLong(info.getControllerIdleTimeMillis());
- e.writeLong(info.getControllerEnergyUsed());
- pulledData.add(e);
+ BluetoothActivityEnergyInfo info = pullBluetoothData();
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 6);
+ e.writeLong(info.getTimeStamp());
+ e.writeInt(info.getBluetoothStackState());
+ e.writeLong(info.getControllerTxTimeMillis());
+ e.writeLong(info.getControllerRxTimeMillis());
+ e.writeLong(info.getControllerIdleTimeMillis());
+ e.writeLong(info.getControllerEnergyUsed());
+ pulledData.add(e);
}
private synchronized BluetoothActivityEnergyInfo pullBluetoothData() {
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
- if (adapter != null) {
- SynchronousResultReceiver bluetoothReceiver = new SynchronousResultReceiver("bluetooth");
- adapter.requestControllerActivityEnergyInfo(bluetoothReceiver);
- return awaitControllerInfo(bluetoothReceiver);
- } else {
- Slog.e(TAG, "Failed to get bluetooth adapter!");
- return null;
- }
+ if (adapter != null) {
+ SynchronousResultReceiver bluetoothReceiver = new SynchronousResultReceiver("bluetooth");
+ adapter.requestControllerActivityEnergyInfo(bluetoothReceiver);
+ return awaitControllerInfo(bluetoothReceiver);
+ } else {
+ Slog.e(TAG, "Failed to get bluetooth adapter!");
+ return null;
+ }
}
private void pullSystemElapsedRealtime(int tagId, List<StatsLogEventWrapper> pulledData) {
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 1);
- e.writeLong(SystemClock.elapsedRealtime());
- pulledData.add(e);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 1);
+ e.writeLong(SystemClock.elapsedRealtime());
+ pulledData.add(e);
}
private void pullDiskSpace(int tagId, List<StatsLogEventWrapper> pulledData) {
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
- e.writeLong(mStatFsData.getAvailableBytes());
- e.writeLong(mStatFsSystem.getAvailableBytes());
- e.writeLong(mStatFsTemp.getAvailableBytes());
- pulledData.add(e);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 3);
+ e.writeLong(mStatFsData.getAvailableBytes());
+ e.writeLong(mStatFsSystem.getAvailableBytes());
+ e.writeLong(mStatFsTemp.getAvailableBytes());
+ pulledData.add(e);
}
private void pullSystemUpTime(int tagId, List<StatsLogEventWrapper> pulledData) {
- StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 1);
- e.writeLong(SystemClock.uptimeMillis());
- pulledData.add(e);
+ StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, 1);
+ e.writeLong(SystemClock.uptimeMillis());
+ pulledData.add(e);
}
/**
@@ -718,56 +719,56 @@
List<StatsLogEventWrapper> ret = new ArrayList();
switch (tagId) {
case StatsLog.WIFI_BYTES_TRANSFER: {
- pullWifiBytesTransfer(tagId, ret);
- break;
+ pullWifiBytesTransfer(tagId, ret);
+ break;
}
case StatsLog.MOBILE_BYTES_TRANSFER: {
- pullMobileBytesTransfer(tagId, ret);
- break;
+ pullMobileBytesTransfer(tagId, ret);
+ break;
}
case StatsLog.WIFI_BYTES_TRANSFER_BY_FG_BG: {
- pullWifiBytesTransferByFgBg(tagId, ret);
- break;
+ pullWifiBytesTransferByFgBg(tagId, ret);
+ break;
}
case StatsLog.MOBILE_BYTES_TRANSFER_BY_FG_BG: {
- pullMobileBytesTransferByFgBg(tagId, ret);
- break;
+ pullMobileBytesTransferByFgBg(tagId, ret);
+ break;
}
case StatsLog.BLUETOOTH_BYTES_TRANSFER: {
- pullBluetoothBytesTransfer(tagId, ret);
- break;
+ pullBluetoothBytesTransfer(tagId, ret);
+ break;
}
case StatsLog.KERNEL_WAKELOCK: {
- pullKernelWakelock(tagId, ret);
- break;
+ pullKernelWakelock(tagId, ret);
+ break;
}
case StatsLog.CPU_TIME_PER_FREQ: {
- pullCpuTimePerFreq(tagId, ret);
- break;
+ pullCpuTimePerFreq(tagId, ret);
+ break;
}
case StatsLog.WIFI_ACTIVITY_ENERGY_INFO: {
- pullWifiActivityEnergyInfo(tagId, ret);
- break;
+ pullWifiActivityEnergyInfo(tagId, ret);
+ break;
}
case StatsLog.MODEM_ACTIVITY_INFO: {
- pullModemActivityInfo(tagId, ret);
- break;
+ pullModemActivityInfo(tagId, ret);
+ break;
}
case StatsLog.BLUETOOTH_ACTIVITY_INFO: {
- pullBluetoothActivityInfo(tagId, ret);
- break;
+ pullBluetoothActivityInfo(tagId, ret);
+ break;
}
case StatsLog.SYSTEM_UPTIME: {
- pullSystemUpTime(tagId, ret);
- break;
+ pullSystemUpTime(tagId, ret);
+ break;
}
case StatsLog.SYSTEM_ELAPSED_REALTIME: {
- pullSystemElapsedRealtime(tagId, ret);
- break;
+ pullSystemElapsedRealtime(tagId, ret);
+ break;
}
case StatsLog.DISK_SPACE: {
- pullDiskSpace(tagId, ret);
- break;
+ pullDiskSpace(tagId, ret);
+ break;
}
default:
Slog.w(TAG, "No such tagId data as " + tagId);
@@ -788,14 +789,14 @@
@Override
public void triggerUidSnapshot() {
- enforceCallingPermission();
- synchronized (sStatsdLock) {
- try {
- informAllUidsLocked(mContext);
- } catch (RemoteException e) {
- Slog.e(TAG, "Failed to trigger uid snapshot.", e);
+ enforceCallingPermission();
+ synchronized (sStatsdLock) {
+ try {
+ informAllUidsLocked(mContext);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to trigger uid snapshot.", e);
+ }
}
- }
}
private void enforceCallingPermission() {
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index fe5b65c..e869f58 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -62,6 +62,7 @@
// The recents component app token that is shown behind the visibile tasks
private AppWindowToken mHomeAppToken;
+ private Rect mMinimizedHomeBounds = new Rect();
// We start the RecentsAnimationController in a pending-start state since we need to wait for
// the wallpaper/activity to draw before we can give control to the handler to start animating
@@ -105,7 +106,7 @@
final AppWindowToken topChild = task.getTopChild();
final WindowState mainWindow = topChild.findMainWindow();
return new TaskSnapshot(buffer, topChild.getConfiguration().orientation,
- mainWindow.mStableInsets,
+ mainWindow.mContentInsets,
ActivityManager.isLowRamDeviceStatic() /* reduced */,
1.0f /* scale */);
}
@@ -163,8 +164,6 @@
* @param remoteAnimationRunner The remote runner which should be notified when the animation is
* ready to start or has been canceled
* @param callbacks Callbacks to be made when the animation finishes
- * @param restoreHomeBehindStackId The stack id to restore the home stack behind once the
- * animation is complete. Will be passed to the callback.
*/
RecentsAnimationController(WindowManagerService service,
IRecentsAnimationRunner remoteAnimationRunner, RecentsAnimationCallbacks callbacks,
@@ -200,13 +199,15 @@
if (recentsComponentAppToken != null) {
if (DEBUG) Log.d(TAG, "setHomeApp(" + recentsComponentAppToken.getName() + ")");
mHomeAppToken = recentsComponentAppToken;
- final WallpaperController wc = dc.mWallpaperController;
if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) {
dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
dc.setLayoutNeeded();
}
}
+ // Save the minimized home height
+ dc.getDockedDividerController().getHomeStackBoundsInDockedMode(mMinimizedHomeBounds);
+
mService.mWindowPlacerLocked.performSurfacePlacement();
}
@@ -232,7 +233,15 @@
appAnimations[i] = mPendingAnimations.get(i).createRemoteAnimationApp();
}
mPendingStart = false;
- mRunner.onAnimationStart(mController, appAnimations);
+
+ final Rect minimizedHomeBounds =
+ mHomeAppToken != null && mHomeAppToken.inSplitScreenSecondaryWindowingMode()
+ ? mMinimizedHomeBounds : null;
+ final Rect contentInsets =
+ mHomeAppToken != null && mHomeAppToken.findMainWindow() != null
+ ? mHomeAppToken.findMainWindow().mContentInsets : null;
+ mRunner.onAnimationStart_New(mController, appAnimations, contentInsets,
+ minimizedHomeBounds);
} catch (RemoteException e) {
Slog.e(TAG, "Failed to start recents animation", e);
}
@@ -334,11 +343,15 @@
}
RemoteAnimationTarget createRemoteAnimationApp() {
- // TODO: Do we need position and stack bounds?
+ final Point position = new Point();
+ final Rect bounds = new Rect();
+ final WindowContainer container = mTask.getParent();
+ container.getRelativePosition(position);
+ container.getBounds(bounds);
+ final WindowState mainWindow = mTask.getTopVisibleAppMainWindow();
return new RemoteAnimationTarget(mTask.mTaskId, MODE_CLOSING, mCapturedLeash,
- !mTask.fillsParent(),
- mTask.getTopVisibleAppMainWindow().mWinAnimator.mLastClipRect,
- mTask.getPrefixOrderIndex(), new Point(), new Rect(),
+ !mTask.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
+ mainWindow.mContentInsets, mTask.getPrefixOrderIndex(), position, bounds,
mTask.getWindowConfiguration());
}
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 9251993..c353c1d 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -166,7 +166,7 @@
}
return new RemoteAnimationTarget(task.mTaskId, getMode(),
mCapturedLeash, !mAppWindowToken.fillsParent(),
- mainWindow.mWinAnimator.mLastClipRect,
+ mainWindow.mWinAnimator.mLastClipRect, mainWindow.mContentInsets,
mAppWindowToken.getPrefixOrderIndex(), mPosition, mStackBounds,
task.getWindowConfiguration());
}
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 7540e26..5e003ff 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -24,6 +24,7 @@
"com_android_server_connectivity_Vpn.cpp",
"com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
"com_android_server_ConsumerIrService.cpp",
+ "com_android_server_devicepolicy_CryptoTestHelper.cpp",
"com_android_server_HardwarePropertiesManagerService.cpp",
"com_android_server_hdmi_HdmiCecController.cpp",
"com_android_server_input_InputApplicationHandle.cpp",
diff --git a/services/core/jni/com_android_server_devicepolicy_CryptoTestHelper.cpp b/services/core/jni/com_android_server_devicepolicy_CryptoTestHelper.cpp
new file mode 100644
index 0000000..b53ea92
--- /dev/null
+++ b/services/core/jni/com_android_server_devicepolicy_CryptoTestHelper.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni.h"
+#include "core_jni_helpers.h"
+
+#include <openssl/crypto.h>
+
+namespace {
+
+static jint runSelfTest(JNIEnv* env, jobject /* clazz */) {
+ return BORINGSSL_self_test();
+}
+
+static const JNINativeMethod methods[] = {
+ /* name, signature, funcPtr */
+ {"runSelfTest", "()I", (void*) runSelfTest}
+};
+
+} // anonymous namespace
+
+namespace android {
+
+int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv *env) {
+ return jniRegisterNativeMethods(
+ env, "com/android/server/devicepolicy/CryptoTestHelper", methods, NELEM(methods));
+}
+
+} // namespace android
\ No newline at end of file
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index 07ddb05..bf2a637 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -42,6 +42,7 @@
int register_android_server_location_GnssLocationProvider(JNIEnv* env);
int register_android_server_connectivity_Vpn(JNIEnv* env);
int register_android_server_connectivity_tethering_OffloadHardwareInterface(JNIEnv*);
+int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv*);
int register_android_server_hdmi_HdmiCecController(JNIEnv* env);
int register_android_server_tv_TvUinputBridge(JNIEnv* env);
int register_android_server_tv_TvInputHal(JNIEnv* env);
@@ -88,6 +89,7 @@
register_android_server_location_GnssLocationProvider(env);
register_android_server_connectivity_Vpn(env);
register_android_server_connectivity_tethering_OffloadHardwareInterface(env);
+ register_android_server_devicepolicy_CryptoTestHelper(env);
register_android_server_ConsumerIrService(env);
register_android_server_BatteryStatsService(env);
register_android_server_hdmi_HdmiCecController(env);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/CryptoTestHelper.java b/services/devicepolicy/java/com/android/server/devicepolicy/CryptoTestHelper.java
new file mode 100644
index 0000000..a20758e
--- /dev/null
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/CryptoTestHelper.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.devicepolicy;
+
+import android.app.admin.SecurityLog;
+
+/**
+ * Helper to call native BoringSSL self test.
+ */
+public class CryptoTestHelper {
+ public static void runAndLogSelfTest() {
+ final int result = runSelfTest();
+ SecurityLog.writeEvent(SecurityLog.TAG_CRYPTO_SELF_TEST_COMPLETED, result);
+ }
+ private static native int runSelfTest();
+}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 953a79f..95e71ed 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2044,6 +2044,10 @@
public TransferOwnershipMetadataManager newTransferOwnershipMetadataManager() {
return new TransferOwnershipMetadataManager();
}
+
+ public void runCryptoSelfTest() {
+ CryptoTestHelper.runAndLogSelfTest();
+ }
}
/**
@@ -2296,6 +2300,7 @@
if (hasDeviceOwner && mInjector.securityLogGetLoggingEnabledProperty()) {
mSecurityLogMonitor.start();
+ mInjector.runCryptoSelfTest();
maybePauseDeviceWideLoggingLocked();
}
}
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
index 00e27c9..ab0bfefb 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceTestable.java
@@ -447,5 +447,8 @@
return new TransferOwnershipMetadataManager(
new TransferOwnershipMetadataManagerTest.MockInjector());
}
+
+ @Override
+ public void runCryptoSelfTest() {}
}
}
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
index 0abb48f..98483a8 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
@@ -294,7 +294,7 @@
null /*disabledPkg*/,
null /*sharedUser*/,
UPDATED_CODE_PATH /*codePath*/,
- null /*resourcePath*/,
+ UPDATED_CODE_PATH /*resourcePath*/,
null /*legacyNativeLibraryPath*/,
"arm64-v8a" /*primaryCpuAbi*/,
"armeabi" /*secondaryCpuAbi*/,
@@ -328,7 +328,7 @@
null /*disabledPkg*/,
null /*sharedUser*/,
UPDATED_CODE_PATH /*codePath*/,
- null /*resourcePath*/,
+ UPDATED_CODE_PATH /*resourcePath*/,
null /*legacyNativeLibraryPath*/,
"arm64-v8a" /*primaryCpuAbi*/,
"armeabi" /*secondaryCpuAbi*/,
@@ -561,34 +561,6 @@
false /*notLaunched*/, false /*stopped*/, true /*installed*/);
}
- @Test
- public void testInsertPackageSetting() {
- final PackageSetting ps = createPackageSetting(0 /*sharedUserId*/, 0 /*pkgFlags*/);
- final PackageParser.Package pkg = new PackageParser.Package(PACKAGE_NAME);
- pkg.applicationInfo.setCodePath(ps.codePathString);
- pkg.applicationInfo.setResourcePath(ps.resourcePathString);
- final Context context = InstrumentationRegistry.getContext();
- final Object lock = new Object();
- PermissionManagerInternal pmInt = PermissionManagerService.create(context, null, lock);
- final Settings settings =
- new Settings(context.getFilesDir(), pmInt.getPermissionSettings(), lock);
- pkg.usesStaticLibraries = new ArrayList<>(
- Arrays.asList("foo.bar1", "foo.bar2", "foo.bar3"));
- pkg.usesStaticLibrariesVersions = new long[] {2, 4, 6};
- settings.insertPackageSettingLPw(ps, pkg);
- assertEquals(pkg, ps.pkg);
- assertArrayEquals(pkg.usesStaticLibraries.toArray(new String[0]), ps.usesStaticLibraries);
- assertArrayEquals(pkg.usesStaticLibrariesVersions, ps.usesStaticLibrariesVersions);
-
- pkg.usesStaticLibraries = null;
- pkg.usesStaticLibrariesVersions = null;
- settings.insertPackageSettingLPw(ps, pkg);
- assertEquals(pkg, ps.pkg);
- assertNull("Actual: " + Arrays.toString(ps.usesStaticLibraries), ps.usesStaticLibraries);
- assertNull("Actual: " + Arrays.toString(ps.usesStaticLibrariesVersions),
- ps.usesStaticLibrariesVersions);
- }
-
private <T> void assertArrayEquals(T[] a, T[] b) {
assertTrue("Expected: " + Arrays.toString(a) + ", actual: " + Arrays.toString(b),
Arrays.equals(a, b));
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index 77413d9c..38408fe 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -17,7 +17,6 @@
package android.telephony;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -35,8 +34,6 @@
import android.util.DisplayMetrics;
import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.List;
/**
* A Parcelable class for Subscription Information.
@@ -335,7 +332,12 @@
return this.mCountryIso;
}
- /** @return whether the subscription is an embedded one. */
+ /**
+ * @return whether the subscription is an embedded one.
+ * @hide
+ *
+ * TODO(b/35851809): Make this public.
+ */
public boolean isEmbedded() {
return this.mIsEmbedded;
}
@@ -349,9 +351,9 @@
* @return whether the app is authorized to manage this subscription per its metadata.
* @throws UnsupportedOperationException if this subscription is not embedded.
* @hide
- * @deprecated - Do not use.
+ *
+ * TODO(b/35851809): Make this public.
*/
- @Deprecated
public boolean canManageSubscription(Context context) {
return canManageSubscription(context, context.getPackageName());
}
@@ -365,9 +367,7 @@
* @return whether the app is authorized to manage this subscription per its metadata.
* @throws UnsupportedOperationException if this subscription is not embedded.
* @hide
- * @deprecated - Do not use.
*/
- @Deprecated
public boolean canManageSubscription(Context context, String packageName) {
if (!isEmbedded()) {
throw new UnsupportedOperationException("Not an embedded subscription");
@@ -395,14 +395,14 @@
* @return the {@link UiccAccessRule}s dictating who is authorized to manage this subscription.
* @throws UnsupportedOperationException if this subscription is not embedded.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
- public @Nullable List<UiccAccessRule> getAccessRules() {
+ public @Nullable UiccAccessRule[] getAccessRules() {
if (!isEmbedded()) {
throw new UnsupportedOperationException("Not an embedded subscription");
}
- if (mAccessRules == null) return null;
- return Arrays.asList(mAccessRules);
+ return mAccessRules;
}
/**
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 11a1984..debf43d 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -30,7 +30,6 @@
import android.app.BroadcastOptions;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -823,13 +822,10 @@
* if the list is non-empty the list is sorted by {@link SubscriptionInfo#getSimSlotIndex}
* then by {@link SubscriptionInfo#getSubscriptionId}.
* </ul>
- *
- * <p>
- * Permissions android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE is required
- * for #getAvailableSubscriptionInfoList to be invoked.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public List<SubscriptionInfo> getAvailableSubscriptionInfoList() {
List<SubscriptionInfo> result = null;
@@ -867,6 +863,9 @@
* if the list is non-empty the list is sorted by {@link SubscriptionInfo#getSimSlotIndex}
* then by {@link SubscriptionInfo#getSubscriptionId}.
* </ul>
+ * @hide
+ *
+ * TODO(b/35851809): Make this public.
*/
public List<SubscriptionInfo> getAccessibleSubscriptionInfoList() {
List<SubscriptionInfo> result = null;
@@ -892,8 +891,9 @@
*
* <p>Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void requestEmbeddedSubscriptionInfoListRefresh() {
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
@@ -1892,51 +1892,4 @@
options.setTemporaryAppWhitelistDuration(TimeUnit.MINUTES.toMillis(1));
mContext.sendBroadcast(intent, null, options.toBundle());
}
-
- /**
- * Checks whether the app with the given context is authorized to manage the given subscription
- * according to its metadata. Only supported for embedded subscriptions (if
- * {@code SubscriptionInfo#isEmbedded} returns true).
- *
- * @param info The subscription to check.
- * @return whether the app is authorized to manage this subscription per its metadata.
- * @throws UnsupportedOperationException if this subscription is not embedded.
- */
- public boolean canManageSubscription(SubscriptionInfo info) {
- return canManageSubscription(info, mContext.getPackageName());
- }
-
- /**
- * Checks whether the given app is authorized to manage the given subscription according to its
- * metadata. Only supported for embedded subscriptions (if {@code SubscriptionInfo#isEmbedded}
- * returns true).
- *
- * @param info The subscription to check.
- * @param packageName Package name of the app to check.
- * @return whether the app is authorized to manage this subscription per its metadata.
- * @throws UnsupportedOperationException if this subscription is not embedded.
- * @hide
- */
- public boolean canManageSubscription(SubscriptionInfo info, String packageName) {
- if (!info.isEmbedded()) {
- throw new UnsupportedOperationException("Not an embedded subscription");
- }
- if (info.getAccessRules() == null) {
- return false;
- }
- PackageManager packageManager = mContext.getPackageManager();
- PackageInfo packageInfo;
- try {
- packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
- } catch (PackageManager.NameNotFoundException e) {
- throw new IllegalArgumentException("Unknown package: " + packageName, e);
- }
- for (UiccAccessRule rule : info.getAccessRules()) {
- if (rule.getCarrierPrivilegeStatus(packageInfo)
- == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
- return true;
- }
- }
- return false;
- }
}
diff --git a/telephony/java/android/telephony/UiccAccessRule.java b/telephony/java/android/telephony/UiccAccessRule.java
index c3f8a19..3937201 100644
--- a/telephony/java/android/telephony/UiccAccessRule.java
+++ b/telephony/java/android/telephony/UiccAccessRule.java
@@ -16,7 +16,6 @@
package android.telephony;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import android.os.Parcel;
@@ -40,8 +39,9 @@
* specification.
*
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public final class UiccAccessRule implements Parcelable {
private static final String TAG = "UiccAccessRule";
diff --git a/telephony/java/android/telephony/euicc/DownloadableSubscription.java b/telephony/java/android/telephony/euicc/DownloadableSubscription.java
index 88db22b..01041c8 100644
--- a/telephony/java/android/telephony/euicc/DownloadableSubscription.java
+++ b/telephony/java/android/telephony/euicc/DownloadableSubscription.java
@@ -16,17 +16,18 @@
package android.telephony.euicc;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.UiccAccessRule;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
import com.android.internal.util.Preconditions;
-/** Information about a subscription which is available for download. */
+/**
+ * Information about a subscription which is available for download.
+ *
+ * TODO(b/35851809): Make this public.
+ * @hide
+ */
public final class DownloadableSubscription implements Parcelable {
public static final Creator<DownloadableSubscription> CREATOR =
@@ -45,12 +46,11 @@
/**
* Activation code. May be null for subscriptions which are not based on activation codes, e.g.
* to download a default subscription assigned to this device.
- * Should use getEncodedActivationCode() instead.
* @hide
- * @deprecated - Do not use. This will be private. Use getEncodedActivationCode() instead.
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
@Nullable
- @Deprecated
public final String encodedActivationCode;
@Nullable private String confirmationCode;
@@ -58,16 +58,8 @@
// see getCarrierName and setCarrierName
@Nullable
private String carrierName;
-
// see getAccessRules and setAccessRules
- @Nullable
- private List<UiccAccessRule> accessRules;
-
- /** Gets the activation code. */
- @Nullable
- public String getEncodedActivationCode() {
- return encodedActivationCode;
- }
+ private UiccAccessRule[] accessRules;
/** @hide */
private DownloadableSubscription(String encodedActivationCode) {
@@ -78,59 +70,7 @@
encodedActivationCode = in.readString();
confirmationCode = in.readString();
carrierName = in.readString();
- accessRules = new ArrayList<UiccAccessRule>();
- in.readTypedList(accessRules, UiccAccessRule.CREATOR);
- }
-
- private DownloadableSubscription(String encodedActivationCode, String confirmationCode,
- String carrierName, List<UiccAccessRule> accessRules) {
- this.encodedActivationCode = encodedActivationCode;
- this.confirmationCode = confirmationCode;
- this.carrierName = carrierName;
- this.accessRules = accessRules;
- }
-
- /** @hide */
- @SystemApi
- public static final class Builder {
- @Nullable private String encodedActivationCode;
- @Nullable private String confirmationCode;
- @Nullable private String carrierName;
- List<UiccAccessRule> accessRules;
-
- public Builder() {}
-
- public Builder(DownloadableSubscription baseSubscription) {
- encodedActivationCode = baseSubscription.getEncodedActivationCode();
- confirmationCode = baseSubscription.getConfirmationCode();
- carrierName = baseSubscription.getCarrierName();
- accessRules = baseSubscription.getAccessRules();
- }
-
- public DownloadableSubscription build() {
- return new DownloadableSubscription(encodedActivationCode, confirmationCode,
- carrierName, accessRules);
- }
-
- public Builder setEncodedActivationCode(String value) {
- encodedActivationCode = value;
- return this;
- }
-
- public Builder setConfirmationCode(String value) {
- confirmationCode = value;
- return this;
- }
-
- public Builder setCarrierName(String value) {
- carrierName = value;
- return this;
- }
-
- public Builder setAccessRules(List<UiccAccessRule> value) {
- accessRules = value;
- return this;
- }
+ accessRules = in.createTypedArray(UiccAccessRule.CREATOR);
}
/**
@@ -147,10 +87,7 @@
/**
* Sets the confirmation code.
- * @hide
- * @deprecated - Do not use.
*/
- @Deprecated
public void setConfirmationCode(String confirmationCode) {
this.confirmationCode = confirmationCode;
}
@@ -166,9 +103,9 @@
/**
* Set the user-visible carrier name.
* @hide
- * @deprecated - Do not use.
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @Deprecated
public void setCarrierName(String carrierName) {
this.carrierName = carrierName;
}
@@ -180,43 +117,36 @@
* those created with {@link #forActivationCode}). May be populated with
* {@link EuiccManager#getDownloadableSubscriptionMetadata}.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
@Nullable
public String getCarrierName() {
return carrierName;
}
/**
- * Returns the {@link UiccAccessRule}s in list dictating access to this subscription.
+ * Returns the {@link UiccAccessRule}s dictating access to this subscription.
*
* <p>Only present for downloadable subscriptions that were queried from a server (as opposed to
* those created with {@link #forActivationCode}). May be populated with
* {@link EuiccManager#getDownloadableSubscriptionMetadata}.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
- public List<UiccAccessRule> getAccessRules() {
+ public UiccAccessRule[] getAccessRules() {
return accessRules;
}
/**
* Set the {@link UiccAccessRule}s dictating access to this subscription.
* @hide
- * @deprecated - Do not use.
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @Deprecated
- public void setAccessRules(List<UiccAccessRule> accessRules) {
- this.accessRules = accessRules;
- }
-
- /**
- * @hide
- * @deprecated - Do not use.
- */
- @Deprecated
public void setAccessRules(UiccAccessRule[] accessRules) {
- this.accessRules = Arrays.asList(accessRules);
+ this.accessRules = accessRules;
}
@Override
@@ -224,7 +154,7 @@
dest.writeString(encodedActivationCode);
dest.writeString(confirmationCode);
dest.writeString(carrierName);
- dest.writeTypedList(accessRules);
+ dest.writeTypedArray(accessRules, flags);
}
@Override
diff --git a/telephony/java/android/telephony/euicc/EuiccCardManager.java b/telephony/java/android/telephony/euicc/EuiccCardManager.java
index c3f4007..a1a6a5a 100644
--- a/telephony/java/android/telephony/euicc/EuiccCardManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccCardManager.java
@@ -17,7 +17,6 @@
import android.annotation.IntDef;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -50,14 +49,14 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import android.annotation.CallbackExecutor;
-import java.util.concurrent.Executor;
/**
* EuiccCardManager is the application interface to an eSIM card.
+ *
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
-@SystemApi
public class EuiccCardManager {
private static final String TAG = "EuiccCardManager";
@@ -69,7 +68,6 @@
CANCEL_REASON_TIMEOUT,
CANCEL_REASON_PPR_NOT_ALLOWED
})
- /** @hide */
public @interface CancelReason {}
/**
@@ -98,7 +96,6 @@
RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES,
RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS
})
- /** @hide */
public @interface ResetOption {}
/** Deletes all operational profiles. */
@@ -146,20 +143,18 @@
}
/**
- * Requests all the profiles on eUicc.
+ * Gets all the profiles on eUicc.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and all the profiles.
*/
- public void requestAllProfiles(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<EuiccProfileInfo[]> callback) {
+ public void getAllProfiles(String cardId, ResultCallback<EuiccProfileInfo[]> callback) {
try {
getIEuiccCardController().getAllProfiles(mContext.getOpPackageName(), cardId,
new IGetAllProfilesCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo[] profiles) {
- executor.execute(() -> callback.onComplete(resultCode, profiles));
+ callback.onComplete(resultCode, profiles);
}
});
} catch (RemoteException e) {
@@ -169,21 +164,19 @@
}
/**
- * Requests the profile of the given iccid.
+ * Gets the profile of the given iccid.
*
* @param cardId The Id of the eUICC.
* @param iccid The iccid of the profile.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and profile.
*/
- public void requestProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
- ResultCallback<EuiccProfileInfo> callback) {
+ public void getProfile(String cardId, String iccid, ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().getProfile(mContext.getOpPackageName(), cardId, iccid,
new IGetProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
- executor.execute(() -> callback.onComplete(resultCode, profile));
+ callback.onComplete(resultCode, profile);
}
});
} catch (RemoteException e) {
@@ -198,17 +191,16 @@
* @param cardId The Id of the eUICC.
* @param iccid The iccid of the profile.
* @param refresh Whether sending the REFRESH command to modem.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
public void disableProfile(String cardId, String iccid, boolean refresh,
- @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+ ResultCallback<Void> callback) {
try {
getIEuiccCardController().disableProfile(mContext.getOpPackageName(), cardId, iccid,
refresh, new IDisableProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
@@ -224,17 +216,16 @@
* @param cardId The Id of the eUICC.
* @param iccid The iccid of the profile to switch to.
* @param refresh Whether sending the REFRESH command to modem.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the EuiccProfileInfo enabled.
*/
public void switchToProfile(String cardId, String iccid, boolean refresh,
- @CallbackExecutor Executor executor, ResultCallback<EuiccProfileInfo> callback) {
+ ResultCallback<EuiccProfileInfo> callback) {
try {
getIEuiccCardController().switchToProfile(mContext.getOpPackageName(), cardId, iccid,
refresh, new ISwitchToProfileCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccProfileInfo profile) {
- executor.execute(() -> callback.onComplete(resultCode, profile));
+ callback.onComplete(resultCode, profile);
}
});
} catch (RemoteException e) {
@@ -249,17 +240,16 @@
* @param cardId The Id of the eUICC.
* @param iccid The iccid of the profile.
* @param nickname The nickname of the profile.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
public void setNickname(String cardId, String iccid, String nickname,
- @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+ ResultCallback<Void> callback) {
try {
getIEuiccCardController().setNickname(mContext.getOpPackageName(), cardId, iccid,
nickname, new ISetNicknameCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
@@ -273,17 +263,15 @@
*
* @param cardId The Id of the eUICC.
* @param iccid The iccid of the profile.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void deleteProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
- ResultCallback<Void> callback) {
+ public void deleteProfile(String cardId, String iccid, ResultCallback<Void> callback) {
try {
getIEuiccCardController().deleteProfile(mContext.getOpPackageName(), cardId, iccid,
new IDeleteProfileCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
@@ -298,17 +286,15 @@
* @param cardId The Id of the eUICC.
* @param options Bits of the options of resetting which parts of the eUICC memory. See
* EuiccCard for details.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void resetMemory(String cardId, @ResetOption int options,
- @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+ public void resetMemory(String cardId, @ResetOption int options, ResultCallback<Void> callback) {
try {
getIEuiccCardController().resetMemory(mContext.getOpPackageName(), cardId, options,
new IResetMemoryCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
@@ -318,20 +304,18 @@
}
/**
- * Requests the default SM-DP+ address from eUICC.
+ * Gets the default SM-DP+ address from eUICC.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the default SM-DP+ address.
*/
- public void requestDefaultSmdpAddress(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<String> callback) {
+ public void getDefaultSmdpAddress(String cardId, ResultCallback<String> callback) {
try {
getIEuiccCardController().getDefaultSmdpAddress(mContext.getOpPackageName(), cardId,
new IGetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
- executor.execute(() -> callback.onComplete(resultCode, address));
+ callback.onComplete(resultCode, address);
}
});
} catch (RemoteException e) {
@@ -341,20 +325,18 @@
}
/**
- * Requests the SM-DS address from eUICC.
+ * Gets the SM-DS address from eUICC.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code and the SM-DS address.
*/
- public void requestSmdsAddress(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<String> callback) {
+ public void getSmdsAddress(String cardId, ResultCallback<String> callback) {
try {
getIEuiccCardController().getSmdsAddress(mContext.getOpPackageName(), cardId,
new IGetSmdsAddressCallback.Stub() {
@Override
public void onComplete(int resultCode, String address) {
- executor.execute(() -> callback.onComplete(resultCode, address));
+ callback.onComplete(resultCode, address);
}
});
} catch (RemoteException e) {
@@ -368,18 +350,16 @@
*
* @param cardId The Id of the eUICC.
* @param defaultSmdpAddress The default SM-DP+ address to set.
- * @param executor The executor through which the callback should be invode.
* @param callback The callback to get the result code.
*/
- public void setDefaultSmdpAddress(String cardId, String defaultSmdpAddress,
- @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+ public void setDefaultSmdpAddress(String cardId, String defaultSmdpAddress, ResultCallback<Void> callback) {
try {
getIEuiccCardController().setDefaultSmdpAddress(mContext.getOpPackageName(), cardId,
defaultSmdpAddress,
new ISetDefaultSmdpAddressCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
@@ -389,20 +369,18 @@
}
/**
- * Requests Rules Authorisation Table.
+ * Gets Rules Authorisation Table.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the rule authorisation table.
*/
- public void requestRulesAuthTable(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<EuiccRulesAuthTable> callback) {
+ public void getRulesAuthTable(String cardId, ResultCallback<EuiccRulesAuthTable> callback) {
try {
getIEuiccCardController().getRulesAuthTable(mContext.getOpPackageName(), cardId,
new IGetRulesAuthTableCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccRulesAuthTable rat) {
- executor.execute(() -> callback.onComplete(resultCode, rat));
+ callback.onComplete(resultCode, rat);
}
});
} catch (RemoteException e) {
@@ -412,20 +390,18 @@
}
/**
- * Requests the eUICC challenge for new profile downloading.
+ * Gets the eUICC challenge for new profile downloading.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the challenge.
*/
- public void requestEuiccChallenge(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<byte[]> callback) {
+ public void getEuiccChallenge(String cardId, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccChallenge(mContext.getOpPackageName(), cardId,
new IGetEuiccChallengeCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] challenge) {
- executor.execute(() -> callback.onComplete(resultCode, challenge));
+ callback.onComplete(resultCode, challenge);
}
});
} catch (RemoteException e) {
@@ -435,20 +411,18 @@
}
/**
- * Requests the eUICC info1 defined in GSMA RSP v2.0+ for new profile downloading.
+ * Gets the eUICC info1 defined in GSMA RSP v2.0+ for new profile downloading.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the info1.
*/
- public void requestEuiccInfo1(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<byte[]> callback) {
+ public void getEuiccInfo1(String cardId, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccInfo1(mContext.getOpPackageName(), cardId,
new IGetEuiccInfo1Callback.Stub() {
@Override
public void onComplete(int resultCode, byte[] info) {
- executor.execute(() -> callback.onComplete(resultCode, info));
+ callback.onComplete(resultCode, info);
}
});
} catch (RemoteException e) {
@@ -461,17 +435,15 @@
* Gets the eUICC info2 defined in GSMA RSP v2.0+ for new profile downloading.
*
* @param cardId The Id of the eUICC.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the info2.
*/
- public void requestEuiccInfo2(String cardId, @CallbackExecutor Executor executor,
- ResultCallback<byte[]> callback) {
+ public void getEuiccInfo2(String cardId, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().getEuiccInfo2(mContext.getOpPackageName(), cardId,
new IGetEuiccInfo2Callback.Stub() {
@Override
public void onComplete(int resultCode, byte[] info) {
- executor.execute(() -> callback.onComplete(resultCode, info));
+ callback.onComplete(resultCode, info);
}
});
} catch (RemoteException e) {
@@ -494,13 +466,12 @@
* GSMA RSP v2.0+.
* @param serverCertificate ASN.1 data in byte array indicating SM-DP+ Certificate returned by
* SM-DP+ server.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and a byte array which represents a
* {@code AuthenticateServerResponse} defined in GSMA RSP v2.0+.
*/
public void authenticateServer(String cardId, String matchingId, byte[] serverSigned1,
byte[] serverSignature1, byte[] euiccCiPkIdToBeUsed, byte[] serverCertificate,
- @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
+ ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().authenticateServer(
mContext.getOpPackageName(),
@@ -513,7 +484,7 @@
new IAuthenticateServerCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ callback.onComplete(resultCode, response);
}
});
} catch (RemoteException e) {
@@ -534,13 +505,11 @@
* SM-DP+ server.
* @param smdpCertificate ASN.1 data in byte array indicating the SM-DP+ Certificate returned
* by SM-DP+ server.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and a byte array which represents a
* {@code PrepareDownloadResponse} defined in GSMA RSP v2.0+
*/
public void prepareDownload(String cardId, @Nullable byte[] hashCc, byte[] smdpSigned2,
- byte[] smdpSignature2, byte[] smdpCertificate, @CallbackExecutor Executor executor,
- ResultCallback<byte[]> callback) {
+ byte[] smdpSignature2, byte[] smdpCertificate, ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().prepareDownload(
mContext.getOpPackageName(),
@@ -552,7 +521,7 @@
new IPrepareDownloadCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ callback.onComplete(resultCode, response);
}
});
} catch (RemoteException e) {
@@ -566,12 +535,11 @@
*
* @param cardId The Id of the eUICC.
* @param boundProfilePackage the Bound Profile Package data returned by SM-DP+ server.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and a byte array which represents a
* {@code LoadBoundProfilePackageResponse} defined in GSMA RSP v2.0+.
*/
public void loadBoundProfilePackage(String cardId, byte[] boundProfilePackage,
- @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
+ ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().loadBoundProfilePackage(
mContext.getOpPackageName(),
@@ -580,7 +548,7 @@
new ILoadBoundProfilePackageCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ callback.onComplete(resultCode, response);
}
});
} catch (RemoteException e) {
@@ -595,12 +563,11 @@
* @param cardId The Id of the eUICC.
* @param transactionId the transaction ID returned by SM-DP+ server.
* @param reason the cancel reason.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and an byte[] which represents a
* {@code CancelSessionResponse} defined in GSMA RSP v2.0+.
*/
public void cancelSession(String cardId, byte[] transactionId, @CancelReason int reason,
- @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
+ ResultCallback<byte[]> callback) {
try {
getIEuiccCardController().cancelSession(
mContext.getOpPackageName(),
@@ -610,7 +577,7 @@
new ICancelSessionCallback.Stub() {
@Override
public void onComplete(int resultCode, byte[] response) {
- executor.execute(() -> callback.onComplete(resultCode, response));
+ callback.onComplete(resultCode, response);
}
});
} catch (RemoteException e) {
@@ -624,17 +591,16 @@
*
* @param cardId The Id of the eUICC.
* @param events bits of the event types ({@link EuiccNotification.Event}) to list.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the list of notifications.
*/
public void listNotifications(String cardId, @EuiccNotification.Event int events,
- @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
+ ResultCallback<EuiccNotification[]> callback) {
try {
getIEuiccCardController().listNotifications(mContext.getOpPackageName(), cardId, events,
new IListNotificationsCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification[] notifications) {
- executor.execute(() -> callback.onComplete(resultCode, notifications));
+ callback.onComplete(resultCode, notifications);
}
});
} catch (RemoteException e) {
@@ -648,17 +614,16 @@
*
* @param cardId The Id of the eUICC.
* @param events bits of the event types ({@link EuiccNotification.Event}) to list.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the list of notifications.
*/
public void retrieveNotificationList(String cardId, @EuiccNotification.Event int events,
- @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
+ ResultCallback<EuiccNotification[]> callback) {
try {
getIEuiccCardController().retrieveNotificationList(mContext.getOpPackageName(), cardId,
events, new IRetrieveNotificationListCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification[] notifications) {
- executor.execute(() -> callback.onComplete(resultCode, notifications));
+ callback.onComplete(resultCode, notifications);
}
});
} catch (RemoteException e) {
@@ -672,17 +637,16 @@
*
* @param cardId The Id of the eUICC.
* @param seqNumber the sequence number of the notification.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code and the notification.
*/
public void retrieveNotification(String cardId, int seqNumber,
- @CallbackExecutor Executor executor, ResultCallback<EuiccNotification> callback) {
+ ResultCallback<EuiccNotification> callback) {
try {
getIEuiccCardController().retrieveNotification(mContext.getOpPackageName(), cardId,
seqNumber, new IRetrieveNotificationCallback.Stub() {
@Override
public void onComplete(int resultCode, EuiccNotification notification) {
- executor.execute(() -> callback.onComplete(resultCode, notification));
+ callback.onComplete(resultCode, notification);
}
});
} catch (RemoteException e) {
@@ -696,11 +660,10 @@
*
* @param cardId The Id of the eUICC.
* @param seqNumber the sequence number of the notification.
- * @param executor The executor through which the callback should be invode.
* @param callback the callback to get the result code.
*/
public void removeNotificationFromList(String cardId, int seqNumber,
- @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+ ResultCallback<Void> callback) {
try {
getIEuiccCardController().removeNotificationFromList(
mContext.getOpPackageName(),
@@ -709,7 +672,7 @@
new IRemoveNotificationFromListCallback.Stub() {
@Override
public void onComplete(int resultCode) {
- executor.execute(() -> callback.onComplete(resultCode, null));
+ callback.onComplete(resultCode, null);
}
});
} catch (RemoteException e) {
diff --git a/telephony/java/android/telephony/euicc/EuiccInfo.java b/telephony/java/android/telephony/euicc/EuiccInfo.java
index a4adf05..5bfff08 100644
--- a/telephony/java/android/telephony/euicc/EuiccInfo.java
+++ b/telephony/java/android/telephony/euicc/EuiccInfo.java
@@ -23,6 +23,9 @@
* Information about an eUICC chip/device.
*
* @see EuiccManager#getEuiccInfo
+ * @hide
+ *
+ * TODO(b/35851809): Make this public.
*/
// WARNING: Do not add any privacy-sensitive fields to this class (such as an eUICC identifier)!
// This API is accessible to all applications. Privacy-sensitive fields should be returned in their
@@ -42,17 +45,12 @@
}
};
- @Nullable
- private final String osVersion;
-
/**
- * Gets the version of the operating system running on the eUICC. This field is
- * hardware-specific and is not guaranteed to match any particular format.
+ * Version of the operating system running on the eUICC. This field is hardware-specific and is
+ * not guaranteed to match any particular format.
*/
@Nullable
- public String getOsVersion() {
- return osVersion;
- }
+ public final String osVersion;
public EuiccInfo(@Nullable String osVersion) {
this.osVersion = osVersion;
diff --git a/telephony/java/android/telephony/euicc/EuiccManager.java b/telephony/java/android/telephony/euicc/EuiccManager.java
index 1637c55..7f913ce 100644
--- a/telephony/java/android/telephony/euicc/EuiccManager.java
+++ b/telephony/java/android/telephony/euicc/EuiccManager.java
@@ -42,6 +42,9 @@
* {@link Context#getSystemService(String)} and {@link Context#EUICC_SERVICE}.
*
* <p>See {@link #isEnabled} before attempting to use these APIs.
+ *
+ * TODO(b/35851809): Make this public.
+ * @hide
*/
public class EuiccManager {
@@ -53,8 +56,6 @@
*
* <p>The activity will immediately finish with {@link android.app.Activity#RESULT_CANCELED} if
* {@link #isEnabled} is false.
- *
- * This is ued by non-LPA app to bring up LUI.
*/
@SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS =
@@ -68,10 +69,8 @@
*
* <p class="note">This is a protected intent that can only be sent
* by the system.
- *
- * @hide
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
@SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_OTA_STATUS_CHANGED =
"android.telephony.euicc.action.OTA_STATUS_CHANGED";
@@ -79,10 +78,12 @@
/**
* Broadcast Action: The action sent to carrier app so it knows the carrier setup is not
* completed.
+ *
+ * TODO(b/35851809): Make this a public API.
*/
@SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE =
- "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE";
+ public static final String ACTION_NOTIFY_CARRIER_SETUP =
+ "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP";
/**
* Intent action to provision an embedded subscription.
@@ -94,9 +95,8 @@
* <p>The activity will immediately finish with {@link android.app.Activity#RESULT_CANCELED} if
* {@link #isEnabled} is false.
*
- * @hide
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
@SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION =
"android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
@@ -143,8 +143,9 @@
* Key for an extra set on {@link #getDownloadableSubscriptionMetadata} PendingIntent result
* callbacks providing the downloadable subscription metadata.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION =
"android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
@@ -152,8 +153,9 @@
* Key for an extra set on {@link #getDefaultDownloadableSubscriptionList} PendingIntent result
* callbacks providing the list of available downloadable subscriptions.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS =
"android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
@@ -199,7 +201,6 @@
* Euicc OTA update status which can be got by {@link #getOtaStatus}
* @hide
*/
- @SystemApi
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"EUICC_OTA_"}, value = {
EUICC_OTA_IN_PROGRESS,
@@ -214,37 +215,15 @@
/**
* An OTA is in progress. During this time, the eUICC is not available and the user may lose
* network access.
- * @hide
*/
- @SystemApi
public static final int EUICC_OTA_IN_PROGRESS = 1;
-
- /**
- * The OTA update failed.
- * @hide
- */
- @SystemApi
+ /** The OTA update failed. */
public static final int EUICC_OTA_FAILED = 2;
-
- /**
- * The OTA update finished successfully.
- * @hide
- */
- @SystemApi
+ /** The OTA update finished successfully. */
public static final int EUICC_OTA_SUCCEEDED = 3;
-
- /**
- * The OTA update not needed since current eUICC OS is latest.
- * @hide
- */
- @SystemApi
+ /** The OTA update not needed since current eUICC OS is latest. */
public static final int EUICC_OTA_NOT_NEEDED = 4;
-
- /**
- * The OTA status is unavailable since eUICC service is unavailable.
- * @hide
- */
- @SystemApi
+ /** The OTA status is unavailable since eUICC service is unavailable. */
public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5;
private final Context mContext;
@@ -297,10 +276,8 @@
*
* @return the status of eUICC OTA. If {@link #isEnabled()} is false or the eUICC is not ready,
* {@link OtaStatus#EUICC_OTA_STATUS_UNAVAILABLE} will be returned.
- *
- * @hide
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public int getOtaStatus() {
if (!isEnabled()) {
return EUICC_OTA_STATUS_UNAVAILABLE;
@@ -315,7 +292,7 @@
/**
* Attempt to download the given {@link DownloadableSubscription}.
*
- * <p>Requires the {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
+ * <p>Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
* or the calling app must be authorized to manage both the currently-active subscription and
* the subscription to be downloaded according to the subscription metadata. Without the former,
* an {@link #EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR} will be returned in the callback
@@ -377,16 +354,14 @@
*
* <p>To be called by the LUI upon completion of a resolvable error flow.
*
- * <p>Requires that the calling app has the
- * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
- *
* @param resolutionIntent The original intent used to start the LUI.
* @param resolutionExtras Resolution-specific extras depending on the result of the resolution.
* For example, this may indicate whether the user has consented or may include the input
* they provided.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void continueOperation(Intent resolutionIntent, Bundle resolutionExtras) {
if (!isEnabled()) {
PendingIntent callbackIntent =
@@ -420,8 +395,9 @@
* @param subscription the subscription which needs metadata filled in
* @param callbackIntent a PendingIntent to launch when the operation completes.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void getDownloadableSubscriptionMetadata(
DownloadableSubscription subscription, PendingIntent callbackIntent) {
if (!isEnabled()) {
@@ -450,8 +426,9 @@
*
* @param callbackIntent a PendingIntent to launch when the operation completes.
* @hide
+ *
+ * TODO(b/35851809): Make this a SystemApi.
*/
- @SystemApi
public void getDefaultDownloadableSubscriptionList(PendingIntent callbackIntent) {
if (!isEnabled()) {
sendUnavailableError(callbackIntent);
@@ -491,7 +468,7 @@
*
* <p>Requires that the calling app has carrier privileges according to the metadata of the
* profile to be deleted, or the
- * {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
+ * {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
*
* @param subscriptionId the ID of the subscription to delete.
* @param callbackIntent a PendingIntent to launch when the operation completes.
@@ -512,7 +489,7 @@
/**
* Switch to (enable) the given subscription.
*
- * <p>Requires the {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
+ * <p>Requires the {@link android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission,
* or the calling app must be authorized to manage both the currently-active subscription and
* the subscription to be enabled according to the subscription metadata. Without the former,
* an {@link #EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR} will be returned in the callback
@@ -622,7 +599,11 @@
}
}
- private static IEuiccController getIEuiccController() {
+ /**
+ * @hide
+ */
+ @TestApi
+ protected IEuiccController getIEuiccController() {
return IEuiccController.Stub.asInterface(ServiceManager.getService("econtroller"));
}
}
diff --git a/telephony/java/android/telephony/euicc/EuiccNotification.java b/telephony/java/android/telephony/euicc/EuiccNotification.java
index 43a7707..ef3c1ce 100644
--- a/telephony/java/android/telephony/euicc/EuiccNotification.java
+++ b/telephony/java/android/telephony/euicc/EuiccNotification.java
@@ -17,7 +17,6 @@
import android.annotation.IntDef;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
@@ -32,9 +31,10 @@
* disabling, or deleting).
*
* @hide
+ *
+ * TODO(b/35851809): Make this a @SystemApi.
*/
-@SystemApi
-public final class EuiccNotification implements Parcelable {
+public class EuiccNotification implements Parcelable {
/** Event */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, prefix = { "EVENT_" }, value = {
@@ -43,7 +43,6 @@
EVENT_DISABLE,
EVENT_DELETE
})
- /** @hide */
public @interface Event {}
/** A profile is downloaded and installed. */
@@ -58,7 +57,7 @@
/** A profile is deleted. */
public static final int EVENT_DELETE = 1 << 3;
- /** Value of the bits of all the events including install, enable, disable and delete. */
+ /** Value of the bits of all above events */
@Event
public static final int ALL_EVENTS =
EVENT_INSTALL | EVENT_ENABLE | EVENT_DISABLE | EVENT_DELETE;
diff --git a/telephony/java/android/telephony/euicc/EuiccRulesAuthTable.java b/telephony/java/android/telephony/euicc/EuiccRulesAuthTable.java
index 67ae983..7efe043 100644
--- a/telephony/java/android/telephony/euicc/EuiccRulesAuthTable.java
+++ b/telephony/java/android/telephony/euicc/EuiccRulesAuthTable.java
@@ -16,7 +16,6 @@
package android.telephony.euicc;
import android.annotation.IntDef;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.service.carrier.CarrierIdentifier;
@@ -28,21 +27,20 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.List;
/**
* This represents the RAT (Rules Authorisation Table) stored on eUICC.
+ *
* @hide
+ *
+ * TODO(b/35851809): Make this a @SystemApi.
*/
-@SystemApi
public final class EuiccRulesAuthTable implements Parcelable {
/** Profile policy rule flags */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, prefix = { "POLICY_RULE_FLAG_" }, value = {
POLICY_RULE_FLAG_CONSENT_REQUIRED
})
- /** @hide */
public @interface PolicyRuleFlag {}
/** User consent is required to install the profile. */
@@ -91,14 +89,12 @@
* @throws ArrayIndexOutOfBoundsException If the {@code mPosition} is larger than the size
* this table.
*/
- public Builder add(int policyRules, List<CarrierIdentifier> carrierId, int policyRuleFlags) {
+ public Builder add(int policyRules, CarrierIdentifier[] carrierId, int policyRuleFlags) {
if (mPosition >= mPolicyRules.length) {
throw new ArrayIndexOutOfBoundsException(mPosition);
}
mPolicyRules[mPosition] = policyRules;
- if (carrierId != null && carrierId.size() > 0) {
- mCarrierIds[mPosition] = carrierId.toArray(new CarrierIdentifier[carrierId.size()]);
- }
+ mCarrierIds[mPosition] = carrierId;
mPolicyRuleFlags[mPosition] = policyRuleFlags;
mPosition++;
return this;
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index 3fb4fae..bdbc149 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -12,6 +12,7 @@
import android.net.wifi.rtt.RangingResult;
import android.net.wifi.rtt.RangingResultCallback;
import android.net.wifi.rtt.WifiRttManager;
+import android.os.Handler;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
@@ -23,6 +24,7 @@
/** @hide */
@SystemApi
+@Deprecated
@SystemService(Context.WIFI_RTT_SERVICE)
public class RttManager {
@@ -180,6 +182,7 @@
/**
* This class describe the RTT capability of the Hardware
*/
+ @Deprecated
public static class RttCapabilities implements Parcelable {
/** @deprecated It is not supported*/
@Deprecated
@@ -313,12 +316,16 @@
};
}
+ /**
+ * This method is deprecated. Please use the {@link WifiRttManager} API.
+ */
@RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
public RttCapabilities getRttCapabilities() {
return mRttCapabilities;
}
/** specifies parameters for RTT request */
+ @Deprecated
public static class RttParams {
/**
* type of destination device being ranged
@@ -501,6 +508,7 @@
}
/** pseudo-private class used to parcel arguments */
+ @Deprecated
public static class ParcelableRttParams implements Parcelable {
@NonNull
@@ -588,12 +596,14 @@
};
}
+ @Deprecated
public static class WifiInformationElement {
/** Information Element ID 0xFF means element is invalid. */
public byte id;
public byte[] data;
}
/** specifies RTT results */
+ @Deprecated
public static class RttResult {
/** mac address of the device being ranged. */
public String bssid;
@@ -745,6 +755,7 @@
/** pseudo-private class used to parcel results. */
+ @Deprecated
public static class ParcelableRttResults implements Parcelable {
public RttResult mResults[];
@@ -910,7 +921,7 @@
};
}
-
+ @Deprecated
public static interface RttListener {
public void onSuccess(RttResult[] results);
public void onFailure(int reason, String description);
@@ -919,6 +930,9 @@
/**
* Request to start an RTT ranging
+ * <p>
+ * This method is deprecated. Please use the
+ * {@link WifiRttManager#startRanging(RangingRequest, RangingResultCallback, Handler)} API.
*
* @param params -- RTT request Parameters
* @param listener -- Call back to inform RTT result
@@ -990,6 +1004,10 @@
}
}
+ /**
+ * This method is deprecated and performs no function. Please use the {@link WifiRttManager}
+ * API.
+ */
@RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
public void stopRanging(RttListener listener) {
Log.e(TAG, "stopRanging: unsupported operation - nop");
@@ -1004,6 +1022,7 @@
* The client can freely destroy or reuse the callback after {@link RttManager#disableResponder}
* is called.
*/
+ @Deprecated
public abstract static class ResponderCallback {
/** Callback when responder is enabled. */
public abstract void onResponderEnabled(ResponderConfig config);
@@ -1019,6 +1038,10 @@
* Note calling this method with the same callback when the responder is already enabled won't
* change the responder state, a cached {@link ResponderConfig} from the last enabling will be
* returned through the callback.
+ * <p>
+ * This method is deprecated and will throw an {@link UnsupportedOperationException}
+ * exception. Please use the {@link WifiRttManager} API to perform a Wi-Fi Aware peer-to-peer
+ * ranging.
*
* @param callback Callback for responder enabling/disabling result.
* @throws IllegalArgumentException If {@code callback} is null.
@@ -1035,6 +1058,10 @@
* <p>
* Calling this method when responder isn't enabled won't have any effect. The callback can be
* reused for enabling responder after this method is called.
+ * <p>
+ * This method is deprecated and will throw an {@link UnsupportedOperationException}
+ * exception. Please use the {@link WifiRttManager} API to perform a Wi-Fi Aware peer-to-peer
+ * ranging.
*
* @param callback The same callback used for enabling responder.
* @throws IllegalArgumentException If {@code callback} is null.
@@ -1051,6 +1078,7 @@
*
* @see ScanResult
*/
+ @Deprecated
public static class ResponderConfig implements Parcelable {
// TODO: make all fields final once we can get mac address from responder HAL APIs.