diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2018-04-10 23:13:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-10 23:13:02 +0000 |
commit | 4f763c3e0e904a6ba511ba88f431a5bc1a2cd20b (patch) | |
tree | 2ea54e42c0568fd844c66202f5b785e305398363 | |
parent | 620238ee53dfac6681d1ce8c699acd12ad07264b (diff) | |
parent | 8ff51d65fa6a0d43e3dfc261717b362511c68b14 (diff) | |
download | base-android-vts-8.1_r5.tar.gz |
Merge "Snap for 4711598 from 833770d26f7813768e195d22ca9c8e41dc83448a to oreo-mr1-vts-release" into oreo-mr1-vts-releaseandroid-vts-8.1_r9android-vts-8.1_r8android-vts-8.1_r7android-vts-8.1_r6android-vts-8.1_r5android-vts-8.1_r4android-vts-8.1_r14android-vts-8.1_r13android-vts-8.1_r12android-vts-8.1_r11android-vts-8.1_r10oreo-mr1-vts-release
32 files changed, 355 insertions, 51 deletions
diff --git a/core/java/android/bluetooth/le/PeriodicAdvertisingReport.java b/core/java/android/bluetooth/le/PeriodicAdvertisingReport.java index 51b93cbd64dc..6fc8d553946e 100644 --- a/core/java/android/bluetooth/le/PeriodicAdvertisingReport.java +++ b/core/java/android/bluetooth/le/PeriodicAdvertisingReport.java @@ -71,7 +71,7 @@ public final class PeriodicAdvertisingReport implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(syncHandle); - dest.writeLong(txPower); + dest.writeInt(txPower); dest.writeInt(rssi); dest.writeInt(dataStatus); if (data != null) { diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java index 2b317d679d1c..05c4dc378890 100644 --- a/core/java/android/hardware/camera2/params/OutputConfiguration.java +++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java @@ -409,6 +409,7 @@ public final class OutputConfiguration implements Parcelable { this.mConfiguredSize = other.mConfiguredSize; this.mConfiguredGenerationId = other.mConfiguredGenerationId; this.mIsDeferredConfig = other.mIsDeferredConfig; + this.mIsShared = other.mIsShared; } /** @@ -421,6 +422,7 @@ public final class OutputConfiguration implements Parcelable { int width = source.readInt(); int height = source.readInt(); boolean isDeferred = source.readInt() == 1; + boolean isShared = source.readInt() == 1; ArrayList<Surface> surfaces = new ArrayList<Surface>(); source.readTypedList(surfaces, Surface.CREATOR); @@ -431,6 +433,7 @@ public final class OutputConfiguration implements Parcelable { mSurfaces = surfaces; mConfiguredSize = new Size(width, height); mIsDeferredConfig = isDeferred; + mIsShared = isShared; mSurfaces = surfaces; if (mSurfaces.size() > 0) { mSurfaceType = SURFACE_TYPE_UNKNOWN; diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java index 9edcc0e9b8d4..5ca3a4106a2d 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java @@ -720,6 +720,10 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { LOOP: while (end < length) { switch (uriString.charAt(end)) { case '/': // Start of path + case '\\':// Start of path + // Per http://url.spec.whatwg.org/#host-state, the \ character + // is treated as if it were a / character when encountered in a + // host case '?': // Start of query case '#': // Start of fragment break LOOP; @@ -758,6 +762,10 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { case '#': // Start of fragment return ""; // Empty path. case '/': // Start of path! + case '\\':// Start of path! + // Per http://url.spec.whatwg.org/#host-state, the \ character + // is treated as if it were a / character when encountered in a + // host break LOOP; } pathStart++; diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index a8acb976a637..766ad8454e6f 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -224,6 +224,12 @@ public class CallLog { public static final int FEATURES_WIFI = 0x8; /** + * Indicates the call underwent Assisted Dialing. + * @hide + */ + public static final Integer FEATURES_ASSISTED_DIALING_USED = 0x10; + + /** * The phone number as the user entered it. * <P>Type: TEXT</P> */ diff --git a/core/java/com/android/internal/colorextraction/types/Tonal.java b/core/java/com/android/internal/colorextraction/types/Tonal.java index e6ef10b3b7c6..71baaf177eac 100644 --- a/core/java/com/android/internal/colorextraction/types/Tonal.java +++ b/core/java/com/android/internal/colorextraction/types/Tonal.java @@ -51,9 +51,11 @@ public class Tonal implements ExtractionType { private static final boolean DEBUG = true; + public static final int THRESHOLD_COLOR_LIGHT = 0xffe0e0e0; public static final int MAIN_COLOR_LIGHT = 0xffe0e0e0; public static final int SECONDARY_COLOR_LIGHT = 0xff9e9e9e; - public static final int MAIN_COLOR_DARK = 0xff212121; + public static final int THRESHOLD_COLOR_DARK = 0xff212121; + public static final int MAIN_COLOR_DARK = 0xff000000; public static final int SECONDARY_COLOR_DARK = 0xff000000; private final TonalPalette mGreyPalette; @@ -197,12 +199,12 @@ public class Tonal implements ExtractionType { // light fallback or darker than our dark fallback. ColorUtils.colorToHSL(mainColor, mTmpHSL); final float mainLuminosity = mTmpHSL[2]; - ColorUtils.colorToHSL(MAIN_COLOR_LIGHT, mTmpHSL); + ColorUtils.colorToHSL(THRESHOLD_COLOR_LIGHT, mTmpHSL); final float lightLuminosity = mTmpHSL[2]; if (mainLuminosity > lightLuminosity) { return false; } - ColorUtils.colorToHSL(MAIN_COLOR_DARK, mTmpHSL); + ColorUtils.colorToHSL(THRESHOLD_COLOR_DARK, mTmpHSL); final float darkLuminosity = mTmpHSL[2]; if (mainLuminosity < darkLuminosity) { return false; diff --git a/core/java/com/android/internal/widget/VerifyCredentialResponse.java b/core/java/com/android/internal/widget/VerifyCredentialResponse.java index ad6020c0846c..7d1c70647092 100644 --- a/core/java/com/android/internal/widget/VerifyCredentialResponse.java +++ b/core/java/com/android/internal/widget/VerifyCredentialResponse.java @@ -98,6 +98,8 @@ public final class VerifyCredentialResponse implements Parcelable { if (mPayload != null) { dest.writeInt(mPayload.length); dest.writeByteArray(mPayload); + } else { + dest.writeInt(0); } } } diff --git a/core/proto/android/service/diskstats.proto b/core/proto/android/service/diskstats.proto index 4d865264d19e..4057e45430fe 100644 --- a/core/proto/android/service/diskstats.proto +++ b/core/proto/android/service/diskstats.proto @@ -47,7 +47,7 @@ message DiskStatsServiceDumpProto { } message DiskStatsCachedValuesProto { - // Total app data size, in kilobytes + // Total app code size, in kilobytes int64 agg_apps_size = 1; // Total app cache size, in kilobytes int64 agg_apps_cache_size = 2; @@ -65,15 +65,19 @@ message DiskStatsCachedValuesProto { int64 other_size = 8; // Sizes of individual packages repeated DiskStatsAppSizesProto app_sizes = 9; + // Total app data size, in kilobytes + int64 agg_apps_data_size = 10; } message DiskStatsAppSizesProto { // Name of the package string package_name = 1; - // App's data size in kilobytes + // App's code size in kilobytes int64 app_size = 2; // App's cache size in kilobytes int64 cache_size = 3; + // App's data size in kilobytes + int64 app_data_size = 4; } message DiskStatsFreeSpaceProto { diff --git a/core/tests/coretests/src/android/net/UriTest.java b/core/tests/coretests/src/android/net/UriTest.java index 27b7f9e185bb..ea0347d67ad7 100644 --- a/core/tests/coretests/src/android/net/UriTest.java +++ b/core/tests/coretests/src/android/net/UriTest.java @@ -192,6 +192,12 @@ public class UriTest extends TestCase { assertEquals("a:a@example.com:a@example2.com", uri.getAuthority()); assertEquals("example2.com", uri.getHost()); assertEquals(-1, uri.getPort()); + assertEquals("/path", uri.getPath()); + + uri = Uri.parse("http://a.foo.com\\.example.com/path"); + assertEquals("a.foo.com", uri.getHost()); + assertEquals(-1, uri.getPort()); + assertEquals("\\.example.com/path", uri.getPath()); } @SmallTest diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 0782269d7de1..733ffb180b3b 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -813,7 +813,13 @@ const char* ResStringPool::string8At(size_t idx, size_t* outLen) const *outLen = encLen; if ((uint32_t)(str+encLen-strings) < mStringPoolSize) { - return (const char*)str; + // Reject malformed (non null-terminated) strings + if (str[encLen] != 0x00) { + ALOGW("Bad string block: string #%d is not null-terminated", + (int)idx); + return NULL; + } + return (const char*)str; } else { ALOGW("Bad string block: string #%d extends to %d, past end at %d\n", (int)idx, (int)(str+encLen-strings), (int)mStringPoolSize); diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 7d7f9ae7f19e..04be92e73b38 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -1687,18 +1687,9 @@ public class SettingsProvider extends ContentProvider { } private List<String> getSettingsNamesLocked(int settingsType, int userId) { - boolean instantApp; - if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { - instantApp = false; - } else { - ApplicationInfo ai = getCallingApplicationInfoOrThrow(); - instantApp = ai.isInstantApp(); - } - if (instantApp) { - return new ArrayList<String>(getInstantAppAccessibleSettings(settingsType)); - } else { - return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); - } + // Don't enforce the instant app whitelist for now -- its too prone to unintended breakage + // in the current form. + return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId); } private void enforceSettingReadable(String settingName, int settingsType, int userId) { @@ -1711,8 +1702,10 @@ public class SettingsProvider extends ContentProvider { } if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { - throw new SecurityException("Setting " + settingName + " is not accessible from" - + " ephemeral package " + getCallingPackage()); + // Don't enforce the instant app whitelist for now -- its too prone to unintended + // breakage in the current form. + Slog.w(LOG_TAG, "Instant App " + ai.packageName + + " trying to access unexposed setting, this will be an error in the future."); } } diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index 81a23f0afa3f..a27515c0266d 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -4532,7 +4532,8 @@ message MetricsEvent { // OS: O MR AUTOFILL_SERVICE_DISABLED_SELF = 1135; - // Counter showing how long it took (in ms) to show the autofill UI after a field was focused + // Reports how long it took to show the autofill UI after a field was focused + // Tag FIELD_AUTOFILL_DURATION: Duration in ms // Tag FIELD_AUTOFILL_SERVICE: Package of service that processed the request // Package: Package of the autofill service // OS: O MR @@ -4567,8 +4568,40 @@ message MetricsEvent { // OS: O MR COLOR_MODE_SETTINGS = 1143; + // Enclosing category for group of APP_TRANSITION_FOO events, + // logged when we cancel an app transition. + APP_TRANSITION_CANCELLED = 1144; + + // Tag of a field representing a duration on autofill-related metrics. + FIELD_AUTOFILL_DURATION = 1145; + // ---- End O-MR1 Constants, all O-MR1 constants go above this line ---- + // ACTION: Stop an app and turn on background check + // CATEGORY: SETTINGS + // OS: P + ACTION_APP_STOP_AND_BACKGROUND_CHECK = 1233; + + // FIELD: The action type for each anomaly + // CATEGORY: SETTINGS + // OS: P + FIELD_ANOMALY_ACTION_TYPE = 1234; + + // OPEN: Settings -> Battery -> Wakelock anomaly + // CATEGORY: SETTINGS + // OS: P + ANOMALY_TYPE_WAKELOCK = 1235; + + // OPEN: Settings -> Battery -> Wakeup alarm anomaly + // CATEGORY: SETTINGS + // OS: P + ANOMALY_TYPE_WAKEUP_ALARM = 1236; + + // OPEN: Settings -> Battery -> Unoptimized bt anomaly + // CATEGORY: SETTINGS + // OS: P + ANOMALY_TYPE_UNOPTIMIZED_BT = 1237; + // Add new aosp constants above this line. // END OF AOSP CONSTANTS } diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto index 54eba2b332a4..9d25055d6d5a 100644 --- a/proto/src/wifi.proto +++ b/proto/src/wifi.proto @@ -336,6 +336,34 @@ message WifiLog { // Count of connection attempts that were initiated unsuccessfully optional int32 num_open_network_connect_message_failed_to_send = 82; + + // Histogram counting instances of scans with N many HotSpot 2.0 R1 APs + repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_in_scan_histogram = 83; + + // Histogram counting instances of scans with N many HotSpot 2.0 R2 APs + repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_in_scan_histogram = 84; + + // Histogram counting instances of scans with N many unique HotSpot 2.0 R1 ESS. + // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or + // (SSID, BSSID) tuple depending on AP configuration (in the above priority + // order). + repeated NumConnectableNetworksBucket observed_hotspot_r1_ess_in_scan_histogram = 85; + + // Histogram counting instances of scans with N many unique HotSpot 2.0 R2 ESS. + // Where ESS is defined as the (HESSID, ANQP Domain ID), (SSID, ANQP Domain ID) or + // (SSID, BSSID) tuple depending on AP configuration (in the above priority + // order). + repeated NumConnectableNetworksBucket observed_hotspot_r2_ess_in_scan_histogram = 86; + + // Histogram counting number of HotSpot 2.0 R1 APs per observed ESS in a scan + // (one value added per unique ESS - potentially multiple counts per single + // scan!) + repeated NumConnectableNetworksBucket observed_hotspot_r1_aps_per_ess_in_scan_histogram = 87; + + // Histogram counting number of HotSpot 2.0 R2 APs per observed ESS in a scan + // (one value added per unique ESS - potentially multiple counts per single + // scan!) + repeated NumConnectableNetworksBucket observed_hotspot_r2_aps_per_ess_in_scan_histogram = 88; } // Information that gets logged for every WiFi connection. @@ -645,6 +673,10 @@ message StaEvent { // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true TYPE_FRAMEWORK_DISCONNECT = 15; + + // The NetworkAgent score for wifi has changed in a way that may impact + // connectivity + TYPE_SCORE_BREACH = 16; } enum FrameworkDisconnectReason { @@ -756,6 +788,9 @@ message StaEvent { // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code) optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN]; + + // NetworkAgent score of connected wifi + optional int32 last_score = 14 [default = -1]; } // Wi-Fi Aware metrics diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 905db6734a73..de2950dd5985 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -1387,7 +1387,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mUiLatencyHistory.log(historyLog.toString()); final LogMaker metricsLog = newLogMaker(MetricsEvent.AUTOFILL_UI_LATENCY) - .setCounterValue((int) duration); + .addTaggedData(MetricsEvent.FIELD_AUTOFILL_DURATION, duration); mMetricsLogger.write(metricsLog); } } diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 9afa825a7d37..c1801b80af0d 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1339,7 +1339,8 @@ public class ConnectivityService extends IConnectivityManager.Stub public boolean isActiveNetworkMetered() { enforceAccessPermission(); - final NetworkCapabilities caps = getNetworkCapabilities(getActiveNetwork()); + final int uid = Binder.getCallingUid(); + final NetworkCapabilities caps = getUnfilteredActiveNetworkState(uid).networkCapabilities; if (caps != null) { return !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED); } else { diff --git a/services/core/java/com/android/server/DiskStatsService.java b/services/core/java/com/android/server/DiskStatsService.java index 800081e51c9a..2d2c6b0bc8b3 100644 --- a/services/core/java/com/android/server/DiskStatsService.java +++ b/services/core/java/com/android/server/DiskStatsService.java @@ -202,6 +202,8 @@ public class DiskStatsService extends Binder { JSONObject json = new JSONObject(jsonString); pw.print("App Size: "); pw.println(json.getLong(DiskStatsFileLogger.APP_SIZE_AGG_KEY)); + pw.print("App Data Size: "); + pw.println(json.getLong(DiskStatsFileLogger.APP_DATA_SIZE_AGG_KEY)); pw.print("App Cache Size: "); pw.println(json.getLong(DiskStatsFileLogger.APP_CACHE_AGG_KEY)); pw.print("Photos Size: "); @@ -220,6 +222,8 @@ public class DiskStatsService extends Binder { pw.println(json.getJSONArray(DiskStatsFileLogger.PACKAGE_NAMES_KEY)); pw.print("App Sizes: "); pw.println(json.getJSONArray(DiskStatsFileLogger.APP_SIZES_KEY)); + pw.print("App Data Sizes: "); + pw.println(json.getJSONArray(DiskStatsFileLogger.APP_DATA_KEY)); pw.print("Cache Sizes: "); pw.println(json.getJSONArray(DiskStatsFileLogger.APP_CACHES_KEY)); } catch (IOException | JSONException e) { @@ -235,6 +239,8 @@ public class DiskStatsService extends Binder { proto.write(DiskStatsCachedValuesProto.AGG_APPS_SIZE, json.getLong(DiskStatsFileLogger.APP_SIZE_AGG_KEY)); + proto.write(DiskStatsCachedValuesProto.AGG_APPS_DATA_SIZE, + json.getLong(DiskStatsFileLogger.APP_DATA_SIZE_AGG_KEY)); proto.write(DiskStatsCachedValuesProto.AGG_APPS_CACHE_SIZE, json.getLong(DiskStatsFileLogger.APP_CACHE_AGG_KEY)); proto.write(DiskStatsCachedValuesProto.PHOTOS_SIZE, @@ -252,22 +258,26 @@ public class DiskStatsService extends Binder { JSONArray packageNamesArray = json.getJSONArray(DiskStatsFileLogger.PACKAGE_NAMES_KEY); JSONArray appSizesArray = json.getJSONArray(DiskStatsFileLogger.APP_SIZES_KEY); + JSONArray appDataSizesArray = json.getJSONArray(DiskStatsFileLogger.APP_DATA_KEY); JSONArray cacheSizesArray = json.getJSONArray(DiskStatsFileLogger.APP_CACHES_KEY); final int len = packageNamesArray.length(); - if (len == appSizesArray.length() && len == cacheSizesArray.length()) { + if (len == appSizesArray.length() + && len == appDataSizesArray.length() + && len == cacheSizesArray.length()) { for (int i = 0; i < len; i++) { long packageToken = proto.start(DiskStatsCachedValuesProto.APP_SIZES); proto.write(DiskStatsAppSizesProto.PACKAGE_NAME, packageNamesArray.getString(i)); proto.write(DiskStatsAppSizesProto.APP_SIZE, appSizesArray.getLong(i)); + proto.write(DiskStatsAppSizesProto.APP_DATA_SIZE, appDataSizesArray.getLong(i)); proto.write(DiskStatsAppSizesProto.CACHE_SIZE, cacheSizesArray.getLong(i)); proto.end(packageToken); } } else { - Slog.wtf(TAG, "Sizes of packageNamesArray, appSizesArray and cacheSizesArray " - + "are not the same"); + Slog.wtf(TAG, "Sizes of packageNamesArray, appSizesArray, appDataSizesArray " + + " and cacheSizesArray are not the same"); } proto.end(cachedValuesToken); diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 90ad8a5d0131..9d823a726afe 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -1043,8 +1043,8 @@ public final class ActiveServices { try { if (AppGlobals.getPackageManager().checkPermission( android.Manifest.permission.INSTANT_APP_FOREGROUND_SERVICE, - r.appInfo.packageName, - r.appInfo.uid) != PackageManager.PERMISSION_GRANTED) { + r.appInfo.packageName, UserHandle.getUserId(r.appInfo.uid)) + != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Instant app " + r.appInfo.packageName + " does not have permission to create foreground" + "services"); diff --git a/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java b/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java index 3a9bf1258d12..276f0efb570e 100644 --- a/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java +++ b/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java @@ -94,6 +94,7 @@ class ActivityManagerDebugConfig { static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false; static final boolean DEBUG_PERMISSIONS_REVIEW = DEBUG_ALL || false; static final boolean DEBUG_WHITELISTS = DEBUG_ALL || false; + static final boolean DEBUG_METRICS = DEBUG_ALL || false; static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : ""; static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : ""; diff --git a/services/core/java/com/android/server/am/ActivityMetricsLogger.java b/services/core/java/com/android/server/am/ActivityMetricsLogger.java index f396e9ef44a5..a8038747aa2a 100644 --- a/services/core/java/com/android/server/am/ActivityMetricsLogger.java +++ b/services/core/java/com/android/server/am/ActivityMetricsLogger.java @@ -12,6 +12,7 @@ import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_BIND_APPLICATION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CALLING_PACKAGE_NAME; +import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CANCELLED; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_IS_EPHEMERAL; @@ -27,6 +28,7 @@ import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_T import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_NO_BUNDLE; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_WITH_BUNDLE; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_WARM_LAUNCH; +import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_METRICS; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityStack.STACK_INVISIBLE; @@ -34,12 +36,16 @@ import static com.android.server.am.ActivityStack.STACK_INVISIBLE; import android.app.ActivityManager.StackId; import android.content.Context; import android.metrics.LogMaker; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; import android.os.SystemClock; import android.util.Slog; import android.util.SparseArray; import android.util.SparseIntArray; import com.android.internal.logging.MetricsLogger; +import com.android.internal.os.SomeArgs; import java.util.ArrayList; @@ -60,6 +66,8 @@ class ActivityMetricsLogger { private static final long INVALID_START_TIME = -1; + private static final int MSG_CHECK_VISIBILITY = 0; + // Preallocated strings we are sending to tron, so we don't have to allocate a new one every // time we log. private static final String[] TRON_WINDOW_STATE_VARZ_STRINGS = { @@ -80,6 +88,23 @@ class ActivityMetricsLogger { private final SparseArray<StackTransitionInfo> mStackTransitionInfo = new SparseArray<>(); private final SparseArray<StackTransitionInfo> mLastStackTransitionInfo = new SparseArray<>(); + private final H mHandler; + private final class H extends Handler { + + public H(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case MSG_CHECK_VISIBILITY: + final SomeArgs args = (SomeArgs) msg.obj; + checkVisibility((TaskRecord) args.arg1, (ActivityRecord) args.arg2); + break; + } + } + }; private final class StackTransitionInfo { private ActivityRecord launchedActivity; @@ -93,10 +118,11 @@ class ActivityMetricsLogger { private boolean loggedStartingWindowDrawn; } - ActivityMetricsLogger(ActivityStackSupervisor supervisor, Context context) { + ActivityMetricsLogger(ActivityStackSupervisor supervisor, Context context, Looper looper) { mLastLogTimeSecs = SystemClock.elapsedRealtime() / 1000; mSupervisor = supervisor; mContext = context; + mHandler = new H(looper); } void logWindowState() { @@ -142,6 +168,7 @@ class ActivityMetricsLogger { */ void notifyActivityLaunching() { if (!isAnyTransitionActive()) { + if (DEBUG_METRICS) Slog.i(TAG, "notifyActivityLaunching"); mCurrentTransitionStartTime = SystemClock.uptimeMillis(); mLastTransitionStartTime = mCurrentTransitionStartTime; } @@ -199,6 +226,12 @@ class ActivityMetricsLogger { private void notifyActivityLaunched(int resultCode, ActivityRecord launchedActivity, boolean processRunning, boolean processSwitch) { + if (DEBUG_METRICS) Slog.i(TAG, "notifyActivityLaunched" + + " resultCode=" + resultCode + + " launchedActivity=" + launchedActivity + + " processRunning=" + processRunning + + " processSwitch=" + processSwitch); + // If we are already in an existing transition, only update the activity name, but not the // other attributes. final int stackId = launchedActivity != null && launchedActivity.getStack() != null @@ -227,6 +260,8 @@ class ActivityMetricsLogger { return; } + if (DEBUG_METRICS) Slog.i(TAG, "notifyActivityLaunched successful"); + final StackTransitionInfo newInfo = new StackTransitionInfo(); newInfo.launchedActivity = launchedActivity; newInfo.currentTransitionProcessRunning = processRunning; @@ -240,6 +275,8 @@ class ActivityMetricsLogger { * Notifies the tracker that all windows of the app have been drawn. */ void notifyWindowsDrawn(int stackId, long timestamp) { + if (DEBUG_METRICS) Slog.i(TAG, "notifyWindowsDrawn stackId=" + stackId); + final StackTransitionInfo info = mStackTransitionInfo.get(stackId); if (info == null || info.loggedWindowsDrawn) { return; @@ -273,6 +310,7 @@ class ActivityMetricsLogger { if (!isAnyTransitionActive() || mLoggedTransitionStarting) { return; } + if (DEBUG_METRICS) Slog.i(TAG, "notifyTransitionStarting"); mCurrentTransitionDelayMs = calculateDelay(timestamp); mLoggedTransitionStarting = true; for (int index = stackIdReasons.size() - 1; index >= 0; index--) { @@ -292,17 +330,37 @@ class ActivityMetricsLogger { * Notifies the tracker that the visibility of an app is changing. * * @param activityRecord the app that is changing its visibility - * @param visible whether it's going to be visible or not */ - void notifyVisibilityChanged(ActivityRecord activityRecord, boolean visible) { + void notifyVisibilityChanged(ActivityRecord activityRecord) { final StackTransitionInfo info = mStackTransitionInfo.get(activityRecord.getStackId()); + if (info == null) { + return; + } + if (info.launchedActivity != activityRecord) { + return; + } + final TaskRecord t = activityRecord.getTask(); + final SomeArgs args = SomeArgs.obtain(); + args.arg1 = t; + args.arg2 = activityRecord; + mHandler.obtainMessage(MSG_CHECK_VISIBILITY, args).sendToTarget(); + } - // If we have an active transition that's waiting on a certain activity that will be - // invisible now, we'll never get onWindowsDrawn, so abort the transition if necessary. - if (info != null && !visible && info.launchedActivity == activityRecord) { - mStackTransitionInfo.remove(activityRecord.getStackId()); - if (mStackTransitionInfo.size() == 0) { - reset(true /* abort */); + private void checkVisibility(TaskRecord t, ActivityRecord r) { + synchronized (mSupervisor.mService) { + + final StackTransitionInfo info = mStackTransitionInfo.get(r.getStackId()); + + // If we have an active transition that's waiting on a certain activity that will be + // invisible now, we'll never get onWindowsDrawn, so abort the transition if necessary. + if (info != null && !t.isVisible()) { + if (DEBUG_METRICS) Slog.i(TAG, "notifyVisibilityChanged to invisible" + + " activity=" + r); + logAppTransitionCancel(info); + mStackTransitionInfo.remove(r.getStackId()); + if (mStackTransitionInfo.size() == 0) { + reset(true /* abort */); + } } } } @@ -338,6 +396,7 @@ class ActivityMetricsLogger { } private void reset(boolean abort) { + if (DEBUG_METRICS) Slog.i(TAG, "reset abort=" + abort); if (!abort && isAnyTransitionActive()) { logAppTransitionMultiEvents(); } @@ -358,7 +417,20 @@ class ActivityMetricsLogger { return (int) (timestamp - mCurrentTransitionStartTime); } + private void logAppTransitionCancel(StackTransitionInfo info) { + final int type = getTransitionType(info); + if (type == -1) { + return; + } + final LogMaker builder = new LogMaker(APP_TRANSITION_CANCELLED); + builder.setPackageName(info.launchedActivity.packageName); + builder.setType(type); + builder.addTaggedData(FIELD_CLASS_NAME, info.launchedActivity.info.name); + mMetricsLogger.write(builder); + } + private void logAppTransitionMultiEvents() { + if (DEBUG_METRICS) Slog.i(TAG, "logging transition events"); for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) { final StackTransitionInfo info = mStackTransitionInfo.valueAt(index); final int type = getTransitionType(info); diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index be281df3a445..ee23d6328f10 100644 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -1585,7 +1585,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo void setVisibility(boolean visible) { mWindowContainerController.setVisibility(visible, mDeferHidingClient); - mStackSupervisor.mActivityMetricsLogger.notifyVisibilityChanged(this, visible); + mStackSupervisor.mActivityMetricsLogger.notifyVisibilityChanged(this); } // TODO: Look into merging with #setVisibility() diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index b2dc3e6a8b69..795d7dde78a0 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -606,7 +606,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D public ActivityStackSupervisor(ActivityManagerService service, Looper looper) { mService = service; mHandler = new ActivityStackSupervisorHandler(looper); - mActivityMetricsLogger = new ActivityMetricsLogger(this, mService.mContext); + mActivityMetricsLogger = new ActivityMetricsLogger(this, mService.mContext, looper); mKeyguardController = new KeyguardController(service, this); } @@ -4836,9 +4836,13 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D mService.mActivityStarter.sendPowerHintForLaunchStartIfNeeded(true /* forceSend */, targetActivity); mActivityMetricsLogger.notifyActivityLaunching(); - mService.moveTaskToFrontLocked(task.taskId, 0, bOptions, true /* fromRecents */); - mActivityMetricsLogger.notifyActivityLaunched(ActivityManager.START_TASK_TO_FRONT, - targetActivity); + try { + mService.moveTaskToFrontLocked(task.taskId, 0, bOptions, + true /* fromRecents */); + } finally { + mActivityMetricsLogger.notifyActivityLaunched(START_TASK_TO_FRONT, + targetActivity); + } // If we are launching the task in the docked stack, put it into resizing mode so // the window renders full-screen with the background filling the void. Also only diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index eadc8a6eadba..f83310954c3d 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -1151,6 +1151,16 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta return null; } + boolean isVisible() { + for (int i = mActivities.size() - 1; i >= 0; --i) { + final ActivityRecord r = mActivities.get(i); + if (r.visible) { + return true; + } + } + return false; + } + void getAllRunningVisibleActivitiesLocked(ArrayList<ActivityRecord> outActivities) { if (mStack != null) { for (int activityNdx = mActivities.size() - 1; activityNdx >= 0; --activityNdx) { diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java index b7b91a76ebf3..625764cea550 100644 --- a/services/core/java/com/android/server/notification/ManagedServices.java +++ b/services/core/java/com/android/server/notification/ManagedServices.java @@ -39,8 +39,10 @@ import android.content.pm.ServiceInfo; import android.content.pm.UserInfo; import android.os.Binder; import android.os.Build; +import android.os.Handler; import android.os.IBinder; import android.os.IInterface; +import android.os.Looper; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; @@ -82,6 +84,7 @@ abstract public class ManagedServices { protected final String TAG = getClass().getSimpleName(); protected final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); + private static final int ON_BINDING_DIED_REBIND_DELAY_MS = 10000; protected static final String ENABLED_SERVICES_SEPARATOR = ":"; /** @@ -101,12 +104,15 @@ abstract public class ManagedServices { private final IPackageManager mPm; private final UserManager mUm; private final Config mConfig; + private final Handler mHandler = new Handler(Looper.getMainLooper()); // contains connections to all connected services, including app services // and system services private final ArrayList<ManagedServiceInfo> mServices = new ArrayList<>(); // things that will be put into mServices as soon as they're ready private final ArrayList<String> mServicesBinding = new ArrayList<>(); + private final ArraySet<String> mServicesRebinding = new ArraySet<>(); + // lists the component names of all enabled (and therefore potentially connected) // app services for current profiles. private ArraySet<ComponentName> mEnabledServicesForCurrentProfiles @@ -823,6 +829,7 @@ abstract public class ManagedServices { final String servicesBindingTag = name.toString() + "/" + userid; if (mServicesBinding.contains(servicesBindingTag)) { + Slog.v(TAG, "Not registering " + name + " as bind is already in progress"); // stop registering this thing already! we're working on it return; } @@ -871,6 +878,7 @@ abstract public class ManagedServices { boolean added = false; ManagedServiceInfo info = null; synchronized (mMutex) { + mServicesRebinding.remove(servicesBindingTag); mServicesBinding.remove(servicesBindingTag); try { mService = asInterface(binder); @@ -892,6 +900,27 @@ abstract public class ManagedServices { mServicesBinding.remove(servicesBindingTag); Slog.v(TAG, getCaption() + " connection lost: " + name); } + + @Override + public void onBindingDied(ComponentName name) { + Slog.w(TAG, getCaption() + " binding died: " + name); + synchronized (mMutex) { + mServicesBinding.remove(servicesBindingTag); + mContext.unbindService(this); + if (!mServicesRebinding.contains(servicesBindingTag)) { + mServicesRebinding.add(servicesBindingTag); + mHandler.postDelayed(new Runnable() { + @Override + public void run() { + registerService(name, userid); + } + }, ON_BINDING_DIED_REBIND_DELAY_MS); + } else { + Slog.v(TAG, getCaption() + " not rebinding as " + + "a previous rebind attempt was made: " + name); + } + } + } }; if (!mContext.bindServiceAsUser(intent, serviceConnection, diff --git a/services/core/java/com/android/server/storage/AppCollector.java b/services/core/java/com/android/server/storage/AppCollector.java index 03b754f777b3..0b51f9cc7b7c 100644 --- a/services/core/java/com/android/server/storage/AppCollector.java +++ b/services/core/java/com/android/server/storage/AppCollector.java @@ -135,7 +135,7 @@ public class AppCollector { PackageStats packageStats = new PackageStats(app.packageName, user.id); packageStats.cacheSize = storageStats.getCacheBytes(); - packageStats.codeSize = storageStats.getCodeBytes(); + packageStats.codeSize = storageStats.getAppBytes(); packageStats.dataSize = storageStats.getDataBytes(); stats.add(packageStats); } catch (NameNotFoundException | IOException e) { diff --git a/services/core/java/com/android/server/storage/DiskStatsFileLogger.java b/services/core/java/com/android/server/storage/DiskStatsFileLogger.java index 0094ab5559d8..1db3ec4ca506 100644 --- a/services/core/java/com/android/server/storage/DiskStatsFileLogger.java +++ b/services/core/java/com/android/server/storage/DiskStatsFileLogger.java @@ -56,10 +56,12 @@ public class DiskStatsFileLogger { public static final String SYSTEM_KEY = "systemSize"; public static final String MISC_KEY = "otherSize"; public static final String APP_SIZE_AGG_KEY = "appSize"; + public static final String APP_DATA_SIZE_AGG_KEY = "appDataSize"; public static final String APP_CACHE_AGG_KEY = "cacheSize"; public static final String PACKAGE_NAMES_KEY = "packageNames"; public static final String APP_SIZES_KEY = "appSizes"; public static final String APP_CACHES_KEY = "cacheSizes"; + public static final String APP_DATA_KEY = "appDataSizes"; public static final String LAST_QUERY_TIMESTAMP_KEY = "queryTime"; private MeasurementResult mResult; @@ -114,31 +116,39 @@ public class DiskStatsFileLogger { private void addAppsToJson(JSONObject json) throws JSONException { JSONArray names = new JSONArray(); JSONArray appSizeList = new JSONArray(); + JSONArray appDataSizeList = new JSONArray(); JSONArray cacheSizeList = new JSONArray(); long appSizeSum = 0L; + long appDataSizeSum = 0L; long cacheSizeSum = 0L; boolean isExternal = Environment.isExternalStorageEmulated(); for (Map.Entry<String, PackageStats> entry : filterOnlyPrimaryUser().entrySet()) { PackageStats stat = entry.getValue(); - long appSize = stat.codeSize + stat.dataSize; + long appSize = stat.codeSize; + long appDataSize = stat.dataSize; long cacheSize = stat.cacheSize; if (isExternal) { - appSize += stat.externalCodeSize + stat.externalDataSize; + appSize += stat.externalCodeSize; + appDataSize += stat.externalDataSize; cacheSize += stat.externalCacheSize; } appSizeSum += appSize; + appDataSizeSum += appDataSize; cacheSizeSum += cacheSize; names.put(stat.packageName); appSizeList.put(appSize); + appDataSizeList.put(appDataSize); cacheSizeList.put(cacheSize); } json.put(PACKAGE_NAMES_KEY, names); json.put(APP_SIZES_KEY, appSizeList); json.put(APP_CACHES_KEY, cacheSizeList); + json.put(APP_DATA_KEY, appDataSizeList); json.put(APP_SIZE_AGG_KEY, appSizeSum); json.put(APP_CACHE_AGG_KEY, cacheSizeSum); + json.put(APP_DATA_SIZE_AGG_KEY, appDataSizeSum); } /** diff --git a/services/tests/servicestests/src/com/android/server/storage/DiskStatsLoggingServiceTest.java b/services/tests/servicestests/src/com/android/server/storage/DiskStatsLoggingServiceTest.java index 375edf3cb5ae..b647b99df894 100644 --- a/services/tests/servicestests/src/com/android/server/storage/DiskStatsLoggingServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/storage/DiskStatsLoggingServiceTest.java @@ -149,11 +149,13 @@ public class DiskStatsLoggingServiceTest extends AndroidTestCase { assertThat(json.getLong(DiskStatsFileLogger.DOWNLOADS_KEY)).isEqualTo(3L); assertThat(json.getLong(DiskStatsFileLogger.SYSTEM_KEY)).isEqualTo(10L); assertThat(json.getLong(DiskStatsFileLogger.MISC_KEY)).isEqualTo(7L); - assertThat(json.getLong(DiskStatsFileLogger.APP_SIZE_AGG_KEY)).isEqualTo(15L); + assertThat(json.getLong(DiskStatsFileLogger.APP_SIZE_AGG_KEY)).isEqualTo(10L); + assertThat(json.getLong(DiskStatsFileLogger.APP_DATA_SIZE_AGG_KEY)).isEqualTo(5L); assertThat(json.getLong(DiskStatsFileLogger.APP_CACHE_AGG_KEY)).isEqualTo(55L); assertThat( json.getJSONArray(DiskStatsFileLogger.PACKAGE_NAMES_KEY).length()).isEqualTo(1L); assertThat(json.getJSONArray(DiskStatsFileLogger.APP_SIZES_KEY).length()).isEqualTo(1L); + assertThat(json.getJSONArray(DiskStatsFileLogger.APP_DATA_KEY).length()).isEqualTo(1L); assertThat(json.getJSONArray(DiskStatsFileLogger.APP_CACHES_KEY).length()).isEqualTo(1L); } diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index e13bd6193719..6114a20d079b 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -416,8 +416,15 @@ public final class Call { */ public static final int PROPERTY_SELF_MANAGED = 0x00000100; + /** + * Indicates the call used Assisted Dialing. + * See also {@link Connection#PROPERTY_ASSISTED_DIALING_USED} + * @hide + */ + public static final int PROPERTY_ASSISTED_DIALING_USED = 0x00000200; + //****************************************************************************************** - // Next PROPERTY value: 0x00000200 + // Next PROPERTY value: 0x00000400 //****************************************************************************************** private final String mTelecomCallId; @@ -577,6 +584,9 @@ public final class Call { if(hasProperty(properties, PROPERTY_HAS_CDMA_VOICE_PRIVACY)) { builder.append(" PROPERTY_HAS_CDMA_VOICE_PRIVACY"); } + if(hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) { + builder.append(" PROPERTY_ASSISTED_DIALING_USED"); + } builder.append("]"); return builder.toString(); } diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index ef760a053c54..abbf5df9d07a 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -401,8 +401,14 @@ public abstract class Connection extends Conferenceable { @TestApi public static final int PROPERTY_IS_RTT = 1 << 8; + /** + * Set by the framework to indicate that a connection is using assisted dialing. + * @hide + */ + public static final int PROPERTY_ASSISTED_DIALING_USED = 1 << 9; + //********************************************************************************************** - // Next PROPERTY value: 1<<9 + // Next PROPERTY value: 1<<10 //********************************************************************************************** /** diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index b1eedf5cad4b..53ebbe47d23a 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -582,6 +582,14 @@ public class TelecomManager { "android.telecom.extra.CALL_BACK_INTENT"; /** + * The boolean indicated by this extra controls whether or not a call is eligible to undergo + * assisted dialing. This extra is stored under {@link #EXTRA_OUTGOING_CALL_EXTRAS}. + * @hide + */ + public static final String EXTRA_USE_ASSISTED_DIALING = + "android.telecom.extra.USE_ASSISTED_DIALING"; + + /** * The following 4 constants define how properties such as phone numbers and names are * displayed to the user. */ diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 450a0c66d2e9..53e506bd0004 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -331,6 +331,19 @@ public class CarrierConfigManager { "notify_handover_video_from_wifi_to_lte_bool"; /** + * Flag specifying whether the carrier wants to notify the user when a VT call has been handed + * over from LTE to WIFI. + * <p> + * The handover notification is sent as a + * {@link TelephonyManager#EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI} + * {@link android.telecom.Connection} event, which an {@link android.telecom.InCallService} + * should use to trigger the display of a user-facing message. + * @hide + */ + public static final String KEY_NOTIFY_HANDOVER_VIDEO_FROM_LTE_TO_WIFI_BOOL = + "notify_handover_video_from_lte_to_wifi_bool"; + + /** * Flag specifying whether the carrier supports downgrading a video call (tx, rx or tx/rx) * directly to an audio call. * @hide @@ -1594,6 +1607,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_CARRIER_VOLTE_AVAILABLE_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VT_AVAILABLE_BOOL, false); sDefaults.putBoolean(KEY_NOTIFY_HANDOVER_VIDEO_FROM_WIFI_TO_LTE_BOOL, false); + sDefaults.putBoolean(KEY_NOTIFY_HANDOVER_VIDEO_FROM_LTE_TO_WIFI_BOOL, false); sDefaults.putBoolean(KEY_SUPPORT_DOWNGRADE_VT_TO_AUDIO_BOOL, true); sDefaults.putString(KEY_DEFAULT_VM_NUMBER_STRING, ""); sDefaults.putBoolean(KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS, true); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 011d76b0a545..c9afb9f9ea31 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -827,6 +827,17 @@ public class TelephonyManager { "android.telephony.event.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE"; /** + * {@link android.telecom.Connection} event used to indicate that an IMS call has be + * successfully handed over from LTE to WIFI. + * <p> + * Sent via {@link android.telecom.Connection#sendConnectionEvent(String, Bundle)}. + * The {@link Bundle} parameter is expected to be null when this connection event is used. + * @hide + */ + public static final String EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI = + "android.telephony.event.EVENT_HANDOVER_VIDEO_FROM_LTE_TO_WIFI"; + + /** * {@link android.telecom.Connection} event used to indicate that an IMS call failed to be * handed over from LTE to WIFI. * <p> diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java index dc5ba0cc83b5..12a8ddf9fcdc 100644 --- a/wifi/java/android/net/wifi/RttManager.java +++ b/wifi/java/android/net/wifi/RttManager.java @@ -847,8 +847,8 @@ public class RttManager { } dest.writeByte(result.LCR.id); if (result.LCR.id != (byte) 0xFF) { - dest.writeInt((byte) result.LCR.data.length); - dest.writeByte(result.LCR.id); + dest.writeByte((byte) result.LCR.data.length); + dest.writeByteArray(result.LCR.data); } dest.writeByte(result.secure ? (byte) 1 : 0); } diff --git a/wifi/java/android/net/wifi/aware/PeerHandle.java b/wifi/java/android/net/wifi/aware/PeerHandle.java index cd45c524934a..b525212ed0a8 100644 --- a/wifi/java/android/net/wifi/aware/PeerHandle.java +++ b/wifi/java/android/net/wifi/aware/PeerHandle.java @@ -32,4 +32,22 @@ public class PeerHandle { /** @hide */ public int peerId; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (!(o instanceof PeerHandle)) { + return false; + } + + return peerId == ((PeerHandle) o).peerId; + } + + @Override + public int hashCode() { + return peerId; + } } |