diff options
54 files changed, 769 insertions, 471 deletions
diff --git a/api/current.txt b/api/current.txt index 4b30051f4577..29fc7b130035 100644 --- a/api/current.txt +++ b/api/current.txt @@ -13325,6 +13325,7 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Long> SENSOR_INFO_MAX_FRAME_DURATION; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE; + field public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>> SENSOR_INFO_SENSITIVITY_RANGE; field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_TIMESTAMP_SOURCE; field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_WHITE_LEVEL; @@ -23673,6 +23674,7 @@ package android.os { field public static final java.lang.String DISALLOW_CROSS_PROFILE_COPY_PASTE = "no_cross_profile_copy_paste"; field public static final java.lang.String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features"; field public static final java.lang.String DISALLOW_FACTORY_RESET = "no_factory_reset"; + field public static final java.lang.String DISALLOW_FUN = "no_fun"; field public static final java.lang.String DISALLOW_INSTALL_APPS = "no_install_apps"; field public static final java.lang.String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources"; field public static final java.lang.String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts"; @@ -30537,6 +30539,7 @@ package android.telecom { field public static final java.lang.String ACTION_CHANGE_DEFAULT_DIALER = "android.telecom.action.CHANGE_DEFAULT_DIALER"; field public static final java.lang.String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS"; field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.telecom.action.CONNECTION_SERVICE_CONFIGURE"; + field public static final java.lang.String ACTION_DEFAULT_DIALER_CHANGED = "android.telecom.action.DEFAULT_DIALER_CHANGED"; field public static final java.lang.String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; field public static final java.lang.String ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS = "android.telecom.action.SHOW_CALL_ACCESSIBILITY_SETTINGS"; field public static final java.lang.String ACTION_SHOW_CALL_SETTINGS = "android.telecom.action.SHOW_CALL_SETTINGS"; @@ -30614,9 +30617,11 @@ package android.telephony { field public static final java.lang.String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool"; field public static final java.lang.String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool"; field public static final java.lang.String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL = "carrier_volte_tty_supported_bool"; + field public static final java.lang.String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool"; + field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string"; field public static final java.lang.String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool"; field public static final java.lang.String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool"; - field public static final java.lang.String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "key_enable_dialer_vibration_bool"; + field public static final java.lang.String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_vibration_bool"; field public static final java.lang.String KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL = "has_in_call_noise_suppression_bool"; field public static final java.lang.String KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool"; field public static final java.lang.String KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL = "ignore_sim_network_locked_events_bool"; diff --git a/api/system-current.txt b/api/system-current.txt index 582e1463658f..4b4a77c754da 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -13645,6 +13645,7 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Long> SENSOR_INFO_MAX_FRAME_DURATION; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE; + field public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE; field public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Range<java.lang.Integer>> SENSOR_INFO_SENSITIVITY_RANGE; field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_TIMESTAMP_SOURCE; field public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_INFO_WHITE_LEVEL; @@ -25607,6 +25608,7 @@ package android.os { field public static final java.lang.String DISALLOW_CROSS_PROFILE_COPY_PASTE = "no_cross_profile_copy_paste"; field public static final java.lang.String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features"; field public static final java.lang.String DISALLOW_FACTORY_RESET = "no_factory_reset"; + field public static final java.lang.String DISALLOW_FUN = "no_fun"; field public static final java.lang.String DISALLOW_INSTALL_APPS = "no_install_apps"; field public static final java.lang.String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources"; field public static final java.lang.String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts"; @@ -32753,6 +32755,7 @@ package android.telecom { field public static final java.lang.String ACTION_CHANGE_DEFAULT_DIALER = "android.telecom.action.CHANGE_DEFAULT_DIALER"; field public static final java.lang.String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS"; field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.telecom.action.CONNECTION_SERVICE_CONFIGURE"; + field public static final java.lang.String ACTION_DEFAULT_DIALER_CHANGED = "android.telecom.action.DEFAULT_DIALER_CHANGED"; field public static final java.lang.String ACTION_INCOMING_CALL = "android.telecom.action.INCOMING_CALL"; field public static final java.lang.String ACTION_PHONE_ACCOUNT_REGISTERED = "android.telecom.action.PHONE_ACCOUNT_REGISTERED"; field public static final java.lang.String ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS = "android.telecom.action.SHOW_CALL_ACCESSIBILITY_SETTINGS"; @@ -32834,9 +32837,11 @@ package android.telephony { field public static final java.lang.String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool"; field public static final java.lang.String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool"; field public static final java.lang.String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL = "carrier_volte_tty_supported_bool"; + field public static final java.lang.String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool"; + field public static final java.lang.String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string"; field public static final java.lang.String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool"; field public static final java.lang.String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool"; - field public static final java.lang.String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "key_enable_dialer_vibration_bool"; + field public static final java.lang.String KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_vibration_bool"; field public static final java.lang.String KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL = "has_in_call_noise_suppression_bool"; field public static final java.lang.String KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool"; field public static final java.lang.String KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL = "ignore_sim_network_locked_events_bool"; diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index c5af9921ba14..449a4abdfe4d 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -90,9 +90,6 @@ public: virtual void onZygoteInit() { - // Re-enable tracing now that we're no longer in Zygote. - atrace_set_tracing_enabled(true); - sp<ProcessState> proc = ProcessState::self(); ALOGV("App process: starting thread pool.\n"); proc->startThreadPool(); diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index e21c04a35d6a..828dc0af2026 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -5375,6 +5375,7 @@ public final class ActivityThread { } public static void main(String[] args) { + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "ActivityThreadMain"); SamplingProfilerIntegration.start(); // CloseGuard defaults to true and can be quite spammy. We @@ -5409,6 +5410,8 @@ public final class ActivityThread { LogPrinter(Log.DEBUG, "ActivityThread")); } + // End of event ActivityThreadMain. + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); Looper.loop(); throw new RuntimeException("Main thread loop unexpectedly exited"); diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 9f4915463ff8..634f116df0f6 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -924,7 +924,7 @@ public class DevicePolicyManager { /** * Constant for {@link #setPasswordQuality}: the policy requires some kind - * of password, but doesn't care what it is. Note that quality constants + * of password or pattern, but doesn't care what it is. Note that quality constants * are ordered so that higher values are more restrictive. */ public static final int PASSWORD_QUALITY_SOMETHING = 0x10000; diff --git a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java b/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java index 161c339e78a8..834a587d83df 100644 --- a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java +++ b/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java @@ -28,10 +28,10 @@ import android.os.Parcelable; public final class BluetoothActivityEnergyInfo implements Parcelable { private final long mTimestamp; private final int mBluetoothStackState; - private final int mControllerTxTimeMs; - private final int mControllerRxTimeMs; - private final int mControllerIdleTimeMs; - private final int mControllerEnergyUsed; + private final long mControllerTxTimeMs; + private final long mControllerRxTimeMs; + private final long mControllerIdleTimeMs; + private final long mControllerEnergyUsed; public static final int BT_STACK_STATE_INVALID = 0; public static final int BT_STACK_STATE_STATE_ACTIVE = 1; @@ -39,7 +39,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { public static final int BT_STACK_STATE_STATE_IDLE = 3; public BluetoothActivityEnergyInfo(long timestamp, int stackState, - int txTime, int rxTime, int idleTime, int energyUsed) { + long txTime, long rxTime, long idleTime, long energyUsed) { mTimestamp = timestamp; mBluetoothStackState = stackState; mControllerTxTimeMs = txTime; @@ -65,10 +65,10 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { public BluetoothActivityEnergyInfo createFromParcel(Parcel in) { long timestamp = in.readLong(); int stackState = in.readInt(); - int txTime = in.readInt(); - int rxTime = in.readInt(); - int idleTime = in.readInt(); - int energyUsed = in.readInt(); + long txTime = in.readLong(); + long rxTime = in.readLong(); + long idleTime = in.readLong(); + long energyUsed = in.readLong(); return new BluetoothActivityEnergyInfo(timestamp, stackState, txTime, rxTime, idleTime, energyUsed); } @@ -80,10 +80,10 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeLong(mTimestamp); out.writeInt(mBluetoothStackState); - out.writeInt(mControllerTxTimeMs); - out.writeInt(mControllerRxTimeMs); - out.writeInt(mControllerIdleTimeMs); - out.writeInt(mControllerEnergyUsed); + out.writeLong(mControllerTxTimeMs); + out.writeLong(mControllerRxTimeMs); + out.writeLong(mControllerIdleTimeMs); + out.writeLong(mControllerEnergyUsed); } public int describeContents() { @@ -100,21 +100,21 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { /** * @return tx time in ms */ - public int getControllerTxTimeMillis() { + public long getControllerTxTimeMillis() { return mControllerTxTimeMs; } /** * @return rx time in ms */ - public int getControllerRxTimeMillis() { + public long getControllerRxTimeMillis() { return mControllerRxTimeMs; } /** * @return idle time in ms */ - public int getControllerIdleTimeMillis() { + public long getControllerIdleTimeMillis() { return mControllerIdleTimeMs; } @@ -122,7 +122,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { * product of current(mA), voltage(V) and time(ms) * @return energy used */ - public int getControllerEnergyUsed() { + public long getControllerEnergyUsed() { return mControllerEnergyUsed; } @@ -137,8 +137,8 @@ public final class BluetoothActivityEnergyInfo implements Parcelable { * @return if the record is valid */ public boolean isValid() { - return ((getControllerTxTimeMillis() !=0) || - (getControllerRxTimeMillis() !=0) || - (getControllerIdleTimeMillis() !=0)); + return ((mControllerTxTimeMs !=0) || + (mControllerRxTimeMs !=0) || + (mControllerIdleTimeMs !=0)); } } diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index b69ca887c441..152bc2234a6d 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1109,13 +1109,13 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri /** * <p>The correction coefficients to correct for this camera device's * radial and tangential lens distortion.</p> - * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, + * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2, * kappa_3]</code> and two tangential distortion coefficients * <code>[kappa_4, kappa_5]</code> that can be used to correct the * lens's geometric distortion with the mapping equations:</p> - * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) - * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) * </code></pre> * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the @@ -1959,22 +1959,25 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri new Key<Integer>("android.scaler.croppingType", int.class); /** - * <p>The area of the image sensor which corresponds to - * active pixels.</p> - * <p>This is the region of the sensor that actually receives light from the scene. - * Therefore, the size of this region determines the maximum field of view and the maximum - * number of pixels that an image from this sensor can contain.</p> - * <p>The rectangle is defined in terms of the full pixel array; (0,0) is the top-left of the - * full pixel array, and the size of the full pixel array is given by + * <p>The area of the image sensor which corresponds to active pixels after any geometric + * distortion correction has been applied.</p> + * <p>This is the rectangle representing the size of the active region of the sensor (i.e. + * the region that actually receives light from the scene) after any geometric correction + * has been applied, and should be treated as the maximum size in pixels of any of the + * image output formats aside from the raw formats.</p> + * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of + * the full pixel array, and the size of the full pixel array is given by * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p> - * <p>Most other keys listing pixel coordinates have their coordinate systems based on the - * active array, with <code>(0, 0)</code> being the top-left of the active array rectangle.</p> + * <p>The coordinate system for most other keys that list pixel coordinates, including + * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in + * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p> * <p>The active array may be smaller than the full pixel array, since the full array may - * include black calibration pixels or other inactive regions.</p> + * include black calibration pixels or other inactive regions, and geometric correction + * resulting in scaling or cropping may have been applied.</p> * <p><b>Units</b>: Pixel coordinates on the image sensor</p> - * <p><b>Range of valid values:</b><br></p> * <p>This key is available on all devices.</p> * + * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE */ @PublicKey @@ -1982,6 +1985,69 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class); /** + * <p>The area of the image sensor which corresponds to active pixels prior to the + * application of any geometric distortion correction.</p> + * <p>This is the rectangle representing the size of the active region of the sensor (i.e. + * the region that actually receives light from the scene) before any geometric correction + * has been applied, and should be treated as the active region rectangle for any of the + * raw formats. All metadata associated with raw processing (e.g. the lens shading + * correction map, and radial distortion fields) treats the top, left of this rectangle as + * the origin, (0,0).</p> + * <p>The size of this region determines the maximum field of view and the maximum number of + * pixels that an image from this sensor can contain, prior to the application of + * geometric distortion correction. The effective maximum pixel dimensions of a + * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} + * field, and the effective maximum field of view for a post-distortion-corrected image + * can be calculated by applying the geometric distortion correction fields to this + * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> + * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the + * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel, + * (x', y'), in the raw pixel array with dimensions give in + * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p> + * <ol> + * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in + * android.sensor.info.preCorrectedActiveArraySize, otherwise this pixel is considered + * to be outside of the FOV, and will not be shown in the processed output image.</li> + * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate, + * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw + * buffers is defined relative to the top, left of the + * android.sensor.info.preCorrectedActiveArraySize rectangle.</li> + * <li>If the resulting corrected pixel coordinate is within the region given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the + * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>, + * when the top, left coordinate of that buffer is treated as (0, 0).</li> + * </ol> + * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} + * is (100,100), android.sensor.info.preCorrectedActiveArraySize is (10, 10, 100, 100), + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion + * correction doesn't change the pixel coordinate, the resulting pixel selected in + * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer + * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5) + * relative to the top,left of post-processed YUV output buffer with dimensions given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> + * <p>The currently supported fields that correct for geometric distortion are:</p> + * <ol> + * <li>android.lens.radialDistortion.</li> + * </ol> + * <p>If all of the geometric distortion fields are no-ops, this rectangle will be the same + * as the post-distortion-corrected rectangle given in + * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> + * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of + * the full pixel array, and the size of the full pixel array is given by + * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p> + * <p>The pre-correction active array may be smaller than the full pixel array, since the + * full array may include black calibration pixels or other inactive regions.</p> + * <p><b>Units</b>: Pixel coordinates on the image sensor</p> + * <p>This key is available on all devices.</p> + * + * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE + * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE + */ + @PublicKey + public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE = + new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class); + + /** * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this * camera device.</p> * <p>The values are the standard ISO sensitivity values, @@ -2089,22 +2155,24 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri /** * <p>Dimensions of the full pixel array, possibly * including black calibration pixels.</p> - * <p>The pixel count of the full pixel array, - * which covers {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.</p> - * <p>If a camera device supports raw sensor formats, either this - * or {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is the maximum output - * raw size listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. - * If a size corresponding to pixelArraySize is listed, the resulting - * raw sensor image will include black pixels.</p> + * <p>The pixel count of the full pixel array of the image sensor, which covers + * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of + * the raw buffers produced by this sensor.</p> + * <p>If a camera device supports raw sensor formats, either this or + * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw + * output formats listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} (this depends on + * whether or not the image sensor returns buffers containing pixels that are not + * part of the active array region for blacklevel calibration or other purposes).</p> * <p>Some parts of the full pixel array may not receive light from the scene, - * or are otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} key - * defines the rectangle of active pixels that actually forms an image.</p> + * or be otherwise inactive. The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key + * defines the rectangle of active pixels that will be included in processed image + * formats.</p> * <p><b>Units</b>: Pixels</p> * <p>This key is available on all devices.</p> * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP - * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE + * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE */ @PublicKey public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE = diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 3bb2fdb31e39..479583cf3896 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -2671,13 +2671,13 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { /** * <p>The correction coefficients to correct for this camera device's * radial and tangential lens distortion.</p> - * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, + * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2, * kappa_3]</code> and two tangential distortion coefficients * <code>[kappa_4, kappa_5]</code> that can be used to correct the * lens's geometric distortion with the mapping equations:</p> - * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) - * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) * </code></pre> * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java index 8512b239114c..a1ebe6a46fef 100644 --- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java @@ -2053,8 +2053,10 @@ public class CameraDeviceImpl extends CameraDevice { requestMetadata, /*reprocess*/false, CameraCaptureSession.SESSION_ID_NONE); // Overwrite the capture intent to make sure a good value is set. - Surface[] surfaces = (Surface[])outputSurfaces.toArray(); - if (outputSurfaces.size() == 1 && SurfaceUtils.isSurfaceForHwVideoEncoder(surfaces[0])) { + Iterator<Surface> iterator = outputSurfaces.iterator(); + Surface firstSurface = iterator.next(); + Surface secondSurface = null; + if (outputSurfaces.size() == 1 && SurfaceUtils.isSurfaceForHwVideoEncoder(firstSurface)) { singleTargetRequestBuilder.set(CaptureRequest.CONTROL_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_PREVIEW); } else { @@ -2071,19 +2073,20 @@ public class CameraDeviceImpl extends CameraDevice { requestMetadata, /*reprocess*/false, CameraCaptureSession.SESSION_ID_NONE); doubleTargetRequestBuilder.set(CaptureRequest.CONTROL_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_VIDEO_RECORD); - doubleTargetRequestBuilder.addTarget(surfaces[0]); - doubleTargetRequestBuilder.addTarget(surfaces[1]); + doubleTargetRequestBuilder.addTarget(firstSurface); + secondSurface = iterator.next(); + doubleTargetRequestBuilder.addTarget(secondSurface); doubleTargetRequestBuilder.setPartOfCHSRequestList(/*partOfCHSList*/true); // Make sure singleTargetRequestBuilder contains only recording surface for // preview + recording case. - Surface recordingSurface = surfaces[0]; + Surface recordingSurface = firstSurface; if (!SurfaceUtils.isSurfaceForHwVideoEncoder(recordingSurface)) { - recordingSurface = surfaces[1]; + recordingSurface = secondSurface; } singleTargetRequestBuilder.addTarget(recordingSurface); } else { // Single output case: either recording or preview. - singleTargetRequestBuilder.addTarget(surfaces[0]); + singleTargetRequestBuilder.addTarget(firstSurface); } // Generate the final request list. diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 3a3c47d860a1..a2ca41ca3788 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -801,28 +801,6 @@ public class ConnectivityManager { } /** - * Returns details about the Provisioning or currently active default data network. When - * connected, this network is the default route for outgoing connections. - * You should always check {@link NetworkInfo#isConnected()} before initiating - * network traffic. This may return {@code null} when there is no default - * network. - * <p>This method requires the caller to hold the permission - * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}. - * - * @return a {@link NetworkInfo} object for the current default network - * or {@code null} if no default network is currently active - * - * {@hide} - */ - public NetworkInfo getProvisioningOrActiveNetworkInfo() { - try { - return mService.getProvisioningOrActiveNetworkInfo(); - } catch (RemoteException e) { - return null; - } - } - - /** * Returns the IP information for the current default network. * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}. @@ -2007,24 +1985,6 @@ public class ConnectivityManager { } /** - * Signal that the captive portal check on the indicated network - * is complete and whether its a captive portal or not. - * <p>This method requires the caller to hold the permission - * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}. - * - * @param info the {@link NetworkInfo} object for the networkType - * in question. - * @param isCaptivePortal true/false. - * {@hide} - */ - public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) { - try { - mService.captivePortalCheckCompleted(info, isCaptivePortal); - } catch (RemoteException e) { - } - } - - /** * Check mobile provisioning. * * @param suggestedTimeOutMs, timeout in milliseconds @@ -2056,18 +2016,6 @@ public class ConnectivityManager { } /** - * Get the mobile redirected provisioning url. - * {@hide} - */ - public String getMobileRedirectedProvisioningUrl() { - try { - return mService.getMobileRedirectedProvisioningUrl(); - } catch (RemoteException e) { - } - return null; - } - - /** * Set sign in error notification to visible or in visible * * @param visible diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index 89d23a253667..29557bb661b8 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -53,8 +53,6 @@ interface IConnectivityManager Network[] getAllNetworks(); NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId); - NetworkInfo getProvisioningOrActiveNetworkInfo(); - boolean isNetworkSupported(int networkType); LinkProperties getActiveLinkProperties(); @@ -122,14 +120,10 @@ interface IConnectivityManager boolean updateLockdownVpn(); - void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal); - int checkMobileProvisioning(int suggestedTimeOutMs); String getMobileProvisioningUrl(); - String getMobileRedirectedProvisioningUrl(); - void setProvisioningNotificationVisible(boolean visible, int networkType, in String action); void setAirplaneMode(boolean enable); diff --git a/core/java/android/net/Network.java b/core/java/android/net/Network.java index 9628bae57471..fe6932037395 100644 --- a/core/java/android/net/Network.java +++ b/core/java/android/net/Network.java @@ -378,6 +378,9 @@ public class Network implements Parcelable { // // The HANDLE_MAGIC value MUST be kept in sync with the corresponding // value in the native/android/net.c NDK implementation. + if (netId == 0) { + return 0L; // make this zero condition obvious for debugging + } final long HANDLE_MAGIC = 0xfacade; return (((long) netId) << 32) | HANDLE_MAGIC; } diff --git a/core/java/android/net/NetworkInfo.java b/core/java/android/net/NetworkInfo.java index 393637e8d048..af7a46588089 100644 --- a/core/java/android/net/NetworkInfo.java +++ b/core/java/android/net/NetworkInfo.java @@ -120,7 +120,6 @@ public class NetworkInfo implements Parcelable { private String mExtraInfo; private boolean mIsFailover; private boolean mIsRoaming; - private boolean mIsConnectedToProvisioningNetwork; /** * Indicates whether network connectivity is possible: @@ -142,7 +141,6 @@ public class NetworkInfo implements Parcelable { mState = State.UNKNOWN; mIsAvailable = false; // until we're told otherwise, assume unavailable mIsRoaming = false; - mIsConnectedToProvisioningNetwork = false; } /** {@hide} */ @@ -160,7 +158,6 @@ public class NetworkInfo implements Parcelable { mIsFailover = source.mIsFailover; mIsRoaming = source.mIsRoaming; mIsAvailable = source.mIsAvailable; - mIsConnectedToProvisioningNetwork = source.mIsConnectedToProvisioningNetwork; } } } @@ -332,22 +329,6 @@ public class NetworkInfo implements Parcelable { } } - /** {@hide} */ - @VisibleForTesting - public boolean isConnectedToProvisioningNetwork() { - synchronized (this) { - return mIsConnectedToProvisioningNetwork; - } - } - - /** {@hide} */ - @VisibleForTesting - public void setIsConnectedToProvisioningNetwork(boolean val) { - synchronized (this) { - mIsConnectedToProvisioningNetwork = val; - } - } - /** * Reports the current coarse-grained state of the network. * @return the coarse-grained state @@ -431,8 +412,6 @@ public class NetworkInfo implements Parcelable { append(", roaming: ").append(mIsRoaming). append(", failover: ").append(mIsFailover). append(", isAvailable: ").append(mIsAvailable). - append(", isConnectedToProvisioningNetwork: "). - append(mIsConnectedToProvisioningNetwork). append("]"); return builder.toString(); } @@ -461,7 +440,6 @@ public class NetworkInfo implements Parcelable { dest.writeInt(mIsFailover ? 1 : 0); dest.writeInt(mIsAvailable ? 1 : 0); dest.writeInt(mIsRoaming ? 1 : 0); - dest.writeInt(mIsConnectedToProvisioningNetwork ? 1 : 0); dest.writeString(mReason); dest.writeString(mExtraInfo); } @@ -484,7 +462,6 @@ public class NetworkInfo implements Parcelable { netInfo.mIsFailover = in.readInt() != 0; netInfo.mIsAvailable = in.readInt() != 0; netInfo.mIsRoaming = in.readInt() != 0; - netInfo.mIsConnectedToProvisioningNetwork = in.readInt() != 0; netInfo.mReason = in.readString(); netInfo.mExtraInfo = in.readString(); return netInfo; diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java index ff3de2b6b4ab..bb08be2e3b25 100644 --- a/core/java/android/net/TrafficStats.java +++ b/core/java/android/net/TrafficStats.java @@ -53,6 +53,8 @@ public class TrafficStats { public static final long GB_IN_BYTES = MB_IN_BYTES * 1024; /** @hide */ public static final long TB_IN_BYTES = GB_IN_BYTES * 1024; + /** @hide */ + public static final long PB_IN_BYTES = TB_IN_BYTES * 1024; /** * Special UID value used when collecting {@link NetworkStatsHistory} for diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index ef7e747273d3..00350ec92a36 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -362,6 +362,18 @@ public class UserManager { public static final String DISALLOW_SMS = "no_sms"; /** + * Specifies if the user is not allowed to have fun. In some cases, the + * device owner may wish to prevent the user from experiencing amusement or + * joy while using the device. The default value is <code>false</code>. + * + * <p/>Key for user restrictions. + * <p/>Type: Boolean + * @see #setUserRestrictions(Bundle) + * @see #getUserRestrictions() + */ + public static final String DISALLOW_FUN = "no_fun"; + + /** * Specifies that windows besides app windows should not be * created. This will block the creation of the following types of windows. * <li>{@link LayoutParams#TYPE_TOAST}</li> diff --git a/core/java/android/text/format/Formatter.java b/core/java/android/text/format/Formatter.java index b467f5a8c67a..13a959e6fcdd 100644 --- a/core/java/android/text/format/Formatter.java +++ b/core/java/android/text/format/Formatter.java @@ -17,7 +17,9 @@ package android.text.format; import android.content.Context; +import android.content.res.Resources; import android.net.NetworkUtils; +import android.net.TrafficStats; /** * Utility class to aid in formatting common values that are not covered @@ -25,63 +27,88 @@ import android.net.NetworkUtils; */ public final class Formatter { + /** {@hide} */ + public static final int FLAG_SHORTER = 1 << 0; + /** {@hide} */ + public static final int FLAG_CALCULATE_ROUNDED = 1 << 1; + + /** {@hide} */ + public static class BytesResult { + public final String value; + public final String units; + public final long roundedBytes; + + public BytesResult(String value, String units, long roundedBytes) { + this.value = value; + this.units = units; + this.roundedBytes = roundedBytes; + } + } + /** * Formats a content size to be in the form of bytes, kilobytes, megabytes, etc * * @param context Context to use to load the localized units - * @param number size value to be formatted + * @param sizeBytes size value to be formatted, in bytes * @return formatted string with the number */ - public static String formatFileSize(Context context, long number) { - return formatFileSize(context, number, false); + public static String formatFileSize(Context context, long sizeBytes) { + final BytesResult res = formatBytes(context.getResources(), sizeBytes, 0); + return context.getString(com.android.internal.R.string.fileSizeSuffix, + res.value, res.units); } /** * Like {@link #formatFileSize}, but trying to generate shorter numbers * (showing fewer digits of precision). */ - public static String formatShortFileSize(Context context, long number) { - return formatFileSize(context, number, true); + public static String formatShortFileSize(Context context, long sizeBytes) { + final BytesResult res = formatBytes(context.getResources(), sizeBytes, FLAG_SHORTER); + return context.getString(com.android.internal.R.string.fileSizeSuffix, + res.value, res.units); } - private static String formatFileSize(Context context, long number, boolean shorter) { - if (context == null) { - return ""; - } - - float result = number; + /** {@hide} */ + public static BytesResult formatBytes(Resources res, long sizeBytes, int flags) { + float result = sizeBytes; int suffix = com.android.internal.R.string.byteShort; + long mult = 1; if (result > 900) { suffix = com.android.internal.R.string.kilobyteShort; + mult = TrafficStats.KB_IN_BYTES; result = result / 1024; } if (result > 900) { suffix = com.android.internal.R.string.megabyteShort; + mult = TrafficStats.MB_IN_BYTES; result = result / 1024; } if (result > 900) { suffix = com.android.internal.R.string.gigabyteShort; + mult = TrafficStats.GB_IN_BYTES; result = result / 1024; } if (result > 900) { suffix = com.android.internal.R.string.terabyteShort; + mult = TrafficStats.TB_IN_BYTES; result = result / 1024; } if (result > 900) { suffix = com.android.internal.R.string.petabyteShort; + mult = TrafficStats.PB_IN_BYTES; result = result / 1024; } String value; if (result < 1) { value = String.format("%.2f", result); } else if (result < 10) { - if (shorter) { + if ((flags & FLAG_SHORTER) != 0) { value = String.format("%.1f", result); } else { value = String.format("%.2f", result); } } else if (result < 100) { - if (shorter) { + if ((flags & FLAG_SHORTER) != 0) { value = String.format("%.0f", result); } else { value = String.format("%.2f", result); @@ -89,9 +116,14 @@ public final class Formatter { } else { value = String.format("%.0f", result); } - return context.getResources(). - getString(com.android.internal.R.string.fileSizeSuffix, - value, context.getString(suffix)); + final String units = res.getString(suffix); + final long roundedBytes; + if ((flags & FLAG_CALCULATE_ROUNDED) != 0) { + roundedBytes = (long) (Double.parseDouble(value) * mult); + } else { + roundedBytes = 0; + } + return new BytesResult(value, units, roundedBytes); } /** diff --git a/core/java/android/text/style/TtsSpan.java b/core/java/android/text/style/TtsSpan.java index c40f11fe646e..93a156b7e24f 100644 --- a/core/java/android/text/style/TtsSpan.java +++ b/core/java/android/text/style/TtsSpan.java @@ -165,7 +165,7 @@ public class TtsSpan implements ParcelableSpan { /** * The text associated with this span is a series of characters that have to - * be read verbatim. The engine will attempt to ready out any character like + * be read verbatim. The engine will attempt to read out any character like * punctuation but excluding whitespace. {@link #ARG_VERBATIM} is required. * Also accepts the arguments {@link #ARG_GENDER}, * {@link #ARG_ANIMACY}, {@link #ARG_MULTIPLICITY} and {@link #ARG_CASE}. diff --git a/core/java/android/transition/Explode.java b/core/java/android/transition/Explode.java index 788676aa5e8f..3445ef2fbbaa 100644 --- a/core/java/android/transition/Explode.java +++ b/core/java/android/transition/Explode.java @@ -90,7 +90,7 @@ public class Explode extends Visibility { float startY = endY + mTempLoc[1]; return TranslationAnimationCreator.createAnimation(view, endValues, bounds.left, bounds.top, - startX, startY, endX, endY, sDecelerate); + startX, startY, endX, endY, sDecelerate, this); } @Override @@ -119,7 +119,7 @@ public class Explode extends Visibility { endY += mTempLoc[1]; return TranslationAnimationCreator.createAnimation(view, startValues, - viewPosX, viewPosY, startX, startY, endX, endY, sAccelerate); + viewPosX, viewPosY, startX, startY, endX, endY, sAccelerate, this); } private void calculateOut(View sceneRoot, Rect bounds, int[] outVector) { diff --git a/core/java/android/transition/Slide.java b/core/java/android/transition/Slide.java index be1d9070c808..9063b439ade0 100644 --- a/core/java/android/transition/Slide.java +++ b/core/java/android/transition/Slide.java @@ -231,7 +231,7 @@ public class Slide extends Visibility { float startY = mSlideCalculator.getGoneY(sceneRoot, view); return TranslationAnimationCreator .createAnimation(view, endValues, position[0], position[1], - startX, startY, endX, endY, sDecelerate); + startX, startY, endX, endY, sDecelerate, this); } @Override @@ -247,6 +247,6 @@ public class Slide extends Visibility { float endY = mSlideCalculator.getGoneY(sceneRoot, view); return TranslationAnimationCreator .createAnimation(view, startValues, position[0], position[1], - startX, startY, endX, endY, sAccelerate); + startX, startY, endX, endY, sAccelerate, this); } } diff --git a/core/java/android/transition/TranslationAnimationCreator.java b/core/java/android/transition/TranslationAnimationCreator.java index de71fd7a0a15..1554975523fb 100644 --- a/core/java/android/transition/TranslationAnimationCreator.java +++ b/core/java/android/transition/TranslationAnimationCreator.java @@ -22,6 +22,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.TimeInterpolator; import android.graphics.Path; +import android.transition.Transition.TransitionListener; import android.view.View; /** @@ -48,7 +49,8 @@ class TranslationAnimationCreator { * a previous interruption, in which case it moves from the current position to (endX, endY). */ static Animator createAnimation(View view, TransitionValues values, int viewPosX, int viewPosY, - float startX, float startY, float endX, float endY, TimeInterpolator interpolator) { + float startX, float startY, float endX, float endY, TimeInterpolator interpolator, + Transition transition) { float terminalX = view.getTranslationX(); float terminalY = view.getTranslationY(); int[] startPosition = (int[]) values.view.getTag(R.id.transitionPosition); @@ -73,13 +75,15 @@ class TranslationAnimationCreator { TransitionPositionListener listener = new TransitionPositionListener(view, values.view, startPosX, startPosY, terminalX, terminalY); + transition.addListener(listener); anim.addListener(listener); anim.addPauseListener(listener); anim.setInterpolator(interpolator); return anim; } - private static class TransitionPositionListener extends AnimatorListenerAdapter { + private static class TransitionPositionListener extends AnimatorListenerAdapter implements + TransitionListener { private final View mViewInHierarchy; private final View mMovingView; @@ -117,8 +121,6 @@ class TranslationAnimationCreator { @Override public void onAnimationEnd(Animator animator) { - mMovingView.setTranslationX(mTerminalX); - mMovingView.setTranslationY(mTerminalY); } @Override @@ -134,6 +136,28 @@ class TranslationAnimationCreator { mMovingView.setTranslationX(mPausedX); mMovingView.setTranslationY(mPausedY); } + + @Override + public void onTransitionStart(Transition transition) { + } + + @Override + public void onTransitionEnd(Transition transition) { + mMovingView.setTranslationX(mTerminalX); + mMovingView.setTranslationY(mTerminalY); + } + + @Override + public void onTransitionCancel(Transition transition) { + } + + @Override + public void onTransitionPause(Transition transition) { + } + + @Override + public void onTransitionResume(Transition transition) { + } } } diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java new file mode 100644 index 000000000000..b5203842ddba --- /dev/null +++ b/core/java/com/android/internal/app/AssistUtils.java @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2015 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.internal.app; + +import android.app.SearchManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.RemoteException; +import android.os.ServiceManager; +import android.provider.Settings; +import android.util.Log; + +/** + * Utility method for dealing with the assistant aspects of + * {@link com.android.internal.app.IVoiceInteractionManagerService IVoiceInteractionManagerService}. + */ +public class AssistUtils { + + private static final String TAG = "AssistUtils"; + + private final Context mContext; + private final IVoiceInteractionManagerService mVoiceInteractionManagerService; + + public AssistUtils(Context context) { + mContext = context; + mVoiceInteractionManagerService = IVoiceInteractionManagerService.Stub.asInterface( + ServiceManager.getService(Context.VOICE_INTERACTION_MANAGER_SERVICE)); + } + + public void showSessionForActiveService(IVoiceInteractionSessionShowCallback showCallback) { + try { + mVoiceInteractionManagerService.showSessionForActiveService(showCallback); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call showSessionForActiveService", e); + } + } + + public void launchVoiceAssistFromKeyguard() { + try { + mVoiceInteractionManagerService.launchVoiceAssistFromKeyguard(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call launchVoiceAssistFromKeyguard", e); + } + } + + public boolean activeServiceSupportsAssistGesture() { + try { + return mVoiceInteractionManagerService != null + && mVoiceInteractionManagerService.activeServiceSupportsAssist(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call activeServiceSupportsAssistGesture", e); + return false; + } + } + + public boolean activeServiceSupportsLaunchFromKeyguard() { + try { + return mVoiceInteractionManagerService != null + && mVoiceInteractionManagerService.activeServiceSupportsLaunchFromKeyguard(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call activeServiceSupportsLaunchFromKeyguard", e); + return false; + } + } + + public ComponentName getActiveServiceComponentName() { + try { + return mVoiceInteractionManagerService.getActiveServiceComponentName(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call getActiveServiceComponentName", e); + return null; + } + } + + public boolean isSessionRunning() { + try { + return mVoiceInteractionManagerService != null + && mVoiceInteractionManagerService.isSessionRunning(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call isSessionRunning", e); + return false; + } + } + + public void hideCurrentSession() { + try { + mVoiceInteractionManagerService.hideCurrentSession(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call hideCurrentSession", e); + } + } + + public ComponentName getAssistComponentForUser(int userId) { + final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(), + Settings.Secure.ASSISTANT, userId); + if (setting != null) { + return ComponentName.unflattenFromString(setting); + } + + // Fallback to keep backward compatible behavior when there is no user setting. + if (activeServiceSupportsAssistGesture()) { + return getActiveServiceComponentName(); + } + + Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) + .getAssistIntent(mContext, false, userId); + if (intent != null) { + return intent.getComponent(); + } + + return null; + } + +} diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java index 2539a3595b7f..f81658e01344 100644 --- a/core/java/com/android/internal/os/RuntimeInit.java +++ b/core/java/com/android/internal/os/RuntimeInit.java @@ -24,6 +24,7 @@ import android.os.Debug; import android.os.IBinder; import android.os.Process; import android.os.SystemProperties; +import android.os.Trace; import android.util.Log; import android.util.Slog; import com.android.internal.logging.AndroidConfig; @@ -269,11 +270,11 @@ public class RuntimeInit { throws ZygoteInit.MethodAndArgsCaller { if (DEBUG) Slog.d(TAG, "RuntimeInit: Starting application from zygote"); + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "RuntimeInit"); redirectLogStreams(); commonInit(); nativeZygoteInit(); - applicationInit(targetSdkVersion, argv, classLoader); } @@ -318,6 +319,9 @@ public class RuntimeInit { return; } + // The end of of the RuntimeInit event (see #zygoteInit). + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); + // Remaining arguments are passed to the start class's static main invokeStaticMain(args.startClass, args.startArgs, classLoader); } diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java index 1e7ee5a975bc..4f6d78187578 100644 --- a/core/java/com/android/internal/os/Zygote.java +++ b/core/java/com/android/internal/os/Zygote.java @@ -17,6 +17,7 @@ package com.android.internal.os; +import android.os.Trace; import dalvik.system.ZygoteHooks; import android.system.ErrnoException; import android.system.Os; @@ -88,6 +89,13 @@ public final class Zygote { int pid = nativeForkAndSpecialize( uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose, instructionSet, appDataDir); + // Enable tracing as soon as possible for the child process. + if (pid == 0) { + Trace.setTracingEnabled(true); + + // Note that this event ends at the end of handleChildProc, + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "PostFork"); + } VM_HOOKS.postForkCommon(); return pid; } @@ -124,6 +132,10 @@ public final class Zygote { VM_HOOKS.preFork(); int pid = nativeForkSystemServer( uid, gid, gids, debugFlags, rlimits, permittedCapabilities, effectiveCapabilities); + // Enable tracing as soon as we enter the system_server. + if (pid == 0) { + Trace.setTracingEnabled(true); + } VM_HOOKS.postForkCommon(); return pid; } diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java index 969d236784bc..1a0345bcac04 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -27,6 +27,7 @@ import android.net.LocalSocket; import android.os.Process; import android.os.SELinux; import android.os.SystemProperties; +import android.os.Trace; import android.system.ErrnoException; import android.system.Os; import android.util.Log; @@ -711,7 +712,6 @@ class ZygoteConnection { private void handleChildProc(Arguments parsedArgs, FileDescriptor[] descriptors, FileDescriptor pipeFd, PrintStream newStderr) throws ZygoteInit.MethodAndArgsCaller { - /** * By the time we get here, the native code has closed the two actual Zygote * socket connections, and substituted /dev/null in their place. The LocalSocket @@ -740,6 +740,8 @@ class ZygoteConnection { Process.setArgV0(parsedArgs.niceName); } + // End of the postFork event. + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); if (parsedArgs.invokeWith != null) { WrapperInit.execApplication(parsedArgs.invokeWith, parsedArgs.niceName, parsedArgs.targetSdkVersion, diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java index 2d0989f0a472..53ebc23bc3c1 100644 --- a/core/java/com/android/internal/widget/FloatingToolbar.java +++ b/core/java/com/android/internal/widget/FloatingToolbar.java @@ -37,7 +37,6 @@ import android.view.View.MeasureSpec; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.Window; -import android.view.WindowInsets; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationSet; @@ -436,8 +435,6 @@ public final class FloatingToolbar { // The "show" animation will make this visible. mContentContainer.setAlpha(0); } - refreshViewPort(); - updateOverflowHeight(contentRect.top - (mMarginVertical * 2) - mViewPort.top); refreshCoordinatesAndOverflowDirection(contentRect); preparePopupContent(); mPopupWindow.showAtLocation(mParent, Gravity.NO_GRAVITY, mCoords.x, mCoords.y); @@ -501,7 +498,6 @@ public final class FloatingToolbar { } cancelOverflowAnimations(); - refreshViewPort(); refreshCoordinatesAndOverflowDirection(contentRect); preparePopupContent(); mPopupWindow.update(mCoords.x, mCoords.y, getWidth(), getHeight()); @@ -529,28 +525,65 @@ public final class FloatingToolbar { } private void refreshCoordinatesAndOverflowDirection(Rect contentRect) { - // NOTE: Ensure that mViewPort has been refreshed before this. + refreshViewPort(); - int x = contentRect.centerX() - getWidth() / 2; - int y; - if (contentRect.top - getHeight() > mViewPort.top) { - y = contentRect.top - getHeight(); - mOverflowDirection = FloatingToolbarPopup.OVERFLOW_DIRECTION_UP; - } else if (contentRect.top - getToolbarHeightWithVerticalMargin() > mViewPort.top) { - y = contentRect.top - getToolbarHeightWithVerticalMargin(); - mOverflowDirection = FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN; - } else { - y = contentRect.bottom; - mOverflowDirection = FloatingToolbarPopup.OVERFLOW_DIRECTION_DOWN; - } + int availableHeightAboveContent = + contentRect.top - mViewPort.top - 2 * mMarginVertical; + int availableHeightBelowContent = + mViewPort.bottom - contentRect.bottom - 2 * mMarginVertical; + int availableHeightThroughContent = + mViewPort.bottom - contentRect.top + getToolbarHeightWithVerticalMargin(); + int x = contentRect.centerX() - getWidth() / 2; // Update x so that the toolbar isn't rendered behind the nav bar in landscape. x = Math.max(0, Math.min(x, mViewPort.right - getWidth())); - mCoords.set(x, y); - if (mOverflowPanel != null) { + int y; + if (mOverflowPanel == null) { // There is no overflow. + if (availableHeightAboveContent > getToolbarHeightWithVerticalMargin()) { + // There is enough space at the top of the content. + y = contentRect.top - getToolbarHeightWithVerticalMargin(); + } else if (availableHeightBelowContent > getToolbarHeightWithVerticalMargin()) { + // There is enough space at the bottom of the content. + y = contentRect.bottom; + } else { + // Not enough space. Prefer to position as high as possible. + y = Math.max( + mViewPort.top, + contentRect.top - getToolbarHeightWithVerticalMargin()); + } + } else { // There is an overflow. + if (availableHeightAboveContent > mOverflowPanel.getMinimumHeight()) { + // There is enough space at the top of the content rect for the overflow. + // Position above and open upwards. + updateOverflowHeight(availableHeightAboveContent); + y = contentRect.top - getHeight(); + mOverflowDirection = OVERFLOW_DIRECTION_UP; + } else if (availableHeightAboveContent > getToolbarHeightWithVerticalMargin() + && availableHeightThroughContent > mOverflowPanel.getMinimumHeight()) { + // There is enough space at the top of the content rect for the main panel + // but not the overflow. + // Position above but open downwards. + updateOverflowHeight(availableHeightThroughContent); + y = contentRect.top - getToolbarHeightWithVerticalMargin(); + mOverflowDirection = OVERFLOW_DIRECTION_DOWN; + } else if (availableHeightBelowContent > mOverflowPanel.getMinimumHeight()) { + // There is enough space at the bottom of the content rect for the overflow. + // Position below and open downwards. + updateOverflowHeight(availableHeightBelowContent); + y = contentRect.bottom; + mOverflowDirection = OVERFLOW_DIRECTION_DOWN; + } else { + // Not enough space. + // Position at the bottom of the view port and open upwards. + updateOverflowHeight(mViewPort.height()); + y = mViewPort.bottom - getHeight(); + mOverflowDirection = OVERFLOW_DIRECTION_UP; + } mOverflowPanel.setOverflowDirection(mOverflowDirection); } + + mCoords.set(x, y); } private int getToolbarHeightWithVerticalMargin() { @@ -837,13 +870,7 @@ public final class FloatingToolbar { private void refreshViewPort() { - mParent.getGlobalVisibleRect(mViewPort); - WindowInsets windowInsets = mParent.getRootWindowInsets(); - mViewPort.set( - mViewPort.left + windowInsets.getStableInsetLeft(), - mViewPort.top + windowInsets.getStableInsetTop(), - mViewPort.right - windowInsets.getStableInsetRight(), - mViewPort.bottom - windowInsets.getStableInsetBottom()); + mParent.getWindowVisibleDisplayFrame(mViewPort); } private int getToolbarWidth(int suggestedWidth) { @@ -1139,6 +1166,12 @@ public final class FloatingToolbar { setListViewHeight(); } + public int getMinimumHeight() { + return mContentView.getContext().getResources(). + getDimensionPixelSize(R.dimen.floating_toolbar_minimum_overflow_height) + + getEstimatedToolbarHeight(mContentView.getContext()); + } + /** * Returns the content view of the overflow. */ @@ -1173,13 +1206,18 @@ public final class FloatingToolbar { getDimensionPixelSize(R.dimen.floating_toolbar_maximum_overflow_height); int minHeight = mContentView.getContext().getResources(). getDimensionPixelSize(R.dimen.floating_toolbar_minimum_overflow_height); - int availableHeight = mSuggestedHeight - (mSuggestedHeight % itemHeight) + int suggestedListViewHeight = mSuggestedHeight - (mSuggestedHeight % itemHeight) - itemHeight; // reserve space for the back button. ViewGroup.LayoutParams params = mListView.getLayoutParams(); - if (availableHeight >= minHeight) { - params.height = Math.min(Math.min(availableHeight, maxHeight), height); - } else { + if (suggestedListViewHeight <= 0) { + // Invalid height. Use the maximum height available. params.height = Math.min(maxHeight, height); + } else if (suggestedListViewHeight < minHeight) { + // Height is smaller than minimum allowed. Use minimum height. + params.height = minHeight; + } else { + // Use the suggested height. Cap it at the maximum available height. + params.height = Math.min(Math.min(suggestedListViewHeight, maxHeight), height); } mListView.setLayoutParams(params); } @@ -1360,6 +1398,7 @@ public final class FloatingToolbar { PopupWindow popupWindow = new PopupWindow(popupContentHolder); popupWindow.setWindowLayoutType( WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL); + popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED); popupWindow.setAnimationStyle(0); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); content.setLayoutParams(new ViewGroup.LayoutParams( diff --git a/core/jni/android_util_Log.cpp b/core/jni/android_util_Log.cpp index 9a80f1d960b2..2b1067bede5d 100644 --- a/core/jni/android_util_Log.cpp +++ b/core/jni/android_util_Log.cpp @@ -41,32 +41,8 @@ struct levels_t { }; static levels_t levels; -static int toLevel(const char* value) -{ - switch (value[0]) { - case 'V': return levels.verbose; - case 'D': return levels.debug; - case 'I': return levels.info; - case 'W': return levels.warn; - case 'E': return levels.error; - case 'A': return levels.assert; - case 'S': return -1; // SUPPRESS - } - return levels.info; -} - static jboolean isLoggable(const char* tag, jint level) { - String8 key; - key.append(LOG_NAMESPACE); - key.append(tag); - - char buf[PROPERTY_VALUE_MAX]; - if (property_get(key.string(), buf, "") <= 0) { - buf[0] = '\0'; - } - - int logLevel = toLevel(buf); - return logLevel >= 0 && level >= logLevel; + return __android_log_is_loggable(level, tag, ANDROID_LOG_INFO); } static jboolean android_util_Log_isLoggable(JNIEnv* env, jobject clazz, jstring tag, jint level) diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index a434a132dbef..65c064b0c5cb 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -289,6 +289,8 @@ <protected-broadcast android:name="android.location.GPS_FIX_CHANGE" /> <protected-broadcast android:name="android.net.proxy.PAC_REFRESH" /> + <protected-broadcast android:name="android.telecom.action.DEFAULT_DIALER_CHANGED" /> + <protected-broadcast android:name="com.android.server.connectivityservice.CONNECTED_TO_PROVISIONING_NETWORK_ACTION" /> diff --git a/core/res/res/values-sw600dp/dimens.xml b/core/res/res/values-sw600dp/dimens.xml index c0d999546399..94e9c4e47d7a 100644 --- a/core/res/res/values-sw600dp/dimens.xml +++ b/core/res/res/values-sw600dp/dimens.xml @@ -115,4 +115,6 @@ <!-- width of ImmersiveModeConfirmation (-1 for match_parent) --> <dimen name="immersive_mode_cling_width">380dp</dimen> + + <dimen name="floating_toolbar_preferred_width">544dp</dimen> </resources> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index e7811df1041a..7272ae304384 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1271,11 +1271,6 @@ an mcc/mnc specific config.xml --> <string name="mobile_provisioning_url" translatable="false"></string> - <!-- This url is used as the default url when redirection is detected. Any - should work as all url's get redirected. But maybe overridden by - if needed. --> - <string name="mobile_redirected_provisioning_url" translatable="false">http://google.com</string> - <!-- The default character set for GsmAlphabet --> <!-- Empty string means MBCS is not considered --> <string name="gsm_alphabet_default_charset" translatable="false"></string> @@ -2196,6 +2191,9 @@ <!-- Keyguard component --> <string name="config_keyguardComponent" translatable="false">com.android.systemui/com.android.systemui.keyguard.KeyguardService</string> + <!-- For performance and storage reasons, limit the number of fingerprints per user --> + <integer name="config_fingerprintMaxTemplatesPerUser">5</integer> + <!-- This config is used to force VoiceInteractionService to start on certain low ram devices. It declares the package name of VoiceInteractionService that should be started. --> <string translatable="false" name="config_forceVoiceInteractionServicePackage"></string> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 2908cc5e7b0e..fb0455dcd354 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -34,7 +34,7 @@ to display a size in kilobytes, megabytes, or other size units. Some languages (like French) will want to add a space between the placeholders. --> - <string name="fileSizeSuffix"><xliff:g id="number" example="123">%1$s</xliff:g><xliff:g id="unit" example="KB">%2$s</xliff:g></string> + <string name="fileSizeSuffix"><xliff:g id="number" example="123">%1$s</xliff:g> <xliff:g id="unit" example="KB">%2$s</xliff:g></string> <!-- [CHAR_LIMIT=10] Suffix added to signify duration in days --> <string name="durationDays"><xliff:g id="days">%1$d</xliff:g> days</string> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 45e5d17b3218..d7b565c53cfe 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -818,7 +818,6 @@ <java-symbol type="string" name="progress_unmounting" /> <java-symbol type="string" name="mobile_provisioning_apn" /> <java-symbol type="string" name="mobile_provisioning_url" /> - <java-symbol type="string" name="mobile_redirected_provisioning_url" /> <java-symbol type="string" name="quick_contacts_not_available" /> <java-symbol type="string" name="reboot_to_update_package" /> <java-symbol type="string" name="reboot_to_update_prepare" /> @@ -2125,6 +2124,9 @@ <java-symbol type="string" name="fingerprint_error_lockout" /> <java-symbol type="string" name="fingerprint_name_template" /> + <!-- Fingerprint config --> + <java-symbol type="integer" name="config_fingerprintMaxTemplatesPerUser"/> + <!-- From various Material changes --> <java-symbol type="attr" name="titleTextAppearance" /> <java-symbol type="attr" name="subtitleTextAppearance" /> diff --git a/core/tests/coretests/src/android/net/NetworkTest.java b/core/tests/coretests/src/android/net/NetworkTest.java index b0ecb04945c0..74b6d982b0dc 100644 --- a/core/tests/coretests/src/android/net/NetworkTest.java +++ b/core/tests/coretests/src/android/net/NetworkTest.java @@ -16,11 +16,14 @@ package android.net; +import static android.test.MoreAsserts.assertNotEqual; + import android.net.LocalServerSocket; import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.net.Network; import android.test.suitebuilder.annotation.SmallTest; + import java.io.File; import java.io.FileDescriptor; import java.io.FileInputStream; @@ -29,6 +32,7 @@ import java.net.DatagramSocket; import java.net.InetAddress; import java.net.Inet6Address; import java.net.SocketException; + import junit.framework.TestCase; public class NetworkTest extends TestCase { @@ -93,4 +97,50 @@ public class NetworkTest extends TestCase { fail("SocketException not thrown"); } catch (SocketException expected) {} } + + @SmallTest + public void testZeroIsObviousForDebugging() { + Network zero = new Network(0); + assertEquals(0, zero.hashCode()); + assertEquals(0, zero.getNetworkHandle()); + assertEquals("0", zero.toString()); + } + + @SmallTest + public void testGetNetworkHandle() { + Network one = new Network(1); + Network two = new Network(2); + Network three = new Network(3); + + // None of the hashcodes are zero. + assertNotEqual(0, one.hashCode()); + assertNotEqual(0, two.hashCode()); + assertNotEqual(0, three.hashCode()); + + // All the hashcodes are distinct. + assertNotEqual(one.hashCode(), two.hashCode()); + assertNotEqual(one.hashCode(), three.hashCode()); + assertNotEqual(two.hashCode(), three.hashCode()); + + // None of the handles are zero. + assertNotEqual(0, one.getNetworkHandle()); + assertNotEqual(0, two.getNetworkHandle()); + assertNotEqual(0, three.getNetworkHandle()); + + // All the handles are distinct. + assertNotEqual(one.getNetworkHandle(), two.getNetworkHandle()); + assertNotEqual(one.getNetworkHandle(), three.getNetworkHandle()); + assertNotEqual(two.getNetworkHandle(), three.getNetworkHandle()); + + // The handles are not equal to the hashcodes. + assertNotEqual(one.hashCode(), one.getNetworkHandle()); + assertNotEqual(two.hashCode(), two.getNetworkHandle()); + assertNotEqual(three.hashCode(), three.getNetworkHandle()); + + // Adjust as necessary to test an implementation's specific constants. + // When running with runtest, "adb logcat -s TestRunner" can be useful. + assertEquals(4311403230L, one.getNetworkHandle()); + assertEquals(8606370526L, two.getNetworkHandle()); + assertEquals(12901337822L, three.getNetworkHandle()); + } } diff --git a/data/fonts/DroidSansMono.ttf b/data/fonts/DroidSansMono.ttf Binary files differindex 4085cee84c8c..b7bf5b4aa8ad 100644 --- a/data/fonts/DroidSansMono.ttf +++ b/data/fonts/DroidSansMono.ttf diff --git a/docs/html/training/tv/publishing/checklist.jd b/docs/html/training/tv/publishing/checklist.jd index 865a89b15916..6259721c2550 100644 --- a/docs/html/training/tv/publishing/checklist.jd +++ b/docs/html/training/tv/publishing/checklist.jd @@ -67,12 +67,12 @@ page.article=true <li> Eliminate requirements for unsupported hardware in your app. - <p>See <a href="training/tv/start/hardware.html#declare-hardware-requirements">Declaring hardware requirements for TV</a>.</p> + <p>See <a href="{@docRoot}training/tv/start/hardware.html#declare-hardware-requirements">Declaring hardware requirements for TV</a>.</p> </li> <li> Ensure permissions do not imply hardware requirements - <p>See <a href="training/tv/start/hardware.html#hardware-permissions">Declaring permissions that imply hardware features</a>.</p> + <p>See <a href="{@docRoot}training/tv/start/hardware.html#hardware-permissions">Declaring permissions that imply hardware features</a>.</p> </li> </ol> diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java index b93424dbf641..2de60fd1fe6f 100644 --- a/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java +++ b/keystore/java/android/security/keystore/AndroidKeyStoreKeyPairGeneratorSpi.java @@ -624,7 +624,7 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato int keySizeBits, KeyGenParameterSpec spec) { // Constraints: - // 1. Key must be authorized for signing. + // 1. Key must be authorized for signing without user authentication. // 2. Signature digest must be one of key's authorized digests. // 3. For RSA keys, the digest output size must not exceed modulus size minus space needed // for RSA PKCS#1 signature padding (about 29 bytes: minimum 10 bytes of padding + 15--19 @@ -636,6 +636,10 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato // Key not authorized for signing return null; } + if (spec.isUserAuthenticationRequired()) { + // Key not authorized for use without user authentication + return null; + } if (!spec.isDigestsSpecified()) { // Key not authorized for any digests -- can't sign return null; diff --git a/media/java/android/mtp/MtpDevice.java b/media/java/android/mtp/MtpDevice.java index 72dcaa8409a9..a68361b305e1 100644 --- a/media/java/android/mtp/MtpDevice.java +++ b/media/java/android/mtp/MtpDevice.java @@ -132,7 +132,8 @@ public final class MtpDevice { * * @param storageId the storage unit to query * @param format the format of the object to return, or zero for all formats - * @param objectHandle the parent object to query, or zero for the storage root + * @param objectHandle the parent object to query, -1 for the storage root, + * or zero for all objects * @return the object handles */ public int[] getObjectHandles(int storageId, int format, int objectHandle) { diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index 73a723d0858e..4143e154e3ac 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java @@ -120,13 +120,20 @@ public class ExternalStorageProvider extends DocumentsProvider { if (!volume.isMountedReadable()) continue; final String rootId; - if (VolumeInfo.ID_EMULATED_INTERNAL.equals(volume.getId())) { + final String title; + if (volume.getType() == VolumeInfo.TYPE_EMULATED) { + // We currently only support a single emulated volume mounted at + // a time, and it's always considered the primary rootId = ROOT_ID_PRIMARY_EMULATED; - } else if (volume.getType() == VolumeInfo.TYPE_EMULATED) { - final VolumeInfo privateVol = mStorageManager.findPrivateForEmulated(volume); - rootId = privateVol.getFsUuid(); + if (VolumeInfo.ID_EMULATED_INTERNAL.equals(volume.getId())) { + title = getContext().getString(R.string.root_internal_storage); + } else { + final VolumeInfo privateVol = mStorageManager.findPrivateForEmulated(volume); + title = mStorageManager.getBestVolumeDescription(privateVol); + } } else if (volume.getType() == VolumeInfo.TYPE_PUBLIC) { rootId = volume.getFsUuid(); + title = mStorageManager.getBestVolumeDescription(volume); } else { // Unsupported volume; ignore continue; @@ -148,11 +155,7 @@ public class ExternalStorageProvider extends DocumentsProvider { root.rootId = rootId; root.flags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY | Root.FLAG_ADVANCED | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD; - if (ROOT_ID_PRIMARY_EMULATED.equals(rootId)) { - root.title = getContext().getString(R.string.root_internal_storage); - } else { - root.title = mStorageManager.getBestVolumeDescription(volume); - } + root.title = title; if (volume.getType() == VolumeInfo.TYPE_PUBLIC) { root.flags |= Root.FLAG_HAS_SETTINGS; } diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java index 1e7ee98226ff..445ecb659a63 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java @@ -16,7 +16,6 @@ import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.RemoteException; -import android.os.ServiceManager; import android.os.UserHandle; import android.provider.Settings; import android.util.Log; @@ -28,12 +27,15 @@ import android.view.ViewGroup; import android.view.WindowManager; import android.widget.ImageView; -import com.android.internal.app.IVoiceInteractionManagerService; +import com.android.internal.app.AssistUtils; import com.android.internal.app.IVoiceInteractionSessionShowCallback; import com.android.systemui.R; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.phone.PhoneStatusBar; +import java.io.FileDescriptor; +import java.io.PrintWriter; + /** * Class to manage everything related to assist in SystemUI. */ @@ -55,7 +57,7 @@ public class AssistManager { private final WindowManager mWindowManager; private AssistOrbContainer mView; private final PhoneStatusBar mBar; - private final IVoiceInteractionManagerService mVoiceInteractionManagerService; + private final AssistUtils mAssistUtils; private ComponentName mAssistComponent; @@ -92,8 +94,7 @@ public class AssistManager { mContext = context; mBar = bar; mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); - mVoiceInteractionManagerService = IVoiceInteractionManagerService.Stub.asInterface( - ServiceManager.getService(Context.VOICE_INTERACTION_MANAGER_SERVICE)); + mAssistUtils = new AssistUtils(context); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.ASSISTANT), false, @@ -140,11 +141,7 @@ public class AssistManager { } public void hideAssist() { - try { - mVoiceInteractionManagerService.hideCurrentSession(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call hideCurrentSession", e); - } + mAssistUtils.hideCurrentSession(); } private WindowManager.LayoutParams getLayoutParams() { @@ -216,58 +213,27 @@ public class AssistManager { } private void startVoiceInteractor() { - try { - mVoiceInteractionManagerService.showSessionForActiveService(mShowCallback); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call showSessionForActiveService", e); - } + mAssistUtils.showSessionForActiveService(mShowCallback); } public void launchVoiceAssistFromKeyguard() { - try { - mVoiceInteractionManagerService.launchVoiceAssistFromKeyguard(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call launchVoiceAssistFromKeyguard", e); - } + mAssistUtils.launchVoiceAssistFromKeyguard(); } private boolean getVoiceInteractorSupportsAssistGesture() { - try { - return mVoiceInteractionManagerService != null - && mVoiceInteractionManagerService.activeServiceSupportsAssist(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call activeServiceSupportsAssistGesture", e); - return false; - } + return mAssistUtils.activeServiceSupportsAssistGesture(); } public boolean canVoiceAssistBeLaunchedFromKeyguard() { - try { - return mVoiceInteractionManagerService != null - && mVoiceInteractionManagerService.activeServiceSupportsLaunchFromKeyguard(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call activeServiceSupportsLaunchFromKeyguard", e); - return false; - } + return mAssistUtils.activeServiceSupportsLaunchFromKeyguard(); } public ComponentName getVoiceInteractorComponentName() { - try { - return mVoiceInteractionManagerService.getActiveServiceComponentName(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call getActiveServiceComponentName", e); - return null; - } + return mAssistUtils.getActiveServiceComponentName(); } private boolean isVoiceSessionRunning() { - try { - return mVoiceInteractionManagerService != null - && mVoiceInteractionManagerService.isSessionRunning(); - } catch (RemoteException e) { - Log.w(TAG, "Failed to call isSessionRunning", e); - return false; - } + return mAssistUtils.isSessionRunning(); } public void destroy() { @@ -324,26 +290,11 @@ public class AssistManager { } private void updateAssistInfo() { - final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(), - Settings.Secure.ASSISTANT, UserHandle.USER_CURRENT); - if (setting != null) { - mAssistComponent = ComponentName.unflattenFromString(setting); - return; - } - - // Fallback to keep backward compatible behavior when there is no user setting. - if (getVoiceInteractorSupportsAssistGesture()) { - mAssistComponent = getVoiceInteractorComponentName(); - return; - } - - Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, false, UserHandle.USER_CURRENT); - if (intent != null) { - mAssistComponent = intent.getComponent(); - return; - } + mAssistComponent = mAssistUtils.getAssistComponentForUser(UserHandle.USER_CURRENT); + } - mAssistComponent = null; + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + pw.println("AssistManager state:"); + pw.print(" mAssistComponent="); pw.println(mAssistComponent); } } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index f00fed5da838..c06b34fa1ffb 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -371,7 +371,6 @@ public class KeyguardViewMediator extends SystemUI { @Override public void onDeviceProvisioned() { sendUserPresentBroadcast(); - updateInputRestricted(); } @Override @@ -947,7 +946,7 @@ public class KeyguardViewMediator extends SystemUI { * was suppressed by an app that disabled the keyguard or we haven't been provisioned yet. */ public boolean isInputRestricted() { - return mShowing || mNeedToReshowWhenReenabled || shouldWaitForProvisioning(); + return mShowing || mNeedToReshowWhenReenabled; } private void updateInputRestricted() { diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index c8212c23f6d9..9761cd19e195 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -242,6 +242,9 @@ public class QSPanel extends ViewGroup { } private void handleSetTileVisibility(View v, int visibility) { + if (visibility == VISIBLE && !mGridContentVisible) { + visibility = INVISIBLE; + } if (visibility == v.getVisibility()) return; v.setVisibility(visibility); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index a750572e0409..5ac436ae55ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1180,7 +1180,9 @@ public class NotificationPanelView extends PanelView implements } else if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) { mKeyguardBottomArea.animate().cancel(); - mKeyguardBottomArea.setVisibility(View.VISIBLE); + if (!mDozing) { + mKeyguardBottomArea.setVisibility(View.VISIBLE); + } mKeyguardBottomArea.setAlpha(1f); } else { mKeyguardBottomArea.animate().cancel(); @@ -1263,7 +1265,7 @@ public class NotificationPanelView extends PanelView implements setQsExpanded(true); } else if (height <= mQsMinExpansionHeight && mQsExpanded) { setQsExpanded(false); - if (mLastAnnouncementWasQuickSettings && !mTracking) { + if (mLastAnnouncementWasQuickSettings && !mTracking && !isCollapsing()) { announceForAccessibility(getKeyguardOrLockScreenString()); mLastAnnouncementWasQuickSettings = false; } @@ -1717,7 +1719,8 @@ public class NotificationPanelView extends PanelView implements float alphaQsExpansion = 1 - Math.min(1, getQsExpansionFraction() * 2); mKeyguardStatusBar.setAlpha(Math.min(getKeyguardContentsAlpha(), alphaQsExpansion) * mKeyguardStatusBarAnimateAlpha); - mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f ? VISIBLE : INVISIBLE); + mKeyguardStatusBar.setVisibility(mKeyguardStatusBar.getAlpha() != 0f + && !mDozing ? VISIBLE : INVISIBLE); setQsTranslation(mQsExpansionHeight); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index c77e7f0266ae..69198ed6d6bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2687,6 +2687,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (mNextAlarmController != null) { mNextAlarmController.dump(fd, pw, args); } + if (mAssistManager != null) { + mAssistManager.dump(fd, pw, args); + } if (mSecurityController != null) { mSecurityController.dump(fd, pw, args); } diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index f6457647acfa..82399da92f46 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -960,44 +960,6 @@ public class ConnectivityService extends IConnectivityManager.Stub return nai != null ? nai.network : null; } - /** - * Find the first Provisioning network. - * - * @return NetworkInfo or null if none. - */ - private NetworkInfo getProvisioningNetworkInfo() { - enforceAccessPermission(); - - // Find the first Provisioning Network - NetworkInfo provNi = null; - for (NetworkInfo ni : getAllNetworkInfo()) { - if (ni.isConnectedToProvisioningNetwork()) { - provNi = ni; - break; - } - } - if (DBG) log("getProvisioningNetworkInfo: X provNi=" + provNi); - return provNi; - } - - /** - * Find the first Provisioning network or the ActiveDefaultNetwork - * if there is no Provisioning network - * - * @return NetworkInfo or null if none. - */ - @Override - public NetworkInfo getProvisioningOrActiveNetworkInfo() { - enforceAccessPermission(); - - NetworkInfo provNi = getProvisioningNetworkInfo(); - if (provNi == null) { - provNi = getActiveNetworkInfo(); - } - if (DBG) log("getProvisioningOrActiveNetworkInfo: X provNi=" + provNi); - return provNi; - } - public NetworkInfo getActiveNetworkInfoUnfiltered() { enforceAccessPermission(); final int uid = Binder.getCallingUid(); @@ -1567,14 +1529,6 @@ public class ConnectivityService extends IConnectivityManager.Stub } }; - /** @hide */ - @Override - public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) { - enforceConnectivityInternalPermission(); - if (DBG) log("captivePortalCheckCompleted: ni=" + info + " captive=" + isCaptivePortal); -// mNetTrackers[info.getType()].captivePortalCheckCompleted(isCaptivePortal); - } - /** * Setup data activity tracking for the given network. * @@ -3357,7 +3311,6 @@ public class ConnectivityService extends IConnectivityManager.Stub * <?xml version="1.0" encoding="utf-8"?> * <provisioningUrls> * <provisioningUrl mcc="310" mnc="4">http://myserver.com/foo?mdn=%3$s&iccid=%1$s&imei=%2$s</provisioningUrl> - * <redirectedUrl mcc="310" mnc="4">http://www.google.com</redirectedUrl> * </provisioningUrls> */ private static final String PROVISIONING_URL_PATH = @@ -3368,33 +3321,15 @@ public class ConnectivityService extends IConnectivityManager.Stub private static final String TAG_PROVISIONING_URLS = "provisioningUrls"; /** XML tag for individual url */ private static final String TAG_PROVISIONING_URL = "provisioningUrl"; - /** XML tag for redirected url */ - private static final String TAG_REDIRECTED_URL = "redirectedUrl"; /** XML attribute for mcc */ private static final String ATTR_MCC = "mcc"; /** XML attribute for mnc */ private static final String ATTR_MNC = "mnc"; - private static final int REDIRECTED_PROVISIONING = 1; - private static final int PROVISIONING = 2; - - private String getProvisioningUrlBaseFromFile(int type) { + private String getProvisioningUrlBaseFromFile() { FileReader fileReader = null; XmlPullParser parser = null; Configuration config = mContext.getResources().getConfiguration(); - String tagType; - - switch (type) { - case PROVISIONING: - tagType = TAG_PROVISIONING_URL; - break; - case REDIRECTED_PROVISIONING: - tagType = TAG_REDIRECTED_URL; - break; - default: - throw new RuntimeException("getProvisioningUrlBaseFromFile: Unexpected parameter " + - type); - } try { fileReader = new FileReader(mProvisioningUrlFile); @@ -3408,7 +3343,7 @@ public class ConnectivityService extends IConnectivityManager.Stub String element = parser.getName(); if (element == null) break; - if (element.equals(tagType)) { + if (element.equals(TAG_PROVISIONING_URL)) { String mcc = parser.getAttributeValue(null, ATTR_MCC); try { if (mcc != null && Integer.parseInt(mcc) == config.mcc) { @@ -3443,19 +3378,9 @@ public class ConnectivityService extends IConnectivityManager.Stub } @Override - public String getMobileRedirectedProvisioningUrl() { - enforceConnectivityInternalPermission(); - String url = getProvisioningUrlBaseFromFile(REDIRECTED_PROVISIONING); - if (TextUtils.isEmpty(url)) { - url = mContext.getResources().getString(R.string.mobile_redirected_provisioning_url); - } - return url; - } - - @Override public String getMobileProvisioningUrl() { enforceConnectivityInternalPermission(); - String url = getProvisioningUrlBaseFromFile(PROVISIONING); + String url = getProvisioningUrlBaseFromFile(); if (TextUtils.isEmpty(url)) { url = mContext.getResources().getString(R.string.mobile_provisioning_url); log("getMobileProvisioningUrl: mobile_provisioining_url from resource =" + url); diff --git a/services/core/java/com/android/server/IntentResolver.java b/services/core/java/com/android/server/IntentResolver.java index 744156bd34e0..3359060d3fe7 100644 --- a/services/core/java/com/android/server/IntentResolver.java +++ b/services/core/java/com/android/server/IntentResolver.java @@ -731,6 +731,10 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> { if (filter.getAutoVerify()) { if (localVerificationLOGV || debug) { Slog.v(TAG, " Filter verified: " + isFilterVerified(filter)); + int authorities = filter.countDataAuthorities(); + for (int z = 0; z < authorities; z++) { + Slog.v(TAG, " " + filter.getDataAuthority(z).getHost()); + } } } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 421ba86ff516..e9b9767194f2 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -5267,7 +5267,7 @@ public final class ActivityManagerService extends ActivityManagerNative } int callerUid = Binder.getCallingUid(); // Only the system server can kill an application - if (callerUid == Process.SYSTEM_UID) { + if (UserHandle.getAppId(callerUid) == Process.SYSTEM_UID) { // Post an aysnc message to kill the application Message msg = mHandler.obtainMessage(KILL_APPLICATION_MSG); msg.arg1 = appid; diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java index b56e3266cb6a..c973386e4bb8 100644 --- a/services/core/java/com/android/server/am/BatteryStatsService.java +++ b/services/core/java/com/android/server/am/BatteryStatsService.java @@ -1167,6 +1167,10 @@ public final class BatteryStatsService extends IBatteryStats.Stub BluetoothActivityEnergyInfo info = adapter.getControllerActivityEnergyInfo( BluetoothAdapter.ACTIVITY_ENERGY_INFO_REFRESHED); if (info != null && info.isValid()) { + if (info.getControllerEnergyUsed() < 0 || info.getControllerIdleTimeMillis() < 0 || + info.getControllerRxTimeMillis() < 0 || info.getControllerTxTimeMillis() < 0) { + Slog.wtf(TAG, "Bluetooth energy data is invalid: " + info); + } return info; } } diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java index 7f0be5766d1a..c52a1c1ce6db 100644 --- a/services/core/java/com/android/server/fingerprint/FingerprintService.java +++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java @@ -33,6 +33,7 @@ import android.os.MessageQueue; import android.os.RemoteException; import android.os.SELinux; import android.os.ServiceManager; +import android.os.UserHandle; import android.util.Slog; import com.android.server.SystemService; @@ -389,12 +390,12 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe } } - public List<Fingerprint> getEnrolledFingerprints(int groupId) { - return mFingerprintUtils.getFingerprintsForUser(mContext, groupId); + public List<Fingerprint> getEnrolledFingerprints(int userId) { + return mFingerprintUtils.getFingerprintsForUser(mContext, userId); } - public boolean hasEnrolledFingerprints(int groupId) { - return mFingerprintUtils.getFingerprintsForUser(mContext, groupId).size() > 0; + public boolean hasEnrolledFingerprints(int userId) { + return mFingerprintUtils.getFingerprintsForUser(mContext, userId).size() > 0; } boolean hasPermission(String permission) { @@ -598,6 +599,15 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe public void enroll(final IBinder token, final byte[] cryptoToken, final int groupId, final IFingerprintServiceReceiver receiver, final int flags) { checkPermission(MANAGE_FINGERPRINT); + final int limit = mContext.getResources().getInteger( + com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser); + final int callingUid = Binder.getCallingUid(); + final int userId = UserHandle.getUserId(callingUid); + final int enrolled = FingerprintService.this.getEnrolledFingerprints(userId).size(); + if (enrolled >= limit) { + Slog.w(TAG, "Too many fingerprints registered"); + return; + } final byte [] cryptoClone = Arrays.copyOf(cryptoToken, cryptoToken.length); final boolean restricted = isRestricted(); @@ -689,11 +699,11 @@ public class FingerprintService extends SystemService implements IBinder.DeathRe } @Override // Binder call - public List<Fingerprint> getEnrolledFingerprints(int groupId, String opPackageName) { + public List<Fingerprint> getEnrolledFingerprints(int userId, String opPackageName) { if (!canUseFingerprint(opPackageName)) { return Collections.emptyList(); } - return FingerprintService.this.getEnrolledFingerprints(groupId); + return FingerprintService.this.getEnrolledFingerprints(userId); } @Override // Binder call diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a24bd523dd67..548d93c79d10 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -268,6 +268,7 @@ public class PackageManagerService extends IPackageManager.Stub { static final boolean DEBUG_SETTINGS = false; static final boolean DEBUG_PREFERRED = false; static final boolean DEBUG_UPGRADE = false; + static final boolean DEBUG_DOMAIN_VERIFICATION = false; private static final boolean DEBUG_BACKUP = true; private static final boolean DEBUG_INSTALL = false; private static final boolean DEBUG_REMOVE = false; @@ -279,7 +280,6 @@ public class PackageManagerService extends IPackageManager.Stub { private static final boolean DEBUG_VERIFY = false; private static final boolean DEBUG_DEXOPT = false; private static final boolean DEBUG_ABI_SELECTION = false; - private static final boolean DEBUG_DOMAIN_VERIFICATION = false; private static final int RADIO_UID = Process.PHONE_UID; private static final int LOG_UID = Process.LOG_UID; @@ -11818,50 +11818,45 @@ public class PackageManagerService extends IPackageManager.Stub { final int verificationId = mIntentFilterVerificationToken++; int count = 0; final String packageName = pkg.packageName; - ArrayList<String> allHosts = new ArrayList<>(); + boolean needToVerify = false; synchronized (mPackages) { + // If any filters need to be verified, then all need to be. for (PackageParser.Activity a : pkg.activities) { for (ActivityIntentInfo filter : a.intents) { - boolean needsFilterVerification = filter.needsVerification(); - if (needsFilterVerification && needsNetworkVerificationLPr(filter)) { - if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, - "Verification needed for IntentFilter:" + filter.toString()); - mIntentFilterVerifier.addOneIntentFilterVerification( - verifierUid, userId, verificationId, filter, packageName); - count++; - } else if (!needsFilterVerification) { - if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, - "No verification needed for IntentFilter:" + filter.toString()); - if (hasValidDomains(filter)) { - ArrayList<String> hosts = filter.getHostsList(); - if (hosts.size() > 0) { - allHosts.addAll(hosts); - } else { - if (allHosts.isEmpty()) { - allHosts.add("*"); - } - } + if (filter.needsVerification() && needsNetworkVerificationLPr(filter)) { + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.d(TAG, "Intent filter needs verification, so processing all filters"); + } + needToVerify = true; + break; + } + } + } + if (needToVerify) { + for (PackageParser.Activity a : pkg.activities) { + for (ActivityIntentInfo filter : a.intents) { + boolean needsFilterVerification = filter.hasWebDataURI(); + if (needsFilterVerification && needsNetworkVerificationLPr(filter)) { + if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, + "Verification needed for IntentFilter:" + filter.toString()); + mIntentFilterVerifier.addOneIntentFilterVerification( + verifierUid, userId, verificationId, filter, packageName); + count++; } - } else { - if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, - "Verification already done for IntentFilter:" + filter.toString()); } } } } if (count > 0) { - mIntentFilterVerifier.startVerifications(userId); - if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Started " + count + if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Starting " + count + " IntentFilter verification" + (count > 1 ? "s" : "") - + " for userId:" + userId + "!"); + + " for userId:" + userId); + mIntentFilterVerifier.startVerifications(userId); } else { - if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, - "No need to start any IntentFilter verification!"); - if (allHosts.size() > 0 && mSettings.createIntentFilterVerificationIfNeededLPw( - packageName, allHosts) != null) { - scheduleWriteSettingsLocked(); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.d(TAG, "No filters or not all autoVerify for " + packageName); } } } diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index 8f2db306c70f..cd50946567a7 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -27,6 +27,7 @@ import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATIO import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED; import static android.os.Process.SYSTEM_UID; import static android.os.Process.PACKAGE_INFO_GID; +import static com.android.server.pm.PackageManagerService.DEBUG_DOMAIN_VERIFICATION; import android.content.IntentFilter; import android.content.pm.ActivityInfo; @@ -977,7 +978,9 @@ final class Settings { IntentFilterVerificationInfo getIntentFilterVerificationLPr(String packageName) { PackageSetting ps = mPackages.get(packageName); if (ps == null) { - Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, "No package known: " + packageName); + } return null; } return ps.getIntentFilterVerificationInfo(); @@ -988,20 +991,26 @@ final class Settings { ArrayList<String> domains) { PackageSetting ps = mPackages.get(packageName); if (ps == null) { - Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, "No package known: " + packageName); + } return null; } IntentFilterVerificationInfo ivi = ps.getIntentFilterVerificationInfo(); if (ivi == null) { ivi = new IntentFilterVerificationInfo(packageName, domains); ps.setIntentFilterVerificationInfo(ivi); - Slog.d(PackageManagerService.TAG, - "Creating new IntentFilterVerificationInfo for packageName: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.d(PackageManagerService.TAG, + "Creating new IntentFilterVerificationInfo for pkg: " + packageName); + } } else { ivi.setDomains(domains); - Slog.d(PackageManagerService.TAG, - "Setting domains to existing IntentFilterVerificationInfo for packageName: " + - packageName + " and with domains: " + ivi.getDomainsString()); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.d(PackageManagerService.TAG, + "Setting domains to existing IntentFilterVerificationInfo for pkg: " + + packageName + " and with domains: " + ivi.getDomainsString()); + } } return ivi; } @@ -1009,7 +1018,9 @@ final class Settings { int getIntentFilterVerificationStatusLPr(String packageName, int userId) { PackageSetting ps = mPackages.get(packageName); if (ps == null) { - Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, "No package known: " + packageName); + } return INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED; } int status = ps.getDomainVerificationStatusForUser(userId); @@ -1025,14 +1036,18 @@ final class Settings { // Update the status for the current package PackageSetting current = mPackages.get(packageName); if (current == null) { - Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, "No package known: " + packageName); + } return false; } current.setDomainVerificationStatusForUser(status, userId); if (current.getIntentFilterVerificationInfo() == null) { - Slog.w(PackageManagerService.TAG, - "No IntentFilterVerificationInfo known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, + "No IntentFilterVerificationInfo known: " + packageName); + } return false; } @@ -1080,7 +1095,9 @@ final class Settings { boolean removeIntentFilterVerificationLPw(String packageName, int userId) { PackageSetting ps = mPackages.get(packageName); if (ps == null) { - Slog.w(PackageManagerService.TAG, "No package known for name: " + packageName); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.w(PackageManagerService.TAG, "No package known: " + packageName); + } return false; } ps.clearDomainVerificationStatusForUser(userId); @@ -1549,8 +1566,10 @@ final class Settings { if (verificationInfo != null && verificationInfo.getPackageName() != null) { serializer.startTag(null, TAG_DOMAIN_VERIFICATION); verificationInfo.writeToXml(serializer); - Log.d(TAG, "Wrote domain verification for package: " - + verificationInfo.getPackageName()); + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.d(TAG, "Wrote domain verification for package: " + + verificationInfo.getPackageName()); + } serializer.endTag(null, TAG_DOMAIN_VERIFICATION); } } diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 095b7d79a156..4082ff3a957a 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -966,6 +966,7 @@ public class UserManagerService extends IUserManager.Stub { writeBoolean(serializer, restrictions, UserManager.DISALLOW_ADJUST_VOLUME); writeBoolean(serializer, restrictions, UserManager.DISALLOW_OUTGOING_CALLS); writeBoolean(serializer, restrictions, UserManager.DISALLOW_SMS); + writeBoolean(serializer, restrictions, UserManager.DISALLOW_FUN); writeBoolean(serializer, restrictions, UserManager.DISALLOW_CREATE_WINDOWS); writeBoolean(serializer, restrictions, UserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE); writeBoolean(serializer, restrictions, UserManager.DISALLOW_OUTGOING_BEAM); @@ -1096,6 +1097,7 @@ public class UserManagerService extends IUserManager.Stub { readBoolean(parser, restrictions, UserManager.DISALLOW_ADJUST_VOLUME); readBoolean(parser, restrictions, UserManager.DISALLOW_OUTGOING_CALLS); readBoolean(parser, restrictions, UserManager.DISALLOW_SMS); + readBoolean(parser, restrictions, UserManager.DISALLOW_FUN); readBoolean(parser, restrictions, UserManager.DISALLOW_CREATE_WINDOWS); readBoolean(parser, restrictions, UserManager.DISALLOW_CROSS_PROFILE_COPY_PASTE); readBoolean(parser, restrictions, UserManager.DISALLOW_OUTGOING_BEAM); diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index ea66a04da44e..f1f61f3a40a5 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -209,6 +209,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { DEVICE_OWNER_USER_RESTRICTIONS.add(UserManager.DISALLOW_UNMUTE_MICROPHONE); DEVICE_OWNER_USER_RESTRICTIONS.add(UserManager.DISALLOW_ADJUST_VOLUME); DEVICE_OWNER_USER_RESTRICTIONS.add(UserManager.DISALLOW_SMS); + DEVICE_OWNER_USER_RESTRICTIONS.add(UserManager.DISALLOW_FUN); DEVICE_OWNER_USER_RESTRICTIONS.add(UserManager.DISALLOW_SAFE_BOOT); } diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 368e1375a648..0cd8c191203e 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -124,6 +124,16 @@ public class TelecomManager { "android.telecom.action.CHANGE_DEFAULT_DIALER"; /** + * Broadcast intent action indicating that the current default dialer has changed. + * The string extra {@link #EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME} will contain the + * name of the package that the default dialer was changed to. + * + * @see #EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME + */ + public static final String ACTION_DEFAULT_DIALER_CHANGED = + "android.telecom.action.DEFAULT_DIALER_CHANGED"; + + /** * Extra value used to provide the package name for {@link #ACTION_CHANGE_DEFAULT_DIALER}. */ public static final String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = @@ -774,6 +784,31 @@ public class TelecomManager { } /** + * Used to set the default dialer package. + * + * @param packageName to set the default dialer to.. + * + * @result {@code true} if the default dialer was successfully changed, {@code false} if + * the specified package does not correspond to an installed dialer, or is already + * the default dialer. + * + * Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} + * Requires permission: {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} + * + * @hide + */ + public boolean setDefaultDialer(String packageName) { + try { + if (isServiceConnected()) { + return getTelecomService().setDefaultDialer(packageName); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to set the default dialer.", e); + } + return false; + } + + /** * Used to determine the dialer package that is preloaded on the system partition. * * @return package name for the system dialer package or null if no system dialer is preloaded. diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index da0c547cbd6f..bcfee30f3ffe 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -84,7 +84,7 @@ public class CarrierConfigManager { * from config.xml under apps/Contacts. */ public static final String - KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "key_enable_dialer_vibration_bool"; + KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "enable_dialer_vibration_bool"; /** Flag indicating if dtmf tone type is enabled */ public static final String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool"; @@ -185,6 +185,13 @@ public class CarrierConfigManager { */ public static final String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool"; + /** + * Flag specifying whether WFC over IMS should be available for carrier: independent of + * carrier provisioning. If false: hard disabled. If true: then depends on carrier + * provisioning, availability etc. + */ + public static final String KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL = "carrier_wfc_ims_available_bool"; + /** Flag specifying whether VoLTE availability is based on provisioning. */ public static final String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool"; @@ -200,6 +207,13 @@ public class CarrierConfigManager { */ public static final String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int"; + /** + * The default sim call manager to use when the default dialer doesn't implement one. A sim call + * manager can control and route outgoing and incoming phone calls, even if they're placed + * using another connection service (PSTN, for example). + */ + public static final String KEY_DEFAULT_SIM_CALL_MANAGER_STRING = "default_sim_call_manager_string"; + /* The following 3 fields are related to carrier visual voicemail. */ /** @@ -232,6 +246,34 @@ public class CarrierConfigManager { */ public static final String KEY_CARRIER_VVM_PACKAGE_NAME_STRING = "carrier_vvm_package_name_string"; + /** + * Flag specifying whether an additional (client initiated) intent needs to be sent on System + * update + * @hide + */ + public static final String KEY_CI_ACTION_ON_SYS_UPDATE_BOOL = "ci_action_on_sys_update_bool"; + + /** + * Intent to be sent for the additional action on System update + * @hide + */ + public static final String KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING = + "ci_action_on_sys_update_intent_string"; + + /** + * Extra to be included in the intent sent for additional action on System update + * @hide + */ + public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING = + "ci_action_on_sys_update_extra_string"; + + /** + * Value of extra included in intent sent for additional action on System update + * @hide + */ + public static final String KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING = + "ci_action_on_sys_update_extra_val_string"; + // These variables are used by the MMS service and exposed through another API, {@link // SmsManager}. The variable names and string values are copied from there. public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled"; @@ -278,6 +320,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_AUTO_RETRY_ENABLED_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_SETTINGS_ENABLE_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VOLTE_AVAILABLE_BOOL, false); + sDefaults.putBoolean(KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VOLTE_PROVISIONED_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, true); sDefaults.putBoolean(KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL, false); @@ -300,10 +343,15 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_VOICE_PRIVACY_DISABLE_UI_BOOL, false); sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, false); sDefaults.putInt(KEY_VOLTE_REPLACEMENT_RAT_INT, 0); + sDefaults.putString(KEY_DEFAULT_SIM_CALL_MANAGER_STRING, ""); sDefaults.putString(KEY_VVM_DESTINATION_NUMBER_STRING, ""); sDefaults.putInt(KEY_VVM_PORT_NUMBER_INT, 0); sDefaults.putString(KEY_VVM_TYPE_STRING, ""); sDefaults.putString(KEY_CARRIER_VVM_PACKAGE_NAME_STRING, ""); + sDefaults.putBoolean(KEY_CI_ACTION_ON_SYS_UPDATE_BOOL, false); + sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_INTENT_STRING, ""); + sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, ""); + sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING, ""); // MMS defaults sDefaults.putBoolean(KEY_MMS_ALIAS_ENABLED_BOOL, false); diff --git a/wifi/java/android/net/wifi/WifiActivityEnergyInfo.java b/wifi/java/android/net/wifi/WifiActivityEnergyInfo.java index 0f73342d7c9b..035317ea402b 100644 --- a/wifi/java/android/net/wifi/WifiActivityEnergyInfo.java +++ b/wifi/java/android/net/wifi/WifiActivityEnergyInfo.java @@ -39,22 +39,22 @@ public final class WifiActivityEnergyInfo implements Parcelable { /** * @hide */ - public int mControllerTxTimeMs; + public long mControllerTxTimeMs; /** * @hide */ - public int mControllerRxTimeMs; + public long mControllerRxTimeMs; /** * @hide */ - public int mControllerIdleTimeMs; + public long mControllerIdleTimeMs; /** * @hide */ - public int mControllerEnergyUsed; + public long mControllerEnergyUsed; public static final int STACK_STATE_INVALID = 0; public static final int STACK_STATE_STATE_ACTIVE = 1; @@ -62,7 +62,7 @@ public final class WifiActivityEnergyInfo implements Parcelable { public static final int STACK_STATE_STATE_IDLE = 3; public WifiActivityEnergyInfo(long timestamp, int stackState, - int txTime, int rxTime, int idleTime, int energyUsed) { + long txTime, long rxTime, long idleTime, long energyUsed) { mTimestamp = timestamp; mStackState = stackState; mControllerTxTimeMs = txTime; @@ -88,10 +88,10 @@ public final class WifiActivityEnergyInfo implements Parcelable { public WifiActivityEnergyInfo createFromParcel(Parcel in) { long timestamp = in.readLong(); int stackState = in.readInt(); - int txTime = in.readInt(); - int rxTime = in.readInt(); - int idleTime = in.readInt(); - int energyUsed = in.readInt(); + long txTime = in.readLong(); + long rxTime = in.readLong(); + long idleTime = in.readLong(); + long energyUsed = in.readLong(); return new WifiActivityEnergyInfo(timestamp, stackState, txTime, rxTime, idleTime, energyUsed); } @@ -103,10 +103,10 @@ public final class WifiActivityEnergyInfo implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeLong(mTimestamp); out.writeInt(mStackState); - out.writeInt(mControllerTxTimeMs); - out.writeInt(mControllerRxTimeMs); - out.writeInt(mControllerIdleTimeMs); - out.writeInt(mControllerEnergyUsed); + out.writeLong(mControllerTxTimeMs); + out.writeLong(mControllerRxTimeMs); + out.writeLong(mControllerIdleTimeMs); + out.writeLong(mControllerEnergyUsed); } public int describeContents() { @@ -123,30 +123,29 @@ public final class WifiActivityEnergyInfo implements Parcelable { /** * @return tx time in ms */ - public int getControllerTxTimeMillis() { - return (int)mControllerTxTimeMs; + public long getControllerTxTimeMillis() { + return mControllerTxTimeMs; } /** * @return rx time in ms */ - public int getControllerRxTimeMillis() { - return (int)mControllerRxTimeMs; + public long getControllerRxTimeMillis() { + return mControllerRxTimeMs; } /** * @return idle time in ms */ - public int getControllerIdleTimeMillis() { - return (int)mControllerIdleTimeMs; + public long getControllerIdleTimeMillis() { + return mControllerIdleTimeMs; } - /** * product of current(mA), voltage(V) and time(ms) * @return energy used */ - public int getControllerEnergyUsed() { + public long getControllerEnergyUsed() { return mControllerEnergyUsed; } /** @@ -160,8 +159,8 @@ public final class WifiActivityEnergyInfo implements Parcelable { * @return if the record is valid */ public boolean isValid() { - return ((getControllerTxTimeMillis() !=0) || - (getControllerRxTimeMillis() !=0) || - (getControllerIdleTimeMillis() !=0)); + return ((mControllerTxTimeMs !=0) || + (mControllerRxTimeMs !=0) || + (mControllerIdleTimeMs !=0)); } } |