summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt188
-rw-r--r--api/system-current.txt188
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java67
-rw-r--r--core/java/android/app/ActivityManager.java149
-rw-r--r--core/java/android/app/ActivityManagerNative.java70
-rw-r--r--core/java/android/app/ActivityThread.java4
-rw-r--r--core/java/android/app/ActivityView.java45
-rw-r--r--core/java/android/app/AssistContent.java42
-rw-r--r--core/java/android/app/IActivityManager.java16
-rw-r--r--core/java/android/app/VoiceInteractor.aidl1
-rw-r--r--core/java/android/app/VoiceInteractor.java171
-rw-r--r--core/java/android/app/usage/NetworkStats.java4
-rw-r--r--core/java/android/content/res/Resources.java5
-rw-r--r--core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java5
-rw-r--r--core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java11
-rw-r--r--core/java/android/hardware/camera2/utils/SurfaceUtils.java4
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java16
-rw-r--r--core/java/android/nfc/cardemulation/ApduServiceInfo.java19
-rw-r--r--core/java/android/nfc/cardemulation/CardEmulation.java31
-rw-r--r--core/java/android/os/BatteryStats.java16
-rw-r--r--core/java/android/provider/AlarmClock.java2
-rw-r--r--core/java/android/service/voice/VoiceInteractionSession.java85
-rw-r--r--core/java/android/view/ScaleGestureDetector.java4
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/android/widget/Editor.java69
-rw-r--r--core/java/android/widget/ImageView.java10
-rw-r--r--core/java/android/widget/MediaController.java39
-rw-r--r--core/java/android/widget/ScrollView.java24
-rw-r--r--core/java/android/widget/TextView.java14
-rw-r--r--core/java/com/android/internal/app/IVoiceInteractor.aidl8
-rw-r--r--core/java/com/android/internal/os/BatterySipper.java16
-rw-r--r--core/java/com/android/internal/os/BatteryStatsHelper.java24
-rw-r--r--core/java/com/android/internal/os/BatteryStatsImpl.java18
-rw-r--r--core/java/com/android/internal/os/CameraPowerCalculator.java48
-rw-r--r--core/java/com/android/internal/os/FlashlightPowerCalculator.java46
-rw-r--r--core/java/com/android/internal/os/PowerProfile.java9
-rw-r--r--core/java/com/android/internal/os/ProcessCpuTracker.java44
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java2
-rw-r--r--core/java/com/android/internal/view/FloatingActionMode.java13
-rwxr-xr-xcore/jni/android/graphics/Bitmap.cpp186
-rw-r--r--core/jni/android/graphics/Graphics.cpp19
-rw-r--r--core/jni/android/graphics/GraphicsJNI.h2
-rw-r--r--core/jni/android_os_Parcel.cpp2
-rw-r--r--core/res/AndroidManifest.xml1
-rw-r--r--core/res/res/values/attrs.xml4
-rw-r--r--core/res/res/values/public.xml5
-rw-r--r--core/res/res/values/strings.xml2
-rw-r--r--core/res/res/values/styles_material.xml2
-rw-r--r--core/res/res/xml/power_profile.xml2
-rw-r--r--docs/html/images/systrace/display-rhythm.pngbin65912 -> 0 bytes
-rw-r--r--docs/html/images/systrace/frame-selected-alert-tab.pngbin0 -> 70576 bytes
-rw-r--r--docs/html/images/systrace/frame-selected.pngbin0 -> 67966 bytes
-rw-r--r--docs/html/images/systrace/frame-unselected.pngbin0 -> 53528 bytes
-rw-r--r--docs/html/images/systrace/overview.pngbin0 -> 90936 bytes
-rw-r--r--docs/html/images/systrace/process-rhythm.pngbin46109 -> 0 bytes
-rw-r--r--docs/html/images/systrace/report.pngbin147640 -> 0 bytes
-rw-r--r--docs/html/preview/testing/performance.jd19
-rw-r--r--docs/html/tools/data-binding/guide.jd26
-rw-r--r--docs/html/tools/debugging/systrace.jd294
-rw-r--r--docs/html/tools/help/systrace.jd50
-rw-r--r--docs/html/tools/studio/index.jd16
-rw-r--r--docs/html/tools/tools_toc.cs2
-rw-r--r--docs/html/training/articles/perf-tips.jd2
-rw-r--r--docs/html/training/wearables/apps/always-on.jd5
-rw-r--r--docs/html/tv/adt-1/index.jd8
-rw-r--r--graphics/java/android/graphics/drawable/Animatable2.java61
-rw-r--r--graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java122
-rw-r--r--graphics/java/android/graphics/drawable/VectorDrawable.java5
-rw-r--r--media/java/android/media/tv/DvbDeviceInfo.java4
-rw-r--r--media/java/android/media/tv/ITvInputSessionWrapper.java5
-rw-r--r--media/java/android/media/tv/TvContract.java5
-rw-r--r--media/java/android/media/tv/TvInputInfo.java4
-rw-r--r--media/java/android/media/tv/TvInputManager.java33
-rw-r--r--media/java/android/media/tv/TvInputService.java13
-rw-r--r--packages/PrintSpooler/res/values-zh-rCN/donottranslate.xml22
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/res/values/strings.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/assist/AssistManager.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java62
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java4
-rw-r--r--rs/java/android/renderscript/ScriptGroup.java82
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java37
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java4
-rw-r--r--services/core/java/com/android/server/EventLogTags.logtags2
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java8
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java20
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java23
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java7
-rw-r--r--services/core/java/com/android/server/tv/TvInputHardwareManager.java15
-rw-r--r--services/core/java/com/android/server/wm/AppTransition.java133
-rw-r--r--services/core/java/com/android/server/wm/AppWindowAnimator.java25
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java3
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java11
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java257
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java12
-rw-r--r--tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java25
-rw-r--r--wifi/java/android/net/wifi/RttManager.java3
103 files changed, 1946 insertions, 1290 deletions
diff --git a/api/current.txt b/api/current.txt
index e6b7bc4..75cd2a1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -219,6 +219,7 @@ package android {
public static final class R.attr {
ctor public R.attr();
field public static final int __reserved0 = 16844020; // 0x10104f4
+ field public static final int __reserved1 = 16844019; // 0x10104f3
field public static final int absListViewStyle = 16842858; // 0x101006a
field public static final int accessibilityEventTypes = 16843648; // 0x1010380
field public static final int accessibilityFeedbackType = 16843650; // 0x1010382
@@ -507,7 +508,6 @@ package android {
field public static final int dropDownWidth = 16843362; // 0x1010262
field public static final int duplicateParentState = 16842985; // 0x10100e9
field public static final int duration = 16843160; // 0x1010198
- field public static final int dynamicResources = 16844019; // 0x10104f3
field public static final int editTextBackground = 16843602; // 0x1010352
field public static final int editTextColor = 16843601; // 0x1010351
field public static final int editTextPreferenceStyle = 16842898; // 0x1010092
@@ -4000,6 +4000,7 @@ package android.app {
ctor public AssistContent();
method public android.content.ClipData getClipData();
method public android.net.Uri getWebUri();
+ method public boolean isAppProvidedIntent();
method public void setClipData(android.content.ClipData);
method public void setIntent(android.content.Intent);
method public void setWebUri(android.net.Uri);
@@ -5498,7 +5499,8 @@ package android.app {
}
public static class VoiceInteractor.AbortVoiceRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.AbortVoiceRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.AbortVoiceRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.AbortVoiceRequest(java.lang.CharSequence, android.os.Bundle);
method public void onAbortResult(android.os.Bundle);
}
@@ -5508,17 +5510,20 @@ package android.app {
}
public static class VoiceInteractor.CompleteVoiceRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.CompleteVoiceRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.CompleteVoiceRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.CompleteVoiceRequest(java.lang.CharSequence, android.os.Bundle);
method public void onCompleteResult(android.os.Bundle);
}
public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.ConfirmationRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle);
method public void onConfirmationResult(boolean, android.os.Bundle);
}
public static class VoiceInteractor.PickOptionRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.PickOptionRequest(java.lang.CharSequence, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
+ ctor public VoiceInteractor.PickOptionRequest(android.app.VoiceInteractor.Prompt, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
+ ctor public deprecated VoiceInteractor.PickOptionRequest(java.lang.CharSequence, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
method public void onPickOptionResult(boolean, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
}
@@ -5537,6 +5542,17 @@ package android.app {
field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.PickOptionRequest.Option> CREATOR;
}
+ public static class VoiceInteractor.Prompt implements android.os.Parcelable {
+ ctor public VoiceInteractor.Prompt(java.lang.CharSequence[], java.lang.CharSequence);
+ ctor public VoiceInteractor.Prompt(java.lang.CharSequence);
+ method public int countVoicePrompts();
+ method public int describeContents();
+ method public java.lang.CharSequence getVisualPrompt();
+ method public java.lang.CharSequence getVoicePromptAt(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.Prompt> CREATOR;
+ }
+
public static abstract class VoiceInteractor.Request {
method public void cancel();
method public android.app.Activity getActivity();
@@ -12166,24 +12182,37 @@ package android.graphics.drawable {
method public abstract void stop();
}
+ public abstract interface Animatable2 implements android.graphics.drawable.Animatable {
+ method public abstract void clearAnimationCallbacks();
+ method public abstract void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ method public abstract boolean unregisterAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ }
+
+ public static abstract class Animatable2.AnimationCallback {
+ ctor public Animatable2.AnimationCallback();
+ method public void onAnimationEnd(android.graphics.drawable.Drawable);
+ method public void onAnimationStart(android.graphics.drawable.Drawable);
+ }
+
public class AnimatedStateListDrawable extends android.graphics.drawable.StateListDrawable {
ctor public AnimatedStateListDrawable();
method public void addState(int[], android.graphics.drawable.Drawable, int);
method public void addTransition(int, int, T, boolean);
}
- public class AnimatedVectorDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable {
+ public class AnimatedVectorDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable2 {
ctor public AnimatedVectorDrawable();
- method public void addListener(android.animation.Animator.AnimatorListener);
+ method public void clearAnimationCallbacks();
method public void draw(android.graphics.Canvas);
- method public java.util.List<android.animation.Animator.AnimatorListener> getListeners();
method public int getOpacity();
method public boolean isRunning();
- method public void removeListener(android.animation.Animator.AnimatorListener);
+ method public void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ method public void reset();
method public void setAlpha(int);
method public void setColorFilter(android.graphics.ColorFilter);
method public void start();
method public void stop();
+ method public boolean unregisterAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
}
public class AnimationDrawable extends android.graphics.drawable.DrawableContainer implements android.graphics.drawable.Animatable java.lang.Runnable {
@@ -19697,12 +19726,9 @@ package android.nfc.cardemulation {
method public boolean supportsAidPrefixRegistration();
method public boolean unsetPreferredService(android.app.Activity);
field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
- field public static final java.lang.String ACTION_REQUEST_SERVICE_RESOURCES = "android.nfc.cardemulation.action.REQUEST_SERVICE_RESOURCES";
field public static final java.lang.String CATEGORY_OTHER = "other";
field public static final java.lang.String CATEGORY_PAYMENT = "payment";
- field public static final java.lang.String EXTRA_BANNER_RES_ID = "android.nfc.cardemulation.extra.BANNER_RES_ID";
field public static final java.lang.String EXTRA_CATEGORY = "category";
- field public static final java.lang.String EXTRA_DESCRIPTION = "android.nfc.cardemulation.extra.DESCRIPTION";
field public static final java.lang.String EXTRA_SERVICE_COMPONENT = "component";
field public static final int SELECTION_MODE_ALWAYS_ASK = 1; // 0x1
field public static final int SELECTION_MODE_ASK_IF_CONFLICT = 2; // 0x2
@@ -24476,10 +24502,10 @@ package android.provider {
public final class AlarmClock {
ctor public AlarmClock();
+ field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
field public static final java.lang.String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
field public static final java.lang.String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
- field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
field public static final java.lang.String ALARM_SEARCH_MODE_ALL = "android.all";
field public static final java.lang.String ALARM_SEARCH_MODE_LABEL = "android.label";
@@ -26907,8 +26933,7 @@ package android.provider {
public static final class Telephony.Carriers implements android.provider.BaseColumns {
field public static final java.lang.String APN = "apn";
field public static final java.lang.String AUTH_TYPE = "authtype";
- field public static final deprecated java.lang.String BEARER = "bearer";
- field public static final java.lang.String BEARER_BITMASK = "bearer_bitmask";
+ field public static final java.lang.String BEARER = "bearer";
field public static final java.lang.String CARRIER_ENABLED = "carrier_enabled";
field public static final android.net.Uri CONTENT_URI;
field public static final java.lang.String CURRENT = "current";
@@ -28975,7 +29000,8 @@ package android.service.voice {
}
public static final class VoiceInteractionSession.AbortVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getMessage();
+ method public deprecated java.lang.CharSequence getMessage();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendAbortResult(android.os.Bundle);
}
@@ -28986,12 +29012,14 @@ package android.service.voice {
}
public static final class VoiceInteractionSession.CompleteVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getMessage();
+ method public deprecated java.lang.CharSequence getMessage();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendCompleteResult(android.os.Bundle);
}
public static final class VoiceInteractionSession.ConfirmationRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getPrompt();
+ method public deprecated java.lang.CharSequence getPrompt();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendConfirmationResult(boolean, android.os.Bundle);
}
@@ -29007,7 +29035,8 @@ package android.service.voice {
public static final class VoiceInteractionSession.PickOptionRequest extends android.service.voice.VoiceInteractionSession.Request {
method public android.app.VoiceInteractor.PickOptionRequest.Option[] getOptions();
- method public java.lang.CharSequence getPrompt();
+ method public deprecated java.lang.CharSequence getPrompt();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendIntermediatePickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
method public void sendPickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
}
@@ -30644,66 +30673,66 @@ package android.telephony {
method public android.os.PersistableBundle getConfigForSubId(int);
method public void reloadCarrierConfigForSubId(int);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
- field public static final java.lang.String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting";
- field public static final java.lang.String BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log";
- field public static final java.lang.String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones";
- field public static final java.lang.String BOOL_APN_EXPAND = "bool_apn_expand";
- field public static final java.lang.String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled";
- field public static final java.lang.String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported";
- field public static final java.lang.String BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code";
- field public static final java.lang.String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled";
- field public static final java.lang.String BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration";
- field public static final java.lang.String BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression";
- field public static final java.lang.String BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings";
- field public static final java.lang.String BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events";
- field public static final java.lang.String BOOL_MMS_ALIAS_ENABLED = "aliasEnabled";
- field public static final java.lang.String BOOL_MMS_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
- field public static final java.lang.String BOOL_MMS_APPEND_TRANSACTION_ID = "enabledTransID";
- field public static final java.lang.String BOOL_MMS_GROUP_MMS_ENABLED = "enableGroupMms";
- field public static final java.lang.String BOOL_MMS_MMS_DELIVERY_REPORT_ENABLED = "enableMMSDeliveryReports";
- field public static final java.lang.String BOOL_MMS_MMS_ENABLED = "enabledMMS";
- field public static final java.lang.String BOOL_MMS_MMS_READ_REPORT_ENABLED = "enableMMSReadReports";
- field public static final java.lang.String BOOL_MMS_MULTIPART_SMS_ENABLED = "enableMultipartSMS";
- field public static final java.lang.String BOOL_MMS_NOTIFY_WAP_MMSC_ENABLED = "enabledNotifyWapMMSC";
- field public static final java.lang.String BOOL_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES = "sendMultipartSmsAsSeparateMessages";
- field public static final java.lang.String BOOL_MMS_SHOW_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
- field public static final java.lang.String BOOL_MMS_SMS_DELIVERY_REPORT_ENABLED = "enableSMSDeliveryReports";
- field public static final java.lang.String BOOL_MMS_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
- field public static final java.lang.String BOOL_MMS_SUPPORT_MMS_CONTENT_DISPOSITION = "supportMmsContentDisposition";
- field public static final java.lang.String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand";
- field public static final java.lang.String BOOL_PREFER_2G = "bool_prefer_2g";
- field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma";
- field public static final java.lang.String BOOL_SHOW_CDMA_CHOICES = "bool_show_cdma_choices";
- field public static final java.lang.String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button";
- field public static final java.lang.String BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss";
- field public static final java.lang.String BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls";
- field public static final java.lang.String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge";
- field public static final java.lang.String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning";
- field public static final java.lang.String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning";
- field public static final java.lang.String BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent";
- field public static final java.lang.String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable";
- field public static final java.lang.String BOOL_WORLD_PHONE = "bool_world_phone";
- field public static final java.lang.String INT_MMS_ALIAS_MAX_CHARS = "aliasMaxChars";
- field public static final java.lang.String INT_MMS_ALIAS_MIN_CHARS = "aliasMinChars";
- field public static final java.lang.String INT_MMS_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
- field public static final java.lang.String INT_MMS_MAX_IMAGE_HEIGHT = "maxImageHeight";
- field public static final java.lang.String INT_MMS_MAX_IMAGE_WIDTH = "maxImageWidth";
- field public static final java.lang.String INT_MMS_MAX_MESSAGE_SIZE = "maxMessageSize";
- field public static final java.lang.String INT_MMS_MESSAGE_TEXT_MAX_SIZE = "maxMessageTextSize";
- field public static final java.lang.String INT_MMS_RECIPIENT_LIMIT = "recipientLimit";
- field public static final java.lang.String INT_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD = "smsToMmsTextLengthThreshold";
- field public static final java.lang.String INT_MMS_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
- field public static final java.lang.String INT_MMS_SUBJECT_MAX_LENGTH = "maxSubjectLength";
- field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat";
- field public static final java.lang.String STRING_MMS_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
- field public static final java.lang.String STRING_MMS_HTTP_PARAMS = "httpParams";
- field public static final java.lang.String STRING_MMS_NAI_SUFFIX = "naiSuffix";
- field public static final java.lang.String STRING_MMS_UA_PROF_TAG_NAME = "uaProfTagName";
- field public static final java.lang.String STRING_MMS_UA_PROF_URL = "uaProfUrl";
- field public static final java.lang.String STRING_MMS_USER_AGENT = "userAgent";
+ field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
+ field public static final java.lang.String KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL = "allow_emergency_numbers_in_call_log_bool";
+ field public static final java.lang.String KEY_ALLOW_LOCAL_DTMF_TONES_BOOL = "allow_local_dtmf_tones_bool";
+ field public static final java.lang.String KEY_APN_EXPAND_BOOL = "apn_expand_bool";
+ field public static final java.lang.String KEY_AUTO_RETRY_ENABLED_BOOL = "auto_retry_enabled_bool";
+ field public static final java.lang.String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";
+ 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_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_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";
+ field public static final java.lang.String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
+ field public static final java.lang.String KEY_MMS_ALIAS_MAX_CHARS_INT = "aliasMaxChars";
+ field public static final java.lang.String KEY_MMS_ALIAS_MIN_CHARS_INT = "aliasMinChars";
+ field public static final java.lang.String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
+ field public static final java.lang.String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
+ field public static final java.lang.String KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING = "emailGatewayNumber";
+ field public static final java.lang.String KEY_MMS_GROUP_MMS_ENABLED_BOOL = "enableGroupMms";
+ field public static final java.lang.String KEY_MMS_HTTP_PARAMS_STRING = "httpParams";
+ field public static final java.lang.String KEY_MMS_HTTP_SOCKET_TIMEOUT_INT = "httpSocketTimeout";
+ field public static final java.lang.String KEY_MMS_MAX_IMAGE_HEIGHT_INT = "maxImageHeight";
+ field public static final java.lang.String KEY_MMS_MAX_IMAGE_WIDTH_INT = "maxImageWidth";
+ field public static final java.lang.String KEY_MMS_MAX_MESSAGE_SIZE_INT = "maxMessageSize";
+ field public static final java.lang.String KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT = "maxMessageTextSize";
+ field public static final java.lang.String KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL = "enableMMSDeliveryReports";
+ field public static final java.lang.String KEY_MMS_MMS_ENABLED_BOOL = "enabledMMS";
+ field public static final java.lang.String KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL = "enableMMSReadReports";
+ field public static final java.lang.String KEY_MMS_MULTIPART_SMS_ENABLED_BOOL = "enableMultipartSMS";
+ field public static final java.lang.String KEY_MMS_NAI_SUFFIX_STRING = "naiSuffix";
+ field public static final java.lang.String KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL = "enabledNotifyWapMMSC";
+ field public static final java.lang.String KEY_MMS_RECIPIENT_LIMIT_INT = "recipientLimit";
+ field public static final java.lang.String KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL = "sendMultipartSmsAsSeparateMessages";
+ field public static final java.lang.String KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL = "config_cellBroadcastAppLinks";
+ field public static final java.lang.String KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL = "enableSMSDeliveryReports";
+ field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT = "smsToMmsTextLengthThreshold";
+ field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT = "smsToMmsTextThreshold";
+ field public static final java.lang.String KEY_MMS_SUBJECT_MAX_LENGTH_INT = "maxSubjectLength";
+ field public static final java.lang.String KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL = "supportHttpCharsetHeader";
+ field public static final java.lang.String KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL = "supportMmsContentDisposition";
+ field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
+ field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
+ field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
+ field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
+ field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
+ field public static final java.lang.String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
+ field public static final java.lang.String KEY_SHOW_CDMA_CHOICES_BOOL = "show_cdma_choices_bool";
+ field public static final java.lang.String KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL = "show_onscreen_dial_button_bool";
+ field public static final java.lang.String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
+ field public static final java.lang.String KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
+ field public static final java.lang.String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
+ field public static final java.lang.String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
+ field public static final java.lang.String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
+ field public static final java.lang.String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
+ field public static final java.lang.String KEY_VOICE_PRIVACY_DISABLE_BOOL = "voice_privacy_disable_bool";
+ field public static final java.lang.String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";
+ field public static final java.lang.String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
}
public final class CellIdentityCdma implements android.os.Parcelable {
@@ -35986,7 +36015,6 @@ package android.view {
method public android.view.animation.Animation getAnimation();
method public android.os.IBinder getApplicationWindowToken();
method public android.graphics.drawable.Drawable getBackground();
- method public int getBackgroundColor();
method public android.content.res.ColorStateList getBackgroundTintList();
method public android.graphics.PorterDuff.Mode getBackgroundTintMode();
method public int getBaseline();
diff --git a/api/system-current.txt b/api/system-current.txt
index 84d6cd8..6d55448 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -294,6 +294,7 @@ package android {
public static final class R.attr {
ctor public R.attr();
field public static final int __reserved0 = 16844020; // 0x10104f4
+ field public static final int __reserved1 = 16844019; // 0x10104f3
field public static final int absListViewStyle = 16842858; // 0x101006a
field public static final int accessibilityEventTypes = 16843648; // 0x1010380
field public static final int accessibilityFeedbackType = 16843650; // 0x1010382
@@ -582,7 +583,6 @@ package android {
field public static final int dropDownWidth = 16843362; // 0x1010262
field public static final int duplicateParentState = 16842985; // 0x10100e9
field public static final int duration = 16843160; // 0x1010198
- field public static final int dynamicResources = 16844019; // 0x10104f3
field public static final int editTextBackground = 16843602; // 0x1010352
field public static final int editTextColor = 16843601; // 0x1010351
field public static final int editTextPreferenceStyle = 16842898; // 0x1010092
@@ -4096,6 +4096,7 @@ package android.app {
ctor public AssistContent();
method public android.content.ClipData getClipData();
method public android.net.Uri getWebUri();
+ method public boolean isAppProvidedIntent();
method public void setClipData(android.content.ClipData);
method public void setIntent(android.content.Intent);
method public void setWebUri(android.net.Uri);
@@ -5594,7 +5595,8 @@ package android.app {
}
public static class VoiceInteractor.AbortVoiceRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.AbortVoiceRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.AbortVoiceRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.AbortVoiceRequest(java.lang.CharSequence, android.os.Bundle);
method public void onAbortResult(android.os.Bundle);
}
@@ -5604,17 +5606,20 @@ package android.app {
}
public static class VoiceInteractor.CompleteVoiceRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.CompleteVoiceRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.CompleteVoiceRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.CompleteVoiceRequest(java.lang.CharSequence, android.os.Bundle);
method public void onCompleteResult(android.os.Bundle);
}
public static class VoiceInteractor.ConfirmationRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle);
+ ctor public VoiceInteractor.ConfirmationRequest(android.app.VoiceInteractor.Prompt, android.os.Bundle);
+ ctor public deprecated VoiceInteractor.ConfirmationRequest(java.lang.CharSequence, android.os.Bundle);
method public void onConfirmationResult(boolean, android.os.Bundle);
}
public static class VoiceInteractor.PickOptionRequest extends android.app.VoiceInteractor.Request {
- ctor public VoiceInteractor.PickOptionRequest(java.lang.CharSequence, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
+ ctor public VoiceInteractor.PickOptionRequest(android.app.VoiceInteractor.Prompt, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
+ ctor public deprecated VoiceInteractor.PickOptionRequest(java.lang.CharSequence, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
method public void onPickOptionResult(boolean, android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
}
@@ -5633,6 +5638,17 @@ package android.app {
field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.PickOptionRequest.Option> CREATOR;
}
+ public static class VoiceInteractor.Prompt implements android.os.Parcelable {
+ ctor public VoiceInteractor.Prompt(java.lang.CharSequence[], java.lang.CharSequence);
+ ctor public VoiceInteractor.Prompt(java.lang.CharSequence);
+ method public int countVoicePrompts();
+ method public int describeContents();
+ method public java.lang.CharSequence getVisualPrompt();
+ method public java.lang.CharSequence getVoicePromptAt(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.app.VoiceInteractor.Prompt> CREATOR;
+ }
+
public static abstract class VoiceInteractor.Request {
method public void cancel();
method public android.app.Activity getActivity();
@@ -12479,24 +12495,37 @@ package android.graphics.drawable {
method public abstract void stop();
}
+ public abstract interface Animatable2 implements android.graphics.drawable.Animatable {
+ method public abstract void clearAnimationCallbacks();
+ method public abstract void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ method public abstract boolean unregisterAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ }
+
+ public static abstract class Animatable2.AnimationCallback {
+ ctor public Animatable2.AnimationCallback();
+ method public void onAnimationEnd(android.graphics.drawable.Drawable);
+ method public void onAnimationStart(android.graphics.drawable.Drawable);
+ }
+
public class AnimatedStateListDrawable extends android.graphics.drawable.StateListDrawable {
ctor public AnimatedStateListDrawable();
method public void addState(int[], android.graphics.drawable.Drawable, int);
method public void addTransition(int, int, T, boolean);
}
- public class AnimatedVectorDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable {
+ public class AnimatedVectorDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable2 {
ctor public AnimatedVectorDrawable();
- method public void addListener(android.animation.Animator.AnimatorListener);
+ method public void clearAnimationCallbacks();
method public void draw(android.graphics.Canvas);
- method public java.util.List<android.animation.Animator.AnimatorListener> getListeners();
method public int getOpacity();
method public boolean isRunning();
- method public void removeListener(android.animation.Animator.AnimatorListener);
+ method public void registerAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
+ method public void reset();
method public void setAlpha(int);
method public void setColorFilter(android.graphics.ColorFilter);
method public void start();
method public void stop();
+ method public boolean unregisterAnimationCallback(android.graphics.drawable.Animatable2.AnimationCallback);
}
public class AnimationDrawable extends android.graphics.drawable.DrawableContainer implements android.graphics.drawable.Animatable java.lang.Runnable {
@@ -21615,12 +21644,9 @@ package android.nfc.cardemulation {
method public boolean supportsAidPrefixRegistration();
method public boolean unsetPreferredService(android.app.Activity);
field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
- field public static final java.lang.String ACTION_REQUEST_SERVICE_RESOURCES = "android.nfc.cardemulation.action.REQUEST_SERVICE_RESOURCES";
field public static final java.lang.String CATEGORY_OTHER = "other";
field public static final java.lang.String CATEGORY_PAYMENT = "payment";
- field public static final java.lang.String EXTRA_BANNER_RES_ID = "android.nfc.cardemulation.extra.BANNER_RES_ID";
field public static final java.lang.String EXTRA_CATEGORY = "category";
- field public static final java.lang.String EXTRA_DESCRIPTION = "android.nfc.cardemulation.extra.DESCRIPTION";
field public static final java.lang.String EXTRA_SERVICE_COMPONENT = "component";
field public static final int SELECTION_MODE_ALWAYS_ASK = 1; // 0x1
field public static final int SELECTION_MODE_ASK_IF_CONFLICT = 2; // 0x2
@@ -26406,10 +26432,10 @@ package android.provider {
public final class AlarmClock {
ctor public AlarmClock();
+ field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
field public static final java.lang.String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
field public static final java.lang.String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
- field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
field public static final java.lang.String ALARM_SEARCH_MODE_ALL = "android.all";
field public static final java.lang.String ALARM_SEARCH_MODE_LABEL = "android.label";
@@ -28940,8 +28966,7 @@ package android.provider {
public static final class Telephony.Carriers implements android.provider.BaseColumns {
field public static final java.lang.String APN = "apn";
field public static final java.lang.String AUTH_TYPE = "authtype";
- field public static final deprecated java.lang.String BEARER = "bearer";
- field public static final java.lang.String BEARER_BITMASK = "bearer_bitmask";
+ field public static final java.lang.String BEARER = "bearer";
field public static final java.lang.String CARRIER_ENABLED = "carrier_enabled";
field public static final android.net.Uri CONTENT_URI;
field public static final java.lang.String CURRENT = "current";
@@ -31108,7 +31133,8 @@ package android.service.voice {
}
public static final class VoiceInteractionSession.AbortVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getMessage();
+ method public deprecated java.lang.CharSequence getMessage();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendAbortResult(android.os.Bundle);
}
@@ -31119,12 +31145,14 @@ package android.service.voice {
}
public static final class VoiceInteractionSession.CompleteVoiceRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getMessage();
+ method public deprecated java.lang.CharSequence getMessage();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendCompleteResult(android.os.Bundle);
}
public static final class VoiceInteractionSession.ConfirmationRequest extends android.service.voice.VoiceInteractionSession.Request {
- method public java.lang.CharSequence getPrompt();
+ method public deprecated java.lang.CharSequence getPrompt();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendConfirmationResult(boolean, android.os.Bundle);
}
@@ -31140,7 +31168,8 @@ package android.service.voice {
public static final class VoiceInteractionSession.PickOptionRequest extends android.service.voice.VoiceInteractionSession.Request {
method public android.app.VoiceInteractor.PickOptionRequest.Option[] getOptions();
- method public java.lang.CharSequence getPrompt();
+ method public deprecated java.lang.CharSequence getPrompt();
+ method public android.app.VoiceInteractor.Prompt getVoicePrompt();
method public void sendIntermediatePickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
method public void sendPickOptionResult(android.app.VoiceInteractor.PickOptionRequest.Option[], android.os.Bundle);
}
@@ -32860,66 +32889,66 @@ package android.telephony {
method public void reloadCarrierConfigForSubId(int);
method public void updateConfigForPhoneId(int, java.lang.String);
field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";
- field public static final java.lang.String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting";
- field public static final java.lang.String BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log";
- field public static final java.lang.String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones";
- field public static final java.lang.String BOOL_APN_EXPAND = "bool_apn_expand";
- field public static final java.lang.String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled";
- field public static final java.lang.String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned";
- field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported";
- field public static final java.lang.String BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code";
- field public static final java.lang.String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled";
- field public static final java.lang.String BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration";
- field public static final java.lang.String BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression";
- field public static final java.lang.String BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings";
- field public static final java.lang.String BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events";
- field public static final java.lang.String BOOL_MMS_ALIAS_ENABLED = "aliasEnabled";
- field public static final java.lang.String BOOL_MMS_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
- field public static final java.lang.String BOOL_MMS_APPEND_TRANSACTION_ID = "enabledTransID";
- field public static final java.lang.String BOOL_MMS_GROUP_MMS_ENABLED = "enableGroupMms";
- field public static final java.lang.String BOOL_MMS_MMS_DELIVERY_REPORT_ENABLED = "enableMMSDeliveryReports";
- field public static final java.lang.String BOOL_MMS_MMS_ENABLED = "enabledMMS";
- field public static final java.lang.String BOOL_MMS_MMS_READ_REPORT_ENABLED = "enableMMSReadReports";
- field public static final java.lang.String BOOL_MMS_MULTIPART_SMS_ENABLED = "enableMultipartSMS";
- field public static final java.lang.String BOOL_MMS_NOTIFY_WAP_MMSC_ENABLED = "enabledNotifyWapMMSC";
- field public static final java.lang.String BOOL_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES = "sendMultipartSmsAsSeparateMessages";
- field public static final java.lang.String BOOL_MMS_SHOW_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
- field public static final java.lang.String BOOL_MMS_SMS_DELIVERY_REPORT_ENABLED = "enableSMSDeliveryReports";
- field public static final java.lang.String BOOL_MMS_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
- field public static final java.lang.String BOOL_MMS_SUPPORT_MMS_CONTENT_DISPOSITION = "supportMmsContentDisposition";
- field public static final java.lang.String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand";
- field public static final java.lang.String BOOL_PREFER_2G = "bool_prefer_2g";
- field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma";
- field public static final java.lang.String BOOL_SHOW_CDMA_CHOICES = "bool_show_cdma_choices";
- field public static final java.lang.String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button";
- field public static final java.lang.String BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss";
- field public static final java.lang.String BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls";
- field public static final java.lang.String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge";
- field public static final java.lang.String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning";
- field public static final java.lang.String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning";
- field public static final java.lang.String BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent";
- field public static final java.lang.String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable";
- field public static final java.lang.String BOOL_WORLD_PHONE = "bool_world_phone";
- field public static final java.lang.String INT_MMS_ALIAS_MAX_CHARS = "aliasMaxChars";
- field public static final java.lang.String INT_MMS_ALIAS_MIN_CHARS = "aliasMinChars";
- field public static final java.lang.String INT_MMS_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
- field public static final java.lang.String INT_MMS_MAX_IMAGE_HEIGHT = "maxImageHeight";
- field public static final java.lang.String INT_MMS_MAX_IMAGE_WIDTH = "maxImageWidth";
- field public static final java.lang.String INT_MMS_MAX_MESSAGE_SIZE = "maxMessageSize";
- field public static final java.lang.String INT_MMS_MESSAGE_TEXT_MAX_SIZE = "maxMessageTextSize";
- field public static final java.lang.String INT_MMS_RECIPIENT_LIMIT = "recipientLimit";
- field public static final java.lang.String INT_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD = "smsToMmsTextLengthThreshold";
- field public static final java.lang.String INT_MMS_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
- field public static final java.lang.String INT_MMS_SUBJECT_MAX_LENGTH = "maxSubjectLength";
- field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat";
- field public static final java.lang.String STRING_MMS_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
- field public static final java.lang.String STRING_MMS_HTTP_PARAMS = "httpParams";
- field public static final java.lang.String STRING_MMS_NAI_SUFFIX = "naiSuffix";
- field public static final java.lang.String STRING_MMS_UA_PROF_TAG_NAME = "uaProfTagName";
- field public static final java.lang.String STRING_MMS_UA_PROF_URL = "uaProfUrl";
- field public static final java.lang.String STRING_MMS_USER_AGENT = "userAgent";
+ field public static final java.lang.String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
+ field public static final java.lang.String KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL = "allow_emergency_numbers_in_call_log_bool";
+ field public static final java.lang.String KEY_ALLOW_LOCAL_DTMF_TONES_BOOL = "allow_local_dtmf_tones_bool";
+ field public static final java.lang.String KEY_APN_EXPAND_BOOL = "apn_expand_bool";
+ field public static final java.lang.String KEY_AUTO_RETRY_ENABLED_BOOL = "auto_retry_enabled_bool";
+ field public static final java.lang.String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";
+ 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_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_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";
+ field public static final java.lang.String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
+ field public static final java.lang.String KEY_MMS_ALIAS_MAX_CHARS_INT = "aliasMaxChars";
+ field public static final java.lang.String KEY_MMS_ALIAS_MIN_CHARS_INT = "aliasMinChars";
+ field public static final java.lang.String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
+ field public static final java.lang.String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
+ field public static final java.lang.String KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING = "emailGatewayNumber";
+ field public static final java.lang.String KEY_MMS_GROUP_MMS_ENABLED_BOOL = "enableGroupMms";
+ field public static final java.lang.String KEY_MMS_HTTP_PARAMS_STRING = "httpParams";
+ field public static final java.lang.String KEY_MMS_HTTP_SOCKET_TIMEOUT_INT = "httpSocketTimeout";
+ field public static final java.lang.String KEY_MMS_MAX_IMAGE_HEIGHT_INT = "maxImageHeight";
+ field public static final java.lang.String KEY_MMS_MAX_IMAGE_WIDTH_INT = "maxImageWidth";
+ field public static final java.lang.String KEY_MMS_MAX_MESSAGE_SIZE_INT = "maxMessageSize";
+ field public static final java.lang.String KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT = "maxMessageTextSize";
+ field public static final java.lang.String KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL = "enableMMSDeliveryReports";
+ field public static final java.lang.String KEY_MMS_MMS_ENABLED_BOOL = "enabledMMS";
+ field public static final java.lang.String KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL = "enableMMSReadReports";
+ field public static final java.lang.String KEY_MMS_MULTIPART_SMS_ENABLED_BOOL = "enableMultipartSMS";
+ field public static final java.lang.String KEY_MMS_NAI_SUFFIX_STRING = "naiSuffix";
+ field public static final java.lang.String KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL = "enabledNotifyWapMMSC";
+ field public static final java.lang.String KEY_MMS_RECIPIENT_LIMIT_INT = "recipientLimit";
+ field public static final java.lang.String KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL = "sendMultipartSmsAsSeparateMessages";
+ field public static final java.lang.String KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL = "config_cellBroadcastAppLinks";
+ field public static final java.lang.String KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL = "enableSMSDeliveryReports";
+ field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT = "smsToMmsTextLengthThreshold";
+ field public static final java.lang.String KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT = "smsToMmsTextThreshold";
+ field public static final java.lang.String KEY_MMS_SUBJECT_MAX_LENGTH_INT = "maxSubjectLength";
+ field public static final java.lang.String KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL = "supportHttpCharsetHeader";
+ field public static final java.lang.String KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL = "supportMmsContentDisposition";
+ field public static final java.lang.String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
+ field public static final java.lang.String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
+ field public static final java.lang.String KEY_MMS_USER_AGENT_STRING = "userAgent";
+ field public static final java.lang.String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
+ field public static final java.lang.String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
+ field public static final java.lang.String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
+ field public static final java.lang.String KEY_SHOW_CDMA_CHOICES_BOOL = "show_cdma_choices_bool";
+ field public static final java.lang.String KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL = "show_onscreen_dial_button_bool";
+ field public static final java.lang.String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
+ field public static final java.lang.String KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
+ field public static final java.lang.String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
+ field public static final java.lang.String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
+ field public static final java.lang.String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
+ field public static final java.lang.String KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
+ field public static final java.lang.String KEY_VOICE_PRIVACY_DISABLE_BOOL = "voice_privacy_disable_bool";
+ field public static final java.lang.String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";
+ field public static final java.lang.String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
}
public final class CellIdentityCdma implements android.os.Parcelable {
@@ -38251,7 +38280,6 @@ package android.view {
method public android.view.animation.Animation getAnimation();
method public android.os.IBinder getApplicationWindowToken();
method public android.graphics.drawable.Drawable getBackground();
- method public int getBackgroundColor();
method public android.content.res.ColorStateList getBackgroundTintList();
method public android.graphics.PorterDuff.Mode getBackgroundTintMode();
method public int getBaseline();
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 808e124..b0a7dc7 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -31,6 +31,7 @@ import android.app.UiAutomationConnection;
import android.app.usage.ConfigurationStats;
import android.app.usage.IUsageStatsManager;
import android.app.usage.UsageStatsManager;
+import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.Context;
import android.content.IIntentReceiver;
@@ -144,6 +145,8 @@ public class Am extends BaseCommand {
" am get-config\n" +
" am set-inactive [--user <USER_ID>] <PACKAGE> true|false\n" +
" am get-inactive [--user <USER_ID>] <PACKAGE>\n" +
+ " am send-trim-memory [--user <USER_ID>] <PROCESS>\n" +
+ " [HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|RUNNING_CRITICAL|COMPLETE]\n" +
"\n" +
"am start: start an Activity. Options are:\n" +
" -D: enable debugging\n" +
@@ -271,9 +274,9 @@ public class Am extends BaseCommand {
"\n" +
"am stack info: display the information about activity stack <STACK_ID>.\n" +
"\n" +
- "am task lock: bring <TASK_ID> to the front and don't allow other tasks to run\n" +
+ "am task lock: bring <TASK_ID> to the front and don't allow other tasks to run.\n" +
"\n" +
- "am task lock stop: end the current task lock\n" +
+ "am task lock stop: end the current task lock.\n" +
"\n" +
"am task resizeable: change if <TASK_ID> is resizeable (true) or not (false).\n" +
"\n" +
@@ -282,12 +285,13 @@ public class Am extends BaseCommand {
" has the specified bounds.\n" +
"\n" +
"am get-config: retrieve the configuration and any recent configurations\n" +
- " of the device\n" +
+ " of the device.\n" +
"\n" +
- "am set-inactive: sets the inactive state of an app\n" +
+ "am set-inactive: sets the inactive state of an app.\n" +
"\n" +
- "am get-inactive: returns the inactive state of an app\n" +
+ "am get-inactive: returns the inactive state of an app.\n" +
"\n" +
+ " am send-trim-memory: Send a memory trim event to a <PROCESS>.\n" +
"\n" +
"<INTENT> specifications include these flags and arguments:\n" +
" [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]\n" +
@@ -399,6 +403,8 @@ public class Am extends BaseCommand {
runSetInactive();
} else if (op.equals("get-inactive")) {
runGetInactive();
+ } else if (op.equals("send-trim-memory")) {
+ runSendTrimMemory();
} else {
showError("Error: unknown command '" + op + "'");
}
@@ -2070,6 +2076,57 @@ public class Am extends BaseCommand {
System.out.println("Idle=" + isIdle);
}
+ private void runSendTrimMemory() throws Exception {
+ int userId = UserHandle.USER_CURRENT;
+ String opt;
+ while ((opt = nextOption()) != null) {
+ if (opt.equals("--user")) {
+ userId = parseUserArg(nextArgRequired());
+ if (userId == UserHandle.USER_ALL) {
+ System.err.println("Error: Can't use user 'all'");
+ return;
+ }
+ } else {
+ System.err.println("Error: Unknown option: " + opt);
+ return;
+ }
+ }
+
+ String proc = nextArgRequired();
+ String levelArg = nextArgRequired();
+ int level;
+ switch (levelArg) {
+ case "HIDDEN":
+ level = ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN;
+ break;
+ case "RUNNING_MODERATE":
+ level = ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE;
+ break;
+ case "BACKGROUND":
+ level = ComponentCallbacks2.TRIM_MEMORY_BACKGROUND;
+ break;
+ case "RUNNING_LOW":
+ level = ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW;
+ break;
+ case "MODERATE":
+ level = ComponentCallbacks2.TRIM_MEMORY_MODERATE;
+ break;
+ case "RUNNING_CRITICAL":
+ level = ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL;
+ break;
+ case "COMPLETE":
+ level = ComponentCallbacks2.TRIM_MEMORY_COMPLETE;
+ break;
+ default:
+ System.err.println("Error: Unknown level option: " + levelArg);
+ return;
+ }
+ if (!mAm.setProcessMemoryTrimLevel(proc, userId, level)) {
+ System.err.println("Error: Failure to set the level - probably Unknown Process: " +
+ proc);
+ }
+ }
+
/**
* Open the given file for sending into the system process. This verifies
* with SELinux that the system will have access to the file.
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index edebc28..3892dd9 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -462,7 +462,7 @@ public class ActivityManager {
public int getMemoryClass() {
return staticGetMemoryClass();
}
-
+
/** @hide */
static public int staticGetMemoryClass() {
// Really brain dead right now -- just take this from the configured
@@ -473,7 +473,7 @@ public class ActivityManager {
}
return staticGetLargeMemoryClass();
}
-
+
/**
* Return the approximate per-application memory class of the current
* device when an application is running with a large heap. This is the
@@ -490,7 +490,7 @@ public class ActivityManager {
public int getLargeMemoryClass() {
return staticGetLargeMemoryClass();
}
-
+
/** @hide */
static public int staticGetLargeMemoryClass() {
// Really brain dead right now -- just take this from the configured
@@ -809,7 +809,7 @@ public class ActivityManager {
* The true identifier of this task, valid even if it is not running.
*/
public int persistentId;
-
+
/**
* The original Intent used to launch the task. You can use this
* Intent to re-launch the task (if it is no longer running) or bring
@@ -1014,7 +1014,7 @@ public class ActivityManager {
* user has started and the maximum number the system can remember.
* @param flags Information about what to return. May be any combination
* of {@link #RECENT_WITH_EXCLUDED} and {@link #RECENT_IGNORE_UNAVAILABLE}.
- *
+ *
* @return Returns a list of RecentTaskInfo records describing each of
* the recent tasks.
*/
@@ -1146,7 +1146,7 @@ public class ActivityManager {
numActivities = source.readInt();
numRunning = source.readInt();
}
-
+
public static final Creator<RunningTaskInfo> CREATOR = new Creator<RunningTaskInfo>() {
public RunningTaskInfo createFromParcel(Parcel source) {
return new RunningTaskInfo(source);
@@ -1469,100 +1469,100 @@ public class ActivityManager {
* If non-zero, this is the process the service is running in.
*/
public int pid;
-
+
/**
* The UID that owns this service.
*/
public int uid;
-
+
/**
* The name of the process this service runs in.
*/
public String process;
-
+
/**
* Set to true if the service has asked to run as a foreground process.
*/
public boolean foreground;
-
+
/**
* The time when the service was first made active, either by someone
* starting or binding to it. This
* is in units of {@link android.os.SystemClock#elapsedRealtime()}.
*/
public long activeSince;
-
+
/**
* Set to true if this service has been explicitly started.
*/
public boolean started;
-
+
/**
* Number of clients connected to the service.
*/
public int clientCount;
-
+
/**
* Number of times the service's process has crashed while the service
* is running.
*/
public int crashCount;
-
+
/**
* The time when there was last activity in the service (either
* explicit requests to start it or clients binding to it). This
* is in units of {@link android.os.SystemClock#uptimeMillis()}.
*/
public long lastActivityTime;
-
+
/**
* If non-zero, this service is not currently running, but scheduled to
* restart at the given time.
*/
public long restarting;
-
+
/**
* Bit for {@link #flags}: set if this service has been
* explicitly started.
*/
public static final int FLAG_STARTED = 1<<0;
-
+
/**
* Bit for {@link #flags}: set if the service has asked to
* run as a foreground process.
*/
public static final int FLAG_FOREGROUND = 1<<1;
-
+
/**
* Bit for {@link #flags): set if the service is running in a
* core system process.
*/
public static final int FLAG_SYSTEM_PROCESS = 1<<2;
-
+
/**
* Bit for {@link #flags): set if the service is running in a
* persistent process.
*/
public static final int FLAG_PERSISTENT_PROCESS = 1<<3;
-
+
/**
* Running flags.
*/
public int flags;
-
+
/**
* For special services that are bound to by system code, this is
* the package that holds the binding.
*/
public String clientPackage;
-
+
/**
* For special services that are bound to by system code, this is
* a string resource providing a user-visible label for who the
* client is.
*/
public int clientLabel;
-
+
public RunningServiceInfo() {
}
@@ -1603,7 +1603,7 @@ public class ActivityManager {
clientPackage = source.readString();
clientLabel = source.readInt();
}
-
+
public static final Creator<RunningServiceInfo> CREATOR = new Creator<RunningServiceInfo>() {
public RunningServiceInfo createFromParcel(Parcel source) {
return new RunningServiceInfo(source);
@@ -1627,7 +1627,7 @@ public class ActivityManager {
* @param maxNum The maximum number of entries to return in the list. The
* actual number returned may be smaller, depending on how many services
* are running.
- *
+ *
* @return Returns a list of RunningServiceInfo records describing each of
* the running tasks.
*/
@@ -1641,7 +1641,7 @@ public class ActivityManager {
return null;
}
}
-
+
/**
* Returns a PendingIntent you can start to show a control panel for the
* given running service. If the service does not have a control panel,
@@ -1657,7 +1657,7 @@ public class ActivityManager {
return null;
}
}
-
+
/**
* Information you can retrieve about the available memory through
* {@link ActivityManager#getMemoryInfo}.
@@ -1684,7 +1684,7 @@ public class ActivityManager {
* processes.
*/
public long threshold;
-
+
/**
* Set to true if the system considers itself to currently be in a low
* memory situation.
@@ -1717,7 +1717,7 @@ public class ActivityManager {
dest.writeLong(visibleAppThreshold);
dest.writeLong(foregroundAppThreshold);
}
-
+
public void readFromParcel(Parcel source) {
availMem = source.readLong();
totalMem = source.readLong();
@@ -1841,7 +1841,7 @@ public class ActivityManager {
*/
public boolean clearApplicationUserData(String packageName, IPackageDataObserver observer) {
try {
- return ActivityManagerNative.getDefault().clearApplicationUserData(packageName,
+ return ActivityManagerNative.getDefault().clearApplicationUserData(packageName,
observer, UserHandle.myUserId());
} catch (RemoteException e) {
return false;
@@ -1882,7 +1882,7 @@ public class ActivityManager {
* The process name in which the crash or error occurred.
*/
public String processName;
-
+
/**
* The pid of this process; 0 if none
*/
@@ -1894,7 +1894,7 @@ public class ActivityManager {
* the same uid).
*/
public int uid;
-
+
/**
* The activity name associated with the error, if known. May be null.
*/
@@ -1950,8 +1950,8 @@ public class ActivityManager {
longMsg = source.readString();
stackTrace = source.readString();
}
-
- public static final Creator<ProcessErrorStateInfo> CREATOR =
+
+ public static final Creator<ProcessErrorStateInfo> CREATOR =
new Creator<ProcessErrorStateInfo>() {
public ProcessErrorStateInfo createFromParcel(Parcel source) {
return new ProcessErrorStateInfo(source);
@@ -1965,11 +1965,11 @@ public class ActivityManager {
readFromParcel(source);
}
}
-
+
/**
- * Returns a list of any processes that are currently in an error condition. The result
+ * Returns a list of any processes that are currently in an error condition. The result
* will be null if all processes are running properly at this time.
- *
+ *
* @return Returns a list of ProcessErrorStateInfo records, or null if there are no
* current error conditions (it will not return an empty list). This list ordering is not
* specified.
@@ -1985,7 +1985,7 @@ public class ActivityManager {
/**
* Information you can retrieve about a running process.
*/
- public static class RunningAppProcessInfo implements Parcelable {
+ public static class RunningAppProcessInfo implements Parcelable {
/**
* The name of the process that this object is associated with
*/
@@ -1995,17 +1995,17 @@ public class ActivityManager {
* The pid of this process; 0 if none
*/
public int pid;
-
+
/**
* The user id of this process.
*/
public int uid;
-
+
/**
* All packages that have been loaded into the process.
*/
public String pkgList[];
-
+
/**
* Constant for {@link #flags}: this is an app that is unable to
* correctly save its state when going to the background,
@@ -2013,7 +2013,7 @@ public class ActivityManager {
* @hide
*/
public static final int FLAG_CANT_SAVE_STATE = 1<<0;
-
+
/**
* Constant for {@link #flags}: this process is associated with a
* persistent system app.
@@ -2048,7 +2048,7 @@ public class ActivityManager {
* that the user is interacting with.
*/
public static final int IMPORTANCE_FOREGROUND = 100;
-
+
/**
* Constant for {@link #importance}: This process is running a foreground
* service, for example to perform music playback even while the user is
@@ -2075,13 +2075,13 @@ public class ActivityManager {
* other services under the system's control that it inconsiders important.
*/
public static final int IMPORTANCE_VISIBLE = 200;
-
+
/**
* Constant for {@link #importance}: This process is not something the user
* is directly aware of, but is otherwise perceptable to them to some degree.
*/
public static final int IMPORTANCE_PERCEPTIBLE = 130;
-
+
/**
* Constant for {@link #importance}: This process is running an
* application that can not save its state, and thus can't be killed
@@ -2089,7 +2089,7 @@ public class ActivityManager {
* @hide
*/
public static final int IMPORTANCE_CANT_SAVE_STATE = 170;
-
+
/**
* Constant for {@link #importance}: This process is contains services
* that should remain running. These are background services apps have
@@ -2098,13 +2098,13 @@ public class ActivityManager {
* stay running as long as they want to).
*/
public static final int IMPORTANCE_SERVICE = 300;
-
+
/**
* Constant for {@link #importance}: This process process contains
* background code that is expendable.
*/
public static final int IMPORTANCE_BACKGROUND = 400;
-
+
/**
* Constant for {@link #importance}: This process is empty of any
* actively running code.
@@ -2148,7 +2148,7 @@ public class ActivityManager {
* smaller than "less important" values.
*/
public int importance;
-
+
/**
* An additional ordering within a particular {@link #importance}
* category, providing finer-grained information about the relative
@@ -2165,7 +2165,7 @@ public class ActivityManager {
* been specified for the reason for this level.
*/
public static final int REASON_UNKNOWN = 0;
-
+
/**
* Constant for {@link #importanceReasonCode}: one of the application's
* content providers is being used by another process. The pid of
@@ -2174,7 +2174,7 @@ public class ActivityManager {
* {@link #importanceReasonComponent}.
*/
public static final int REASON_PROVIDER_IN_USE = 1;
-
+
/**
* Constant for {@link #importanceReasonCode}: one of the application's
* content providers is being used by another process. The pid of
@@ -2183,25 +2183,25 @@ public class ActivityManager {
* {@link #importanceReasonComponent}.
*/
public static final int REASON_SERVICE_IN_USE = 2;
-
+
/**
* The reason for {@link #importance}, if any.
*/
public int importanceReasonCode;
-
+
/**
* For the specified values of {@link #importanceReasonCode}, this
* is the process ID of the other process that is a client of this
* process. This will be 0 if no other process is using this one.
*/
public int importanceReasonPid;
-
+
/**
* For the specified values of {@link #importanceReasonCode}, this
* is the name of the component that is being used in this process.
*/
public ComponentName importanceReasonComponent;
-
+
/**
* When {@link #importanceReasonPid} is non-0, this is the importance
* of the other pid. @hide
@@ -2219,7 +2219,7 @@ public class ActivityManager {
importanceReasonCode = REASON_UNKNOWN;
processState = PROCESS_STATE_IMPORTANT_FOREGROUND;
}
-
+
public RunningAppProcessInfo(String pProcessName, int pPid, String pArr[]) {
processName = pProcessName;
pid = pPid;
@@ -2262,7 +2262,7 @@ public class ActivityManager {
processState = source.readInt();
}
- public static final Creator<RunningAppProcessInfo> CREATOR =
+ public static final Creator<RunningAppProcessInfo> CREATOR =
new Creator<RunningAppProcessInfo>() {
public RunningAppProcessInfo createFromParcel(Parcel source) {
return new RunningAppProcessInfo(source);
@@ -2276,7 +2276,7 @@ public class ActivityManager {
readFromParcel(source);
}
}
-
+
/**
* Returns a list of application processes installed on external media
* that are running on the device.
@@ -2297,6 +2297,23 @@ public class ActivityManager {
}
/**
+ * Sets the memory trim mode for a process and schedules a memory trim operation.
+ *
+ * <p><b>Note: this method is only intended for testing framework.</b></p>
+ *
+ * @return Returns true if successful.
+ * @hide
+ */
+ public boolean setProcessMemoryTrimLevel(String process, int userId, int level) {
+ try {
+ return ActivityManagerNative.getDefault().setProcessMemoryTrimLevel(process, userId,
+ level);
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /**
* Returns a list of application processes that are running on the device.
*
* <p><b>Note: this method is only intended for debugging or building
@@ -2368,7 +2385,7 @@ public class ActivityManager {
return null;
}
}
-
+
/**
* @deprecated This is now just a wrapper for
* {@link #killBackgroundProcesses(String)}; the previous behavior here
@@ -2380,17 +2397,17 @@ public class ActivityManager {
public void restartPackage(String packageName) {
killBackgroundProcesses(packageName);
}
-
+
/**
* Have the system immediately kill all background processes associated
* with the given package. This is the same as the kernel killing those
* processes to reclaim memory; the system will take care of restarting
* these processes in the future as needed.
- *
+ *
* <p>You must hold the permission
* {@link android.Manifest.permission#KILL_BACKGROUND_PROCESSES} to be able to
* call this method.
- *
+ *
* @param packageName The name of the package whose processes are to
* be killed.
*/
@@ -2426,14 +2443,14 @@ public class ActivityManager {
* removed, etc. In addition, a {@link Intent#ACTION_PACKAGE_RESTARTED}
* broadcast will be sent, so that any of its registered alarms can
* be stopped, notifications removed, etc.
- *
+ *
* <p>You must hold the permission
* {@link android.Manifest.permission#FORCE_STOP_PACKAGES} to be able to
* call this method.
- *
+ *
* @param packageName The name of the package to be stopped.
* @param userId The user for which the running package is to be stopped.
- *
+ *
* @hide This is not available to third party applications due to
* it allowing them to break other applications by stopping their
* services, removing their alarms, etc.
@@ -2697,7 +2714,7 @@ public class ActivityManager {
}
/**
- * @param userid the user's id. Zero indicates the default user
+ * @param userid the user's id. Zero indicates the default user.
* @hide
*/
public boolean switchUser(int userid) {
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index b6cec60..44e47f8 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -1548,21 +1548,21 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeInt(res ? 1 : 0);
return true;
}
-
+
case STOP_APP_SWITCHES_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
stopAppSwitches();
reply.writeNoException();
return true;
}
-
+
case RESUME_APP_SWITCHES_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
resumeAppSwitches();
reply.writeNoException();
return true;
}
-
+
case PEEK_SERVICE_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
Intent service = Intent.CREATOR.createFromParcel(data);
@@ -1572,7 +1572,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeStrongBinder(binder);
return true;
}
-
+
case START_BACKUP_AGENT_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
@@ -1625,7 +1625,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
-
+
case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
int[] pids = data.createIntArray();
@@ -1643,7 +1643,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
-
+
case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder token = data.readStrongBinder();
@@ -1654,7 +1654,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
-
+
case IS_USER_A_MONKEY_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
boolean areThey = isUserAMonkey();
@@ -1662,7 +1662,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeInt(areThey ? 1 : 0);
return true;
}
-
+
case SET_USER_IS_MONKEY_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
final boolean monkey = (data.readInt() == 1);
@@ -1738,7 +1738,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
-
+
case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
boolean isit = isTopActivityImmersive();
@@ -1890,7 +1890,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
-
+
case SWITCH_USER_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
int userid = data.readInt();
@@ -2550,6 +2550,17 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeInt(res);
return true;
}
+
+ case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ String process = data.readString();
+ int userId = data.readInt();
+ int level = data.readInt();
+ boolean res = setProcessMemoryTrimLevel(process, userId, level);
+ reply.writeNoException();
+ reply.writeInt(res ? 1 : 0);
+ return true;
+ }
}
return super.onTransact(code, data, reply, flags);
@@ -3621,7 +3632,7 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
return res;
}
-
+
public ComponentName startService(IApplicationThread caller, Intent service,
String resolvedType, int userId) throws RemoteException
{
@@ -3724,7 +3735,7 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
return res;
}
-
+
public void publishService(IBinder token,
Intent intent, IBinder service) throws RemoteException {
Parcel data = Parcel.obtain();
@@ -3767,7 +3778,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -4457,7 +4468,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
throws RemoteException
{
@@ -4521,7 +4532,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
return res;
}
-
+
public void stopAppSwitches() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -4531,7 +4542,7 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
data.recycle();
}
-
+
public void resumeAppSwitches() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -4566,7 +4577,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public void closeSystemDialogs(String reason) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -4577,7 +4588,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
throws RemoteException {
Parcel data = Parcel.obtain();
@@ -4603,7 +4614,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public void overridePendingTransition(IBinder token, String packageName,
int enterAnim, int exitAnim) throws RemoteException {
Parcel data = Parcel.obtain();
@@ -4618,7 +4629,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
reply.recycle();
}
-
+
public boolean isUserAMonkey() throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
@@ -4874,7 +4885,7 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
return res;
}
-
+
public int startActivities(IApplicationThread caller, String callingPackage,
Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Bundle options, int userId) throws RemoteException {
@@ -5882,5 +5893,22 @@ class ActivityManagerProxy implements IActivityManager
return res;
}
+ @Override
+ public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
+ throws RemoteException {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ data.writeString(process);
+ data.writeInt(userId);
+ data.writeInt(level);
+ mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
+ reply.readException();
+ int res = reply.readInt();
+ data.recycle();
+ reply.recycle();
+ return res != 0;
+ }
+
private IBinder mRemote;
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 10d76f7..3d26ccd 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2584,9 +2584,9 @@ public final class ActivityThread {
intent.setFlags(intent.getFlags() & ~(Intent.FLAG_GRANT_WRITE_URI_PERMISSION
| Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION));
intent.removeUnsafeExtras();
- content.setIntent(intent);
+ content.setDefaultIntent(intent);
} else {
- content.setIntent(new Intent());
+ content.setDefaultIntent(new Intent());
}
r.activity.onProvideAssistContent(content);
}
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java
index eafcdb2..9c0d931 100644
--- a/core/java/android/app/ActivityView.java
+++ b/core/java/android/app/ActivityView.java
@@ -24,7 +24,10 @@ import android.content.IIntentSender;
import android.content.Intent;
import android.content.IntentSender;
import android.graphics.SurfaceTexture;
+import android.os.Handler;
+import android.os.HandlerThread;
import android.os.IBinder;
+import android.os.Message;
import android.os.OperationCanceledException;
import android.os.RemoteException;
import android.util.AttributeSet;
@@ -48,7 +51,9 @@ public class ActivityView extends ViewGroup {
private static final String TAG = "ActivityView";
private static final boolean DEBUG = false;
- DisplayMetrics mMetrics;
+ private static final int MSG_SET_SURFACE = 1;
+
+ DisplayMetrics mMetrics = new DisplayMetrics();
private final TextureView mTextureView;
private ActivityContainerWrapper mActivityContainer;
private Activity mActivity;
@@ -58,6 +63,9 @@ public class ActivityView extends ViewGroup {
private int mLastVisibility;
private ActivityViewCallback mActivityViewCallback;
+ private HandlerThread mThread = new HandlerThread("ActivityViewThread");
+ private Handler mHandler;
+
public ActivityView(Context context) {
this(context, null);
}
@@ -89,12 +97,27 @@ public class ActivityView extends ViewGroup {
+ e);
}
+ mThread.start();
+ mHandler = new Handler(mThread.getLooper()) {
+ @Override
+ public void handleMessage(Message msg) {
+ super.handleMessage(msg);
+ if (msg.what == MSG_SET_SURFACE) {
+ try {
+ mActivityContainer.setSurface((Surface) msg.obj, msg.arg1, msg.arg2,
+ mMetrics.densityDpi);
+ } catch (RemoteException e) {
+ throw new RuntimeException(
+ "ActivityView: Unable to set surface of ActivityContainer. " + e);
+ }
+ }
+ }
+ };
mTextureView = new TextureView(context);
mTextureView.setSurfaceTextureListener(new ActivityViewSurfaceTextureListener());
addView(mTextureView);
WindowManager wm = (WindowManager)mActivity.getSystemService(Context.WINDOW_SERVICE);
- mMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(mMetrics);
mLastVisibility = getVisibility();
@@ -111,18 +134,12 @@ public class ActivityView extends ViewGroup {
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
- if (mSurface != null) {
- try {
- if (visibility == View.GONE) {
- mActivityContainer.setSurface(null, mWidth, mHeight, mMetrics.densityDpi);
- } else if (mLastVisibility == View.GONE) {
- // Don't change surface when going between View.VISIBLE and View.INVISIBLE.
- mActivityContainer.setSurface(mSurface, mWidth, mHeight, mMetrics.densityDpi);
- }
- } catch (RemoteException e) {
- throw new RuntimeException(
- "ActivityView: Unable to set surface of ActivityContainer. " + e);
- }
+ if (mSurface != null && (visibility == View.GONE || mLastVisibility == View.GONE)) {
+ Message msg = Message.obtain(mHandler, MSG_SET_SURFACE);
+ msg.obj = (visibility == View.GONE) ? null : mSurface;
+ msg.arg1 = mWidth;
+ msg.arg2 = mHeight;
+ mHandler.sendMessage(msg);
}
mLastVisibility = visibility;
}
diff --git a/core/java/android/app/AssistContent.java b/core/java/android/app/AssistContent.java
index 4cb89a8..d23e73d 100644
--- a/core/java/android/app/AssistContent.java
+++ b/core/java/android/app/AssistContent.java
@@ -31,6 +31,7 @@ import android.os.Parcelable;
*/
@Deprecated
public class AssistContent {
+ private boolean mIsAppProvidedIntent = false;
private Intent mIntent;
private ClipData mClipData;
private Uri mUri;
@@ -55,12 +56,14 @@ public class AssistContent {
}
/**
- * Sets the Intent associated with the content, describing the current top-level context of
- * the activity. If this contains a reference to a piece of data related to the activity,
- * be sure to set {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} so the accessibility
- * service can access it.
+ * @hide
+ * Called by {@link android.app.ActivityThread} to set the default Intent based on
+ * {@link android.app.Activity#getIntent Activity.getIntent}.
+ *
+ * <p>Automatically populates {@link #mUri} if that Intent is an {@link Intent#ACTION_VIEW}
+ * of a web (http or https scheme) URI.</p>
*/
- public void setIntent(Intent intent) {
+ public void setDefaultIntent(Intent intent) {
mIntent = intent;
setWebUri(null);
if (intent != null && Intent.ACTION_VIEW.equals(intent.getAction())) {
@@ -72,7 +75,19 @@ public class AssistContent {
}
/**
- * Return the current {@link #setIntent}, which you can modify in-place.
+ * Sets the Intent associated with the content, describing the current top-level context of
+ * the activity. If this contains a reference to a piece of data related to the activity,
+ * be sure to set {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} so the accessibility
+ * service can access it.
+ */
+ public void setIntent(Intent intent) {
+ mIsAppProvidedIntent = true;
+ mIntent = intent;
+ }
+
+ /**
+ * Returns the current {@link #setIntent} if one is set, else the default Intent obtained from
+ * {@link android.app.Activity#getIntent Activity.getIntent}. Can be modified in-place.
* @hide
*/
public Intent getIntent() {
@@ -80,6 +95,16 @@ public class AssistContent {
}
/**
+ * Returns whether or not the current Intent was explicitly provided in
+ * {@link android.app.Activity#onProvideAssistContent Activity.onProvideAssistContent}. If not,
+ * the Intent was automatically set based on
+ * {@link android.app.Activity#getIntent Activity.getIntent}.
+ */
+ public boolean isAppProvidedIntent() {
+ return mIsAppProvidedIntent;
+ }
+
+ /**
* Optional additional content items that are involved with
* the current UI. Access to this content will be granted to the assistant as if you
* are sending it through an Intent with {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}.
@@ -103,9 +128,6 @@ public class AssistContent {
* off the device into other environments to acesss the same data as is currently
* being shown in the app; if the app does not have such a representation, it should
* leave the null and only report the local intent and clip data.
- *
- * <p>This will be automatically populated for you from {@link #setIntent} if that Intent
- * is an {@link Intent#ACTION_VIEW} of a web (http or https scheme) URI.</p>
*/
public void setWebUri(Uri uri) {
mUri = uri;
@@ -130,6 +152,7 @@ public class AssistContent {
if (in.readInt() != 0) {
mUri = Uri.CREATOR.createFromParcel(in);
}
+ mIsAppProvidedIntent = in.readInt() == 1;
}
/** @hide */
@@ -152,5 +175,6 @@ public class AssistContent {
} else {
dest.writeInt(0);
}
+ dest.writeInt(mIsAppProvidedIntent ? 1 : 0);
}
}
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 249cdb2..2430ccd 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -242,14 +242,14 @@ public interface IActivityManager extends IInterface {
public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
throws RemoteException;
-
+
public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException;
-
+
public void killBackgroundProcesses(final String packageName, int userId)
throws RemoteException;
public void killAllBackgroundProcesses() throws RemoteException;
public void forceStopPackage(final String packageName, int userId) throws RemoteException;
-
+
// Note: probably don't want to allow applications access to these.
public void setLockScreenShown(boolean shown) throws RemoteException;
@@ -263,7 +263,7 @@ public interface IActivityManager extends IInterface {
throws RemoteException;
public void enterSafeMode() throws RemoteException;
-
+
public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
throws RemoteException;
public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
@@ -318,9 +318,9 @@ public interface IActivityManager extends IInterface {
public void killApplicationWithAppId(String pkg, int appid, String reason)
throws RemoteException;
-
+
public void closeSystemDialogs(String reason) throws RemoteException;
-
+
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
throws RemoteException;
@@ -507,6 +507,9 @@ public interface IActivityManager extends IInterface {
public int getPackageProcessState(String packageName) throws RemoteException;
+ public boolean setProcessMemoryTrimLevel(String process, int uid, int level)
+ throws RemoteException;
+
/*
* Private non-Binder interfaces
*/
@@ -792,6 +795,7 @@ public interface IActivityManager extends IInterface {
// Available
int GET_ACTIVITY_DISPLAY_ID_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+184;
int DELETE_ACTIVITY_CONTAINER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+185;
+ int SET_PROCESS_MEMORY_TRIM_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+186;
// Start of L transactions
diff --git a/core/java/android/app/VoiceInteractor.aidl b/core/java/android/app/VoiceInteractor.aidl
index 40a4a0e..949605c 100644
--- a/core/java/android/app/VoiceInteractor.aidl
+++ b/core/java/android/app/VoiceInteractor.aidl
@@ -17,3 +17,4 @@
package android.app;
parcelable VoiceInteractor.PickOptionRequest.Option;
+parcelable VoiceInteractor.Prompt;
diff --git a/core/java/android/app/VoiceInteractor.java b/core/java/android/app/VoiceInteractor.java
index ba27c54..eccd9dc 100644
--- a/core/java/android/app/VoiceInteractor.java
+++ b/core/java/android/app/VoiceInteractor.java
@@ -16,6 +16,8 @@
package android.app;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.content.Context;
import android.os.Bundle;
import android.os.IBinder;
@@ -257,7 +259,7 @@ public class VoiceInteractor {
* so the user can give a confirmation.
*/
public static class ConfirmationRequest extends Request {
- final CharSequence mPrompt;
+ final Prompt mPrompt;
final Bundle mExtras;
/**
@@ -266,11 +268,23 @@ public class VoiceInteractor {
* should be spoken.
* @param extras Additional optional information or null.
*/
- public ConfirmationRequest(CharSequence prompt, Bundle extras) {
+ public ConfirmationRequest(@Nullable Prompt prompt, @Nullable Bundle extras) {
mPrompt = prompt;
mExtras = extras;
}
+ /**
+ * Create a new confirmation request.
+ * @param prompt Optional confirmation to speak to the user or null if nothing
+ * should be spoken.
+ * @param extras Additional optional information or null.
+ * @deprecated Prefer the version that takes a {@link Prompt}.
+ */
+ public ConfirmationRequest(CharSequence prompt, Bundle extras) {
+ mPrompt = (prompt != null ? new Prompt(prompt) : null);
+ mExtras = extras;
+ }
+
public void onConfirmationResult(boolean confirmed, Bundle result) {
}
@@ -288,7 +302,7 @@ public class VoiceInteractor {
* either {@link #onPickOptionResult} or {@link #onCancel()}.
*/
public static class PickOptionRequest extends Request {
- final CharSequence mPrompt;
+ final Prompt mPrompt;
final Option[] mOptions;
final Bundle mExtras;
@@ -417,13 +431,28 @@ public class VoiceInteractor {
* @param options The set of {@link Option}s the user is selecting from.
* @param extras Additional optional information or null.
*/
- public PickOptionRequest(CharSequence prompt, Option[] options, Bundle extras) {
+ public PickOptionRequest(@Nullable Prompt prompt, Option[] options,
+ @Nullable Bundle extras) {
mPrompt = prompt;
mOptions = options;
mExtras = extras;
}
/**
+ * Create a new pick option request.
+ * @param prompt Optional question to be asked of the user when the options are
+ * presented or null if nothing should be asked.
+ * @param options The set of {@link Option}s the user is selecting from.
+ * @param extras Additional optional information or null.
+ * @deprecated Prefer the version that takes a {@link Prompt}.
+ */
+ public PickOptionRequest(CharSequence prompt, Option[] options, Bundle extras) {
+ mPrompt = (prompt != null ? new Prompt(prompt) : null);
+ mOptions = options;
+ mExtras = extras;
+ }
+
+ /**
* Called when a single option is confirmed or narrowed to one of several options.
* @param finished True if the voice interaction has finished making a selection, in
* which case {@code selections} contains the final result. If false, this request is
@@ -451,17 +480,29 @@ public class VoiceInteractor {
* interaction task.
*/
public static class CompleteVoiceRequest extends Request {
- final CharSequence mMessage;
+ final Prompt mPrompt;
final Bundle mExtras;
/**
* Create a new completed voice interaction request.
+ * @param prompt Optional message to speak to the user about the completion status of
+ * the task or null if nothing should be spoken.
+ * @param extras Additional optional information or null.
+ */
+ public CompleteVoiceRequest(@Nullable Prompt prompt, @Nullable Bundle extras) {
+ mPrompt = prompt;
+ mExtras = extras;
+ }
+
+ /**
+ * Create a new completed voice interaction request.
* @param message Optional message to speak to the user about the completion status of
* the task or null if nothing should be spoken.
* @param extras Additional optional information or null.
+ * @deprecated Prefer the version that takes a {@link Prompt}.
*/
public CompleteVoiceRequest(CharSequence message, Bundle extras) {
- mMessage = message;
+ mPrompt = (message != null ? new Prompt(message) : null);
mExtras = extras;
}
@@ -470,7 +511,7 @@ public class VoiceInteractor {
IVoiceInteractorRequest submit(IVoiceInteractor interactor, String packageName,
IVoiceInteractorCallback callback) throws RemoteException {
- return interactor.startCompleteVoice(packageName, callback, mMessage, mExtras);
+ return interactor.startCompleteVoice(packageName, callback, mPrompt, mExtras);
}
}
@@ -486,17 +527,29 @@ public class VoiceInteractor {
* interaction task.
*/
public static class AbortVoiceRequest extends Request {
- final CharSequence mMessage;
+ final Prompt mPrompt;
final Bundle mExtras;
/**
* Create a new voice abort request.
+ * @param prompt Optional message to speak to the user indicating why the task could
+ * not be completed by voice or null if nothing should be spoken.
+ * @param extras Additional optional information or null.
+ */
+ public AbortVoiceRequest(@Nullable Prompt prompt, @Nullable Bundle extras) {
+ mPrompt = prompt;
+ mExtras = extras;
+ }
+
+ /**
+ * Create a new voice abort request.
* @param message Optional message to speak to the user indicating why the task could
* not be completed by voice or null if nothing should be spoken.
* @param extras Additional optional information or null.
+ * @deprecated Prefer the version that takes a {@link Prompt}.
*/
public AbortVoiceRequest(CharSequence message, Bundle extras) {
- mMessage = message;
+ mPrompt = (message != null ? new Prompt(message) : null);
mExtras = extras;
}
@@ -505,7 +558,7 @@ public class VoiceInteractor {
IVoiceInteractorRequest submit(IVoiceInteractor interactor, String packageName,
IVoiceInteractorCallback callback) throws RemoteException {
- return interactor.startAbortVoice(packageName, callback, mMessage, mExtras);
+ return interactor.startAbortVoice(packageName, callback, mPrompt, mExtras);
}
}
@@ -550,7 +603,101 @@ public class VoiceInteractor {
IVoiceInteractorCallback callback) throws RemoteException {
return interactor.startCommand(packageName, callback, mCommand, mArgs);
}
- }
+ }
+
+ /**
+ * A set of voice prompts to use with the voice interaction system to confirm an action, select
+ * an option, or do similar operations. Multiple voice prompts may be provided for variety. A
+ * visual prompt must be provided, which might not match the spoken version. For example, the
+ * confirmation "Are you sure you want to purchase this item?" might use a visual label like
+ * "Purchase item".
+ */
+ public static class Prompt implements Parcelable {
+ // Mandatory voice prompt. Must contain at least one item, which must not be null.
+ private final CharSequence[] mVoicePrompts;
+
+ // Mandatory visual prompt.
+ private final CharSequence mVisualPrompt;
+
+ /**
+ * Constructs a prompt set.
+ * @param voicePrompts An array of one or more voice prompts. Must not be empty or null.
+ * @param visualPrompt A prompt to display on the screen. Must not be null.
+ */
+ public Prompt(@NonNull CharSequence[] voicePrompts, @NonNull CharSequence visualPrompt) {
+ if (voicePrompts == null) {
+ throw new NullPointerException("voicePrompts must not be null");
+ }
+ if (voicePrompts.length == 0) {
+ throw new IllegalArgumentException("voicePrompts must not be empty");
+ }
+ if (visualPrompt == null) {
+ throw new NullPointerException("visualPrompt must not be null");
+ }
+ this.mVoicePrompts = voicePrompts;
+ this.mVisualPrompt = visualPrompt;
+ }
+
+ /**
+ * Constructs a prompt set with single prompt used for all interactions. This is most useful
+ * in test apps. Non-trivial apps should prefer the detailed constructor.
+ */
+ public Prompt(@NonNull CharSequence prompt) {
+ this.mVoicePrompts = new CharSequence[] { prompt };
+ this.mVisualPrompt = prompt;
+ }
+
+ /**
+ * Returns a prompt to use for voice interactions.
+ */
+ @NonNull
+ public CharSequence getVoicePromptAt(int index) {
+ return mVoicePrompts[index];
+ }
+
+ /**
+ * Returns the number of different voice prompts.
+ */
+ public int countVoicePrompts() {
+ return mVoicePrompts.length;
+ }
+
+ /**
+ * Returns the prompt to use for visual display.
+ */
+ @NonNull
+ public CharSequence getVisualPrompt() {
+ return mVisualPrompt;
+ }
+
+ /** Constructor to support Parcelable behavior. */
+ Prompt(Parcel in) {
+ mVoicePrompts = in.readCharSequenceArray();
+ mVisualPrompt = in.readCharSequence();
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeCharSequenceArray(mVoicePrompts);
+ dest.writeCharSequence(mVisualPrompt);
+ }
+
+ public static final Creator<Prompt> CREATOR
+ = new Creator<Prompt>() {
+ public Prompt createFromParcel(Parcel in) {
+ return new Prompt(in);
+ }
+
+ public Prompt[] newArray(int size) {
+ return new Prompt[size];
+ }
+ };
+ }
VoiceInteractor(IVoiceInteractor interactor, Context context, Activity activity,
Looper looper) {
@@ -631,7 +778,7 @@ public class VoiceInteractor {
}
/**
- * Queries the supported commands available from the VoiceinteractionService.
+ * Queries the supported commands available from the VoiceInteractionService.
* The command is a string that describes the generic operation to be performed.
* An example might be "org.example.commands.PICK_DATE" to ask the user to pick
* a date. (Note: This is not an actual working example.)
diff --git a/core/java/android/app/usage/NetworkStats.java b/core/java/android/app/usage/NetworkStats.java
index 5193563..1079f1a 100644
--- a/core/java/android/app/usage/NetworkStats.java
+++ b/core/java/android/app/usage/NetworkStats.java
@@ -29,11 +29,11 @@ import android.util.Log;
import dalvik.system.CloseGuard;
/**
- * Class providing enumeration over buckets of network usage statistics. NetworkUsageStats objects
+ * Class providing enumeration over buckets of network usage statistics. {@link NetworkStats} objects
* are returned as results to various queries in {@link NetworkStatsManager}.
*/
public final class NetworkStats implements AutoCloseable {
- private final static String TAG = "NetworkUsageStats";
+ private final static String TAG = "NetworkStats";
private final CloseGuard mCloseGuard = CloseGuard.get();
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index a572590..9a99a46 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -2486,7 +2486,8 @@ public class Resources {
return true;
}
- /*package*/ Drawable loadDrawable(TypedValue value, int id, Theme theme) throws NotFoundException {
+ @Nullable
+ Drawable loadDrawable(TypedValue value, int id, Theme theme) throws NotFoundException {
if (TRACE_FOR_PRELOAD) {
// Log only framework resources
if ((id >>> 24) == 0x1) {
@@ -2541,7 +2542,7 @@ public class Resources {
// Determine if the drawable has unresolved theme attributes. If it
// does, we'll need to apply a theme and store it in a theme-specific
// cache.
- final boolean canApplyTheme = dr.canApplyTheme();
+ final boolean canApplyTheme = dr != null && dr.canApplyTheme();
if (canApplyTheme && theme != null) {
dr = dr.mutate();
dr.applyTheme(theme);
diff --git a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
index cbc85f3..3d261dd 100644
--- a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
@@ -155,7 +155,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
if (mIsConstrainedHighSpeedSession) {
if (!isConstrainedHighSpeedRequestList(requestList)) {
throw new IllegalArgumentException("It is only allowed to submit a constrained "
- + "high speed request list to a constrianed high speed session!!!");
+ + "high speed request list to a constrained high speed session!!!");
}
}
}
@@ -761,8 +761,7 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
@Override
public boolean isConstrainedHighSpeed() {
- // TODO: to be implemented
- return false;
+ return mIsConstrainedHighSpeedSession;
}
}
diff --git a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
index e963a0d..f5314da 100644
--- a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
+++ b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
@@ -88,15 +88,6 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
mSurfaceIdCounter = 0;
}
- private static int translateErrorsFromCamera1(int errorCode) {
- switch (errorCode) {
- case CameraBinderDecorator.EACCES:
- return CameraBinderDecorator.PERMISSION_DENIED;
- default:
- return errorCode;
- }
- }
-
/**
* Create a separate looper/thread for the camera to run on; open the camera.
*
@@ -140,7 +131,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
// Save the looper so that we can terminate this thread
// after we are done with it.
mLooper = Looper.myLooper();
- mInitErrors = translateErrorsFromCamera1(mCamera.cameraInitUnspecified(mCameraId));
+ mInitErrors = mCamera.cameraInitUnspecified(mCameraId);
mStartDone.open();
Looper.loop(); // Blocks forever until #close is called.
}
diff --git a/core/java/android/hardware/camera2/utils/SurfaceUtils.java b/core/java/android/hardware/camera2/utils/SurfaceUtils.java
index 79d82a8..32e74e2 100644
--- a/core/java/android/hardware/camera2/utils/SurfaceUtils.java
+++ b/core/java/android/hardware/camera2/utils/SurfaceUtils.java
@@ -52,7 +52,7 @@ public class SurfaceUtils {
* @param surface The surface to be queried for size.
* @return Size of the surface.
*
- * @throw IllegalArgumentException if the surface is already abandoned.
+ * @throws IllegalArgumentException if the surface is already abandoned.
*/
public static Size getSurfaceSize(Surface surface) {
try {
@@ -68,7 +68,7 @@ public class SurfaceUtils {
* @param surface The surface to be queried for format.
* @return format of the surface.
*
- * @throw IllegalArgumentException if the surface is already abandoned.
+ * @throws IllegalArgumentException if the surface is already abandoned.
*/
public static int getSurfaceFormat(Surface surface) {
try {
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 81a65f8..a7afa91 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1565,11 +1565,17 @@ public class InputMethodService extends AbstractInputMethodService {
if (DEBUG) Log.v(TAG, "clearInsetOfPreviousIme() "
+ " mShouldClearInsetOfPreviousIme=" + mShouldClearInsetOfPreviousIme);
if (!mShouldClearInsetOfPreviousIme || mWindow == null) return;
- // We do not call onWindowShown() and onWindowHidden() so as not to make the IME author
- // confused.
- // TODO: Find out a better way which has less side-effect.
- mWindow.show();
- mWindow.hide();
+ try {
+ // We do not call onWindowShown() and onWindowHidden() so as not to make the IME author
+ // confused.
+ // TODO: Find out a better way which has less side-effect.
+ mWindow.show();
+ mWindow.hide();
+ } catch (WindowManager.BadTokenException e) {
+ if (DEBUG) Log.v(TAG, "clearInsetOfPreviousIme: BadTokenException: IME is done.");
+ mWindowVisible = false;
+ mWindowAdded = false;
+ }
mShouldClearInsetOfPreviousIme = false;
}
diff --git a/core/java/android/nfc/cardemulation/ApduServiceInfo.java b/core/java/android/nfc/cardemulation/ApduServiceInfo.java
index 3d065e3..7678678 100644
--- a/core/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/core/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -92,11 +92,6 @@ public final class ApduServiceInfo implements Parcelable {
final int mUid;
/**
- * Whether this service has dynamic resources
- */
- final boolean mHasDynamicResources;
-
- /**
* Settings Activity for this service
*/
final String mSettingsActivityName;
@@ -106,7 +101,7 @@ public final class ApduServiceInfo implements Parcelable {
*/
public ApduServiceInfo(ResolveInfo info, boolean onHost, String description,
ArrayList<AidGroup> staticAidGroups, ArrayList<AidGroup> dynamicAidGroups,
- boolean requiresUnlock, int bannerResource, int uid, boolean hasDynamicResources,
+ boolean requiresUnlock, int bannerResource, int uid,
String settingsActivityName) {
this.mService = info;
this.mDescription = description;
@@ -122,7 +117,6 @@ public final class ApduServiceInfo implements Parcelable {
}
this.mBannerResourceId = bannerResource;
this.mUid = uid;
- this.mHasDynamicResources = hasDynamicResources;
this.mSettingsActivityName = settingsActivityName;
}
@@ -172,8 +166,6 @@ public final class ApduServiceInfo implements Parcelable {
false);
mBannerResourceId = sa.getResourceId(
com.android.internal.R.styleable.HostApduService_apduServiceBanner, -1);
- mHasDynamicResources = sa.getBoolean(
- com.android.internal.R.styleable.HostApduService_dynamicResources, false);
mSettingsActivityName = sa.getString(
com.android.internal.R.styleable.HostApduService_settingsActivity);
sa.recycle();
@@ -186,8 +178,6 @@ public final class ApduServiceInfo implements Parcelable {
mRequiresDeviceUnlock = false;
mBannerResourceId = sa.getResourceId(
com.android.internal.R.styleable.OffHostApduService_apduServiceBanner, -1);
- mHasDynamicResources = sa.getBoolean(
- com.android.internal.R.styleable.OffHostApduService_dynamicResources, false);
mSettingsActivityName = sa.getString(
com.android.internal.R.styleable.HostApduService_settingsActivity);
sa.recycle();
@@ -410,9 +400,6 @@ public final class ApduServiceInfo implements Parcelable {
return null;
}
}
- public boolean hasDynamicResources() {
- return mHasDynamicResources;
- }
public String getSettingsActivityName() { return mSettingsActivityName; }
@@ -468,7 +455,6 @@ public final class ApduServiceInfo implements Parcelable {
dest.writeInt(mRequiresDeviceUnlock ? 1 : 0);
dest.writeInt(mBannerResourceId);
dest.writeInt(mUid);
- dest.writeInt(mHasDynamicResources ? 1 : 0);
dest.writeString(mSettingsActivityName);
};
@@ -492,10 +478,9 @@ public final class ApduServiceInfo implements Parcelable {
boolean requiresUnlock = source.readInt() != 0;
int bannerResource = source.readInt();
int uid = source.readInt();
- boolean dynamicResources = source.readInt() != 0;
String settingsActivityName = source.readString();
return new ApduServiceInfo(info, onHost, description, staticAidGroups,
- dynamicAidGroups, requiresUnlock, bannerResource, uid, dynamicResources,
+ dynamicAidGroups, requiresUnlock, bannerResource, uid,
settingsActivityName);
}
diff --git a/core/java/android/nfc/cardemulation/CardEmulation.java b/core/java/android/nfc/cardemulation/CardEmulation.java
index b94d4a6..64c2bc2 100644
--- a/core/java/android/nfc/cardemulation/CardEmulation.java
+++ b/core/java/android/nfc/cardemulation/CardEmulation.java
@@ -90,37 +90,6 @@ public final class CardEmulation {
public static final String CATEGORY_OTHER = "other";
/**
- * Ordered broadcast that can be sent to your app to
- * request a description and banner to be shown in
- * Android Settings UI.
- * When sent to you, this broadcast will contain the
- * {@link #EXTRA_SERVICE_COMPONENT} extra to identify
- * the service.
- *
- * Note that this broadcast will only be sent to your
- * app, if a card emulation service in your app has requested
- * its resources to be loaded dynamically.
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_REQUEST_SERVICE_RESOURCES =
- "android.nfc.cardemulation.action.REQUEST_SERVICE_RESOURCES";
-
- /**
- * The description of the service. Note that this must
- * be localized by your app, as the String will be shown
- * as is.
- */
- public static final String EXTRA_DESCRIPTION =
- "android.nfc.cardemulation.extra.DESCRIPTION";
-
- /**
- * The resource ID of the service banner to be shown
- * for this service.
- */
- public static final String EXTRA_BANNER_RES_ID =
- "android.nfc.cardemulation.extra.BANNER_RES_ID";
-
- /**
* Return value for {@link #getSelectionModeForCategory(String)}.
*
* <p>In this mode, the user has set a default service for this
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 0a45b8b..c9609e5 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -1940,6 +1940,15 @@ public abstract class BatteryStats implements Parcelable {
*/
public abstract long getFlashlightOnCount(int which);
+ /**
+ * Returns the time in microseconds that the camera has been on while the device was
+ * running on battery.
+ *
+ * {@hide}
+ */
+ public abstract long getCameraOnTime(long elapsedRealtimeUs, int which);
+
+
public static final int NETWORK_MOBILE_RX_DATA = 0;
public static final int NETWORK_MOBILE_TX_DATA = 1;
public static final int NETWORK_WIFI_RX_DATA = 2;
@@ -2735,6 +2744,9 @@ public abstract class BatteryStats implements Parcelable {
case OVERCOUNTED:
label = "over";
break;
+ case CAMERA:
+ label = "camera";
+ break;
default:
label = "???";
}
@@ -3523,6 +3535,10 @@ public abstract class BatteryStats implements Parcelable {
pw.print(prefix); pw.print(" Over-counted: "); printmAh(pw, bs.totalPowerMah);
pw.println();
break;
+ case CAMERA:
+ pw.print(prefix); pw.print(" Camera: "); printmAh(pw, bs.totalPowerMah);
+ pw.println();
+ break;
}
}
pw.println();
diff --git a/core/java/android/provider/AlarmClock.java b/core/java/android/provider/AlarmClock.java
index be37293..63ae9a9 100644
--- a/core/java/android/provider/AlarmClock.java
+++ b/core/java/android/provider/AlarmClock.java
@@ -86,7 +86,7 @@ public final class AlarmClock {
* If the extra {@link #EXTRA_ALARM_SEARCH_MODE} is used, and the search results contain two or
* more matching alarms, then the implementation should show an UI with the results and allow
* the user to select the alarm to dismiss. If the implementation supports
- * {@link android.content.Intent.CATEGORY_VOICE} and the activity is started in Voice
+ * {@link android.content.Intent#CATEGORY_VOICE} and the activity is started in Voice
* Interaction mode (i.e. check {@link android.app.Activity#isVoiceInteraction}), then the
* implementation should additionally use {@link android.app.VoiceInteractor.PickOptionRequest}
* to start a voice interaction follow-on flow to help the user disambiguate the alarm by voice.
diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java
index 33fef62..d5ee7e7 100644
--- a/core/java/android/service/voice/VoiceInteractionSession.java
+++ b/core/java/android/service/voice/VoiceInteractionSession.java
@@ -16,6 +16,7 @@
package android.service.voice;
+import android.annotation.Nullable;
import android.app.Dialog;
import android.app.Instrumentation;
import android.app.VoiceInteractor;
@@ -122,7 +123,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
final IVoiceInteractor mInteractor = new IVoiceInteractor.Stub() {
@Override
public IVoiceInteractorRequest startConfirmation(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence prompt, Bundle extras) {
+ IVoiceInteractorCallback callback, VoiceInteractor.Prompt prompt, Bundle extras) {
ConfirmationRequest request = new ConfirmationRequest(callingPackage,
Binder.getCallingUid(), callback, VoiceInteractionSession.this,
prompt, extras);
@@ -134,7 +135,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
@Override
public IVoiceInteractorRequest startPickOption(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence prompt,
+ IVoiceInteractorCallback callback, VoiceInteractor.Prompt prompt,
VoiceInteractor.PickOptionRequest.Option[] options, Bundle extras) {
PickOptionRequest request = new PickOptionRequest(callingPackage,
Binder.getCallingUid(), callback, VoiceInteractionSession.this,
@@ -147,7 +148,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
@Override
public IVoiceInteractorRequest startCompleteVoice(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence message, Bundle extras) {
+ IVoiceInteractorCallback callback, VoiceInteractor.Prompt message, Bundle extras) {
CompleteVoiceRequest request = new CompleteVoiceRequest(callingPackage,
Binder.getCallingUid(), callback, VoiceInteractionSession.this,
message, extras);
@@ -159,7 +160,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
@Override
public IVoiceInteractorRequest startAbortVoice(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence message, Bundle extras) {
+ IVoiceInteractorCallback callback, VoiceInteractor.Prompt message, Bundle extras) {
AbortVoiceRequest request = new AbortVoiceRequest(callingPackage,
Binder.getCallingUid(), callback, VoiceInteractionSession.this,
message, extras);
@@ -404,10 +405,10 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* VoiceInteractor.ConfirmationRequest}.
*/
public static final class ConfirmationRequest extends Request {
- final CharSequence mPrompt;
+ final VoiceInteractor.Prompt mPrompt;
ConfirmationRequest(String packageName, int uid, IVoiceInteractorCallback callback,
- VoiceInteractionSession session, CharSequence prompt, Bundle extras) {
+ VoiceInteractionSession session, VoiceInteractor.Prompt prompt, Bundle extras) {
super(packageName, uid, callback, session, extras);
mPrompt = prompt;
}
@@ -417,11 +418,23 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* {@link android.app.VoiceInteractor.ConfirmationRequest
* VoiceInteractor.ConfirmationRequest}.
*/
- public CharSequence getPrompt() {
+ @Nullable
+ public VoiceInteractor.Prompt getVoicePrompt() {
return mPrompt;
}
/**
+ * Return the prompt informing the user of what will happen, as per
+ * {@link android.app.VoiceInteractor.ConfirmationRequest
+ * VoiceInteractor.ConfirmationRequest}.
+ * @deprecated Prefer {@link #getVoicePrompt()} which allows multiple voice prompts.
+ */
+ @Nullable
+ public CharSequence getPrompt() {
+ return (mPrompt != null ? mPrompt.getVoicePromptAt(0) : null);
+ }
+
+ /**
* Report that the voice interactor has confirmed the operation with the user, resulting
* in a call to
* {@link android.app.VoiceInteractor.ConfirmationRequest#onConfirmationResult
@@ -437,11 +450,11 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* {@link android.app.VoiceInteractor.PickOptionRequest VoiceInteractor.PickOptionRequest}.
*/
public static final class PickOptionRequest extends Request {
- final CharSequence mPrompt;
+ final VoiceInteractor.Prompt mPrompt;
final VoiceInteractor.PickOptionRequest.Option[] mOptions;
PickOptionRequest(String packageName, int uid, IVoiceInteractorCallback callback,
- VoiceInteractionSession session, CharSequence prompt,
+ VoiceInteractionSession session, VoiceInteractor.Prompt prompt,
VoiceInteractor.PickOptionRequest.Option[] options, Bundle extras) {
super(packageName, uid, callback, session, extras);
mPrompt = prompt;
@@ -452,11 +465,22 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* Return the prompt informing the user of what they are picking, as per
* {@link android.app.VoiceInteractor.PickOptionRequest VoiceInteractor.PickOptionRequest}.
*/
- public CharSequence getPrompt() {
+ @Nullable
+ public VoiceInteractor.Prompt getVoicePrompt() {
return mPrompt;
}
/**
+ * Return the prompt informing the user of what they are picking, as per
+ * {@link android.app.VoiceInteractor.PickOptionRequest VoiceInteractor.PickOptionRequest}.
+ * @deprecated Prefer {@link #getVoicePrompt()} which allows multiple voice prompts.
+ */
+ @Nullable
+ public CharSequence getPrompt() {
+ return (mPrompt != null ? mPrompt.getVoicePromptAt(0) : null);
+ }
+
+ /**
* Return the set of options the user is picking from, as per
* {@link android.app.VoiceInteractor.PickOptionRequest VoiceInteractor.PickOptionRequest}.
*/
@@ -494,12 +518,12 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* VoiceInteractor.CompleteVoiceRequest}.
*/
public static final class CompleteVoiceRequest extends Request {
- final CharSequence mMessage;
+ final VoiceInteractor.Prompt mPrompt;
CompleteVoiceRequest(String packageName, int uid, IVoiceInteractorCallback callback,
- VoiceInteractionSession session, CharSequence message, Bundle extras) {
+ VoiceInteractionSession session, VoiceInteractor.Prompt prompt, Bundle extras) {
super(packageName, uid, callback, session, extras);
- mMessage = message;
+ mPrompt = prompt;
}
/**
@@ -507,8 +531,20 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* {@link android.app.VoiceInteractor.CompleteVoiceRequest
* VoiceInteractor.CompleteVoiceRequest}.
*/
+ @Nullable
+ public VoiceInteractor.Prompt getVoicePrompt() {
+ return mPrompt;
+ }
+
+ /**
+ * Return the message informing the user of the completion, as per
+ * {@link android.app.VoiceInteractor.CompleteVoiceRequest
+ * VoiceInteractor.CompleteVoiceRequest}.
+ * @deprecated Prefer {@link #getVoicePrompt()} which allows a separate visual message.
+ */
+ @Nullable
public CharSequence getMessage() {
- return mMessage;
+ return (mPrompt != null ? mPrompt.getVoicePromptAt(0) : null);
}
/**
@@ -527,20 +563,31 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
* {@link android.app.VoiceInteractor.AbortVoiceRequest VoiceInteractor.AbortVoiceRequest}.
*/
public static final class AbortVoiceRequest extends Request {
- final CharSequence mMessage;
+ final VoiceInteractor.Prompt mPrompt;
AbortVoiceRequest(String packageName, int uid, IVoiceInteractorCallback callback,
- VoiceInteractionSession session, CharSequence message, Bundle extras) {
+ VoiceInteractionSession session, VoiceInteractor.Prompt prompt, Bundle extras) {
super(packageName, uid, callback, session, extras);
- mMessage = message;
+ mPrompt = prompt;
}
/**
* Return the message informing the user of the problem, as per
* {@link android.app.VoiceInteractor.AbortVoiceRequest VoiceInteractor.AbortVoiceRequest}.
*/
+ @Nullable
+ public VoiceInteractor.Prompt getVoicePrompt() {
+ return mPrompt;
+ }
+
+ /**
+ * Return the message informing the user of the problem, as per
+ * {@link android.app.VoiceInteractor.AbortVoiceRequest VoiceInteractor.AbortVoiceRequest}.
+ * @deprecated Prefer {@link #getVoicePrompt()} which allows a separate visual message.
+ */
+ @Nullable
public CharSequence getMessage() {
- return mMessage;
+ return (mPrompt != null ? mPrompt.getVoicePromptAt(0) : null);
}
/**
@@ -1035,7 +1082,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
public void onCreate(Bundle args) {
doOnCreate();
}
-
+
/** @hide */
public void onCreate(Bundle args, int showFlags) {
doOnCreate();
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 7b0f1fb..37e4000 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -516,8 +516,8 @@ public class ScaleGestureDetector {
}
/**
- * Return whether the stylus scale gesture, in which the user uses a stylus
- * and presses the button, should preform scaling. {@see #setButtonScaleEnabled(boolean)}.
+ * Return whether the stylus scale gesture, in which the user uses a stylus and presses the
+ * button, should perform scaling. {@see #setStylusScaleEnabled(boolean)}
*/
public boolean isStylusScaleEnabled() {
return mStylusScaleEnabled;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 126540f..9269fd2 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -17148,6 +17148,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* drawable.
*
* @return The color of the ColorDrawable background, if set, otherwise 0.
+ * @hide
*/
@ColorInt
public int getBackgroundColor() {
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 54dadfa..e175949 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -125,6 +125,15 @@ public class Editor {
// Tag used when the Editor maintains its own separate UndoManager.
private static final String UNDO_OWNER_TAG = "Editor";
+ // Ordering constants used to place the Action Mode items in their menu.
+ private static final int MENU_ITEM_ORDER_CUT = 1;
+ private static final int MENU_ITEM_ORDER_COPY = 2;
+ private static final int MENU_ITEM_ORDER_PASTE = 3;
+ private static final int MENU_ITEM_ORDER_SHARE = 4;
+ private static final int MENU_ITEM_ORDER_SELECT_ALL = 5;
+ private static final int MENU_ITEM_ORDER_REPLACE = 6;
+ private static final int MENU_ITEM_ORDER_PROCESS_TEXT_INTENT_ACTIONS_START = 10;
+
// Each Editor manages its own undo stack.
private final UndoManager mUndoManager = new UndoManager();
private UndoOwner mUndoOwner = mUndoManager.getOwner(UNDO_OWNER_TAG, this);
@@ -1756,6 +1765,12 @@ public class Editor {
if (!checkFieldAndSelectCurrentWord()) {
return false;
}
+
+ // Avoid dismissing the selection if it exists.
+ mPreserveDetachedSelection = true;
+ stopTextActionMode();
+ mPreserveDetachedSelection = false;
+
getSelectionController().enterDrag();
return true;
}
@@ -3129,7 +3144,9 @@ public class Editor {
Callback customCallback = getCustomCallback();
if (customCallback != null) {
if (!customCallback.onCreateActionMode(mode, menu)) {
- // The custom mode can choose to cancel the action mode
+ // The custom mode can choose to cancel the action mode, dismiss selection.
+ Selection.setSelection((Spannable) mTextView.getText(),
+ mTextView.getSelectionEnd());
return false;
}
}
@@ -3152,34 +3169,33 @@ public class Editor {
private void populateMenuWithItems(Menu menu) {
if (mTextView.canCut()) {
- menu.add(0, TextView.ID_CUT, 0, com.android.internal.R.string.cut).
+ menu.add(Menu.NONE, TextView.ID_CUT, MENU_ITEM_ORDER_CUT,
+ com.android.internal.R.string.cut).
setAlphabeticShortcut('x').
setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
if (mTextView.canCopy()) {
- menu.add(0, TextView.ID_COPY, 0, com.android.internal.R.string.copy).
+ menu.add(Menu.NONE, TextView.ID_COPY, MENU_ITEM_ORDER_COPY,
+ com.android.internal.R.string.copy).
setAlphabeticShortcut('c').
setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
if (mTextView.canPaste()) {
- menu.add(0, TextView.ID_PASTE, 0, com.android.internal.R.string.paste).
- setAlphabeticShortcut('v').
- setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ menu.add(Menu.NONE, TextView.ID_PASTE, MENU_ITEM_ORDER_PASTE,
+ com.android.internal.R.string.paste).
+ setAlphabeticShortcut('v').
+ setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
if (mTextView.canShare()) {
- menu.add(0, TextView.ID_SHARE, 0, com.android.internal.R.string.share).
- setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
- }
-
- if (mTextView.canSelectAllText()) {
- menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll).
- setAlphabeticShortcut('a').
- setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ menu.add(Menu.NONE, TextView.ID_SHARE, MENU_ITEM_ORDER_SHARE,
+ com.android.internal.R.string.share).
+ setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
+ updateSelectAllItem(menu);
updateReplaceItem(menu);
}
@@ -3188,8 +3204,11 @@ public class Editor {
PackageManager packageManager = mTextView.getContext().getPackageManager();
List<ResolveInfo> supportedActivities =
packageManager.queryIntentActivities(createProcessTextIntent(), 0);
- for (ResolveInfo info : supportedActivities) {
- menu.add(info.loadLabel(packageManager))
+ for (int i = 0; i < supportedActivities.size(); ++i) {
+ ResolveInfo info = supportedActivities.get(i);
+ menu.add(Menu.NONE, Menu.NONE,
+ MENU_ITEM_ORDER_PROCESS_TEXT_INTENT_ACTIONS_START + i,
+ info.loadLabel(packageManager))
.setIntent(createProcessTextIntentForResolveInfo(info))
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
@@ -3210,6 +3229,7 @@ public class Editor {
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+ updateSelectAllItem(menu);
updateReplaceItem(menu);
Callback customCallback = getCustomCallback();
@@ -3219,12 +3239,25 @@ public class Editor {
return true;
}
+ private void updateSelectAllItem(Menu menu) {
+ boolean canSelectAll = mTextView.canSelectAllText();
+ boolean selectAllItemExists = menu.findItem(TextView.ID_SELECT_ALL) != null;
+ if (canSelectAll && !selectAllItemExists) {
+ menu.add(Menu.NONE, TextView.ID_SELECT_ALL, MENU_ITEM_ORDER_SELECT_ALL,
+ com.android.internal.R.string.selectAll)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ } else if (!canSelectAll && selectAllItemExists) {
+ menu.removeItem(TextView.ID_SELECT_ALL);
+ }
+ }
+
private void updateReplaceItem(Menu menu) {
boolean canReplace = mTextView.isSuggestionsEnabled() && shouldOfferToShowSuggestions();
boolean replaceItemExists = menu.findItem(TextView.ID_REPLACE) != null;
if (canReplace && !replaceItemExists) {
- menu.add(0, TextView.ID_REPLACE, 0, com.android.internal.R.string.replace).
- setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ menu.add(Menu.NONE, TextView.ID_REPLACE, MENU_ITEM_ORDER_REPLACE,
+ com.android.internal.R.string.replace)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
} else if (!canReplace && replaceItemExists) {
menu.removeItem(TextView.ID_REPLACE);
}
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 73a873a..6b28f89 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -1088,8 +1088,8 @@ public class ImageView extends View {
} else if (ScaleType.CENTER == mScaleType) {
// Center bitmap in view, no scaling.
mDrawMatrix = mMatrix;
- mDrawMatrix.setTranslate((int) ((vwidth - dwidth) * 0.5f + 0.5f),
- (int) ((vheight - dheight) * 0.5f + 0.5f));
+ mDrawMatrix.setTranslate(Math.round((vwidth - dwidth) * 0.5f),
+ Math.round((vheight - dheight) * 0.5f));
} else if (ScaleType.CENTER_CROP == mScaleType) {
mDrawMatrix = mMatrix;
@@ -1105,7 +1105,7 @@ public class ImageView extends View {
}
mDrawMatrix.setScale(scale, scale);
- mDrawMatrix.postTranslate((int) (dx + 0.5f), (int) (dy + 0.5f));
+ mDrawMatrix.postTranslate(Math.round(dx), Math.round(dy));
} else if (ScaleType.CENTER_INSIDE == mScaleType) {
mDrawMatrix = mMatrix;
float scale;
@@ -1119,8 +1119,8 @@ public class ImageView extends View {
(float) vheight / (float) dheight);
}
- dx = (int) ((vwidth - dwidth * scale) * 0.5f + 0.5f);
- dy = (int) ((vheight - dheight * scale) * 0.5f + 0.5f);
+ dx = Math.round((vwidth - dwidth * scale) * 0.5f);
+ dy = Math.round((vheight - dheight * scale) * 0.5f);
mDrawMatrix.setScale(scale, scale);
mDrawMatrix.postTranslate(dx, dy);
diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java
index 97348e30..ff2f22b 100644
--- a/core/java/android/widget/MediaController.java
+++ b/core/java/android/widget/MediaController.java
@@ -28,13 +28,15 @@ import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
-import com.android.internal.policy.PhoneWindow;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
+import android.view.accessibility.AccessibilityManager;
import android.widget.SeekBar.OnSeekBarChangeListener;
+import com.android.internal.policy.PhoneWindow;
+
import java.util.Formatter;
import java.util.Locale;
@@ -44,7 +46,7 @@ import java.util.Locale;
* slider. It takes care of synchronizing the controls with the state
* of the MediaPlayer.
* <p>
- * The way to use this class is to instantiate it programatically.
+ * The way to use this class is to instantiate it programmatically.
* The MediaController will create a default set of controls
* and put them in a window floating above your application. Specifically,
* the controls will float above the view specified with setAnchorView().
@@ -69,7 +71,7 @@ import java.util.Locale;
public class MediaController extends FrameLayout {
private MediaPlayerControl mPlayer;
- private Context mContext;
+ private final Context mContext;
private View mAnchor;
private View mRoot;
private WindowManager mWindowManager;
@@ -83,7 +85,7 @@ public class MediaController extends FrameLayout {
private static final int sDefaultTimeout = 3000;
private static final int FADE_OUT = 1;
private static final int SHOW_PROGRESS = 2;
- private boolean mUseFastForward;
+ private final boolean mUseFastForward;
private boolean mFromXml;
private boolean mListenersSet;
private View.OnClickListener mNextListener, mPrevListener;
@@ -96,6 +98,7 @@ public class MediaController extends FrameLayout {
private ImageButton mPrevButton;
private CharSequence mPlayDescription;
private CharSequence mPauseDescription;
+ private final AccessibilityManager mAccessibilityManager;
public MediaController(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -103,6 +106,7 @@ public class MediaController extends FrameLayout {
mContext = context;
mUseFastForward = true;
mFromXml = true;
+ mAccessibilityManager = AccessibilityManager.getInstance(context);
}
@Override
@@ -117,6 +121,7 @@ public class MediaController extends FrameLayout {
mUseFastForward = useFastForward;
initFloatingWindowLayout();
initFloatingWindow();
+ mAccessibilityManager = AccessibilityManager.getInstance(context);
}
public MediaController(Context context) {
@@ -179,8 +184,9 @@ public class MediaController extends FrameLayout {
}
// This is called whenever mAnchor's layout bound changes
- private OnLayoutChangeListener mLayoutChangeListener =
+ private final OnLayoutChangeListener mLayoutChangeListener =
new OnLayoutChangeListener() {
+ @Override
public void onLayoutChange(View v, int left, int top, int right,
int bottom, int oldLeft, int oldTop, int oldRight,
int oldBottom) {
@@ -191,7 +197,8 @@ public class MediaController extends FrameLayout {
}
};
- private OnTouchListener mTouchListener = new OnTouchListener() {
+ private final OnTouchListener mTouchListener = new OnTouchListener() {
+ @Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mShowing) {
@@ -368,9 +375,9 @@ public class MediaController extends FrameLayout {
// paused with the progress bar showing the user hits play.
mHandler.sendEmptyMessage(SHOW_PROGRESS);
- Message msg = mHandler.obtainMessage(FADE_OUT);
- if (timeout != 0) {
+ if (timeout != 0 && !mAccessibilityManager.isTouchExplorationEnabled()) {
mHandler.removeMessages(FADE_OUT);
+ Message msg = mHandler.obtainMessage(FADE_OUT);
mHandler.sendMessageDelayed(msg, timeout);
}
}
@@ -397,7 +404,7 @@ public class MediaController extends FrameLayout {
}
}
- private Handler mHandler = new Handler() {
+ private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
int pos;
@@ -527,7 +534,8 @@ public class MediaController extends FrameLayout {
return super.dispatchKeyEvent(event);
}
- private View.OnClickListener mPauseListener = new View.OnClickListener() {
+ private final View.OnClickListener mPauseListener = new View.OnClickListener() {
+ @Override
public void onClick(View v) {
doPauseResume();
show(sDefaultTimeout);
@@ -567,7 +575,8 @@ public class MediaController extends FrameLayout {
// The second scenario involves the user operating the scroll ball, in this
// case there WON'T BE onStartTrackingTouch/onStopTrackingTouch notifications,
// we will simply apply the updated position without suspending regular updates.
- private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
+ private final OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
+ @Override
public void onStartTrackingTouch(SeekBar bar) {
show(3600000);
@@ -581,6 +590,7 @@ public class MediaController extends FrameLayout {
mHandler.removeMessages(SHOW_PROGRESS);
}
+ @Override
public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {
if (!fromuser) {
// We're not interested in programmatically generated changes to
@@ -595,6 +605,7 @@ public class MediaController extends FrameLayout {
mCurrentTime.setText(stringForTime( (int) newposition));
}
+ @Override
public void onStopTrackingTouch(SeekBar bar) {
mDragging = false;
setProgress();
@@ -637,7 +648,8 @@ public class MediaController extends FrameLayout {
return MediaController.class.getName();
}
- private View.OnClickListener mRewListener = new View.OnClickListener() {
+ private final View.OnClickListener mRewListener = new View.OnClickListener() {
+ @Override
public void onClick(View v) {
int pos = mPlayer.getCurrentPosition();
pos -= 5000; // milliseconds
@@ -648,7 +660,8 @@ public class MediaController extends FrameLayout {
}
};
- private View.OnClickListener mFfwdListener = new View.OnClickListener() {
+ private final View.OnClickListener mFfwdListener = new View.OnClickListener() {
+ @Override
public void onClick(View v) {
int pos = mPlayer.getCurrentPosition();
pos += 15000; // milliseconds
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index ca57d1a..11904e1 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -18,6 +18,7 @@ package android.widget;
import android.annotation.NonNull;
import android.os.Build;
+import android.os.Build.VERSION_CODES;
import android.os.Parcel;
import android.os.Parcelable;
import com.android.internal.R;
@@ -349,17 +350,24 @@ public class ScrollView extends FrameLayout {
if (getChildCount() > 0) {
final View child = getChildAt(0);
- int height = getMeasuredHeight();
+ final int height = getMeasuredHeight();
if (child.getMeasuredHeight() < height) {
+ final int widthPadding;
+ final int heightPadding;
final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();
+ final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion;
+ if (targetSdkVersion >= VERSION_CODES.MNC) {
+ widthPadding = mPaddingLeft + mPaddingRight + lp.leftMargin + lp.rightMargin;
+ heightPadding = mPaddingTop + mPaddingBottom + lp.topMargin + lp.bottomMargin;
+ } else {
+ widthPadding = mPaddingLeft + mPaddingRight;
+ heightPadding = mPaddingTop + mPaddingBottom;
+ }
- int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
- mPaddingLeft + mPaddingRight, lp.width);
- height -= mPaddingTop;
- height -= mPaddingBottom;
- int childHeightMeasureSpec =
- MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
-
+ final int childWidthMeasureSpec = getChildMeasureSpec(
+ widthMeasureSpec, widthPadding, lp.width);
+ final int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
+ height - heightPadding, MeasureSpec.EXACTLY);
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
}
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 6872caa..b68934b 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -9072,9 +9072,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
switch (id) {
case ID_SELECT_ALL:
- // This does not enter text selection mode. Text is highlighted, so that it can be
- // bulk edited, like selectAllOnFocus does. Returns true even if text is empty.
+ // This starts an action mode if triggered from another action mode. Text is
+ // highlighted, so that it can be bulk edited, like selectAllOnFocus does. Returns
+ // true even if text is empty.
+ boolean shouldRestartActionMode =
+ mEditor != null && mEditor.mTextActionMode != null;
+ stopTextActionMode();
selectAllText();
+ if (shouldRestartActionMode) {
+ mEditor.startSelectionActionMode();
+ }
return true;
case ID_UNDO:
@@ -9335,7 +9342,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
boolean canSelectAllText() {
- return canSelectText() && !hasPasswordTransformationMethod();
+ return canSelectText() && !hasPasswordTransformationMethod()
+ && !(getSelectionStart() == 0 && getSelectionEnd() == mText.length());
}
boolean selectAllText() {
diff --git a/core/java/com/android/internal/app/IVoiceInteractor.aidl b/core/java/com/android/internal/app/IVoiceInteractor.aidl
index 84e9cf0..44feafb 100644
--- a/core/java/com/android/internal/app/IVoiceInteractor.aidl
+++ b/core/java/com/android/internal/app/IVoiceInteractor.aidl
@@ -27,14 +27,14 @@ import com.android.internal.app.IVoiceInteractorRequest;
*/
interface IVoiceInteractor {
IVoiceInteractorRequest startConfirmation(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence prompt, in Bundle extras);
+ IVoiceInteractorCallback callback, in VoiceInteractor.Prompt prompt, in Bundle extras);
IVoiceInteractorRequest startPickOption(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence prompt,
+ IVoiceInteractorCallback callback, in VoiceInteractor.Prompt prompt,
in VoiceInteractor.PickOptionRequest.Option[] options, in Bundle extras);
IVoiceInteractorRequest startCompleteVoice(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence message, in Bundle extras);
+ IVoiceInteractorCallback callback, in VoiceInteractor.Prompt prompt, in Bundle extras);
IVoiceInteractorRequest startAbortVoice(String callingPackage,
- IVoiceInteractorCallback callback, CharSequence message, in Bundle extras);
+ IVoiceInteractorCallback callback, in VoiceInteractor.Prompt prompt, in Bundle extras);
IVoiceInteractorRequest startCommand(String callingPackage,
IVoiceInteractorCallback callback, String command, in Bundle extras);
boolean[] supportsCommands(String callingPackage, in String[] commands);
diff --git a/core/java/com/android/internal/os/BatterySipper.java b/core/java/com/android/internal/os/BatterySipper.java
index 056b0aa..049d3eb 100644
--- a/core/java/com/android/internal/os/BatterySipper.java
+++ b/core/java/com/android/internal/os/BatterySipper.java
@@ -42,6 +42,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
public long wifiRunningTimeMs;
public long cpuFgTimeMs;
public long wakeLockTimeMs;
+ public long cameraTimeMs;
+ public long flashlightTimeMs;
public long mobileRxPackets;
public long mobileTxPackets;
@@ -67,6 +69,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
public double mobileRadioPowerMah;
public double gpsPowerMah;
public double sensorPowerMah;
+ public double cameraPowerMah;
+ public double flashlightPowerMah;
public enum DrainType {
IDLE,
@@ -79,7 +83,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
APP,
USER,
UNACCOUNTED,
- OVERCOUNTED
+ OVERCOUNTED,
+ CAMERA
}
public BatterySipper(DrainType drainType, Uid uid, double value) {
@@ -135,6 +140,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
wifiRunningTimeMs += other.wifiRunningTimeMs;
cpuFgTimeMs += other.cpuFgTimeMs;
wakeLockTimeMs += other.wakeLockTimeMs;
+ cameraTimeMs += other.cameraTimeMs;
+ flashlightTimeMs += other.flashlightTimeMs;
mobileRxPackets += other.mobileRxPackets;
mobileTxPackets += other.mobileTxPackets;
mobileActive += other.mobileActive;
@@ -151,6 +158,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
sensorPowerMah += other.sensorPowerMah;
mobileRadioPowerMah += other.mobileRadioPowerMah;
wakeLockPowerMah += other.wakeLockPowerMah;
+ cameraPowerMah += other.cameraPowerMah;
+ flashlightPowerMah += other.flashlightPowerMah;
}
/**
@@ -158,7 +167,8 @@ public class BatterySipper implements Comparable<BatterySipper> {
* @return the sum of all the power in this BatterySipper.
*/
public double sumPower() {
- return totalPowerMah = usagePowerMah + wifiPowerMah + gpsPowerMah + cpuPowerMah + sensorPowerMah
- + mobileRadioPowerMah + wakeLockPowerMah;
+ return totalPowerMah = usagePowerMah + wifiPowerMah + gpsPowerMah + cpuPowerMah +
+ sensorPowerMah + mobileRadioPowerMah + wakeLockPowerMah + cameraPowerMah +
+ flashlightPowerMah;
}
}
diff --git a/core/java/com/android/internal/os/BatteryStatsHelper.java b/core/java/com/android/internal/os/BatteryStatsHelper.java
index fbe87c5..e6165a1 100644
--- a/core/java/com/android/internal/os/BatteryStatsHelper.java
+++ b/core/java/com/android/internal/os/BatteryStatsHelper.java
@@ -122,6 +122,8 @@ public final class BatteryStatsHelper {
PowerCalculator mWifiPowerCalculator;
PowerCalculator mBluetoothPowerCalculator;
PowerCalculator mSensorPowerCalculator;
+ PowerCalculator mCameraPowerCalculator;
+ PowerCalculator mFlashlightPowerCalculator;
public static boolean checkWifiOnly(Context context) {
ConnectivityManager cm = (ConnectivityManager)context.getSystemService(
@@ -365,6 +367,16 @@ public final class BatteryStatsHelper {
}
mSensorPowerCalculator.reset();
+ if (mCameraPowerCalculator == null) {
+ mCameraPowerCalculator = new CameraPowerCalculator(mPowerProfile);
+ }
+ mCameraPowerCalculator.reset();
+
+ if (mFlashlightPowerCalculator == null) {
+ mFlashlightPowerCalculator = new FlashlightPowerCalculator(mPowerProfile);
+ }
+ mFlashlightPowerCalculator.reset();
+
mStatsType = statsType;
mRawUptime = rawUptimeUs;
mRawRealtime = rawRealtimeUs;
@@ -480,6 +492,8 @@ public final class BatteryStatsHelper {
mWifiPowerCalculator.calculateApp(app, u, mRawRealtime, mRawUptime, mStatsType);
mBluetoothPowerCalculator.calculateApp(app, u, mRawRealtime, mRawUptime, mStatsType);
mSensorPowerCalculator.calculateApp(app, u, mRawRealtime, mRawUptime, mStatsType);
+ mCameraPowerCalculator.calculateApp(app, u, mRawRealtime, mRawUptime, mStatsType);
+ mFlashlightPowerCalculator.calculateApp(app, u, mRawRealtime, mRawUptime, mStatsType);
final double totalPower = app.sumPower();
if (DEBUG && totalPower != 0) {
@@ -619,15 +633,6 @@ public final class BatteryStatsHelper {
}
}
- private void addFlashlightUsage() {
- long flashlightOnTimeMs = mStats.getFlashlightOnTime(mRawRealtime, mStatsType) / 1000;
- double flashlightPower = flashlightOnTimeMs
- * mPowerProfile.getAveragePower(PowerProfile.POWER_FLASHLIGHT) / (60*60*1000);
- if (flashlightPower != 0) {
- addEntry(BatterySipper.DrainType.FLASHLIGHT, flashlightOnTimeMs, flashlightPower);
- }
- }
-
private void addUserUsage() {
for (int i = 0; i < mUserSippers.size(); i++) {
final int userId = mUserSippers.keyAt(i);
@@ -643,7 +648,6 @@ public final class BatteryStatsHelper {
addUserUsage();
addPhoneUsage();
addScreenUsage();
- addFlashlightUsage();
addWiFiUsage();
addBluetoothUsage();
addIdleUsage(); // Not including cellular idle power
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 62745d4..25228d0 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -272,18 +272,19 @@ public final class BatteryStatsImpl extends BatteryStats {
final HistoryStepDetails mCurHistoryStepDetails = new HistoryStepDetails();
final HistoryStepDetails mReadHistoryStepDetails = new HistoryStepDetails();
final HistoryStepDetails mTmpHistoryStepDetails = new HistoryStepDetails();
+
/**
- * Total time (in 1/100 sec) spent executing in user code.
+ * Total time (in milliseconds) spent executing in user code.
*/
long mLastStepCpuUserTime;
long mCurStepCpuUserTime;
/**
- * Total time (in 1/100 sec) spent executing in kernel code.
+ * Total time (in milliseconds) spent executing in kernel code.
*/
long mLastStepCpuSystemTime;
long mCurStepCpuSystemTime;
/**
- * Times from /proc/stat
+ * Times from /proc/stat (but measured in milliseconds).
*/
long mLastStepStatUserTime;
long mLastStepStatSystemTime;
@@ -4337,15 +4338,22 @@ public final class BatteryStatsImpl extends BatteryStats {
return 0;
}
- @Override public long getFlashlightOnTime(long elapsedRealtimeUs, int which) {
+ @Override
+ public long getFlashlightOnTime(long elapsedRealtimeUs, int which) {
return mFlashlightOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
}
- @Override public long getFlashlightOnCount(int which) {
+ @Override
+ public long getFlashlightOnCount(int which) {
return mFlashlightOnTimer.getCountLocked(which);
}
@Override
+ public long getCameraOnTime(long elapsedRealtimeUs, int which) {
+ return mCameraOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
+ }
+
+ @Override
public long getNetworkActivityBytes(int type, int which) {
if (type >= 0 && type < mNetworkByteActivityCounters.length) {
return mNetworkByteActivityCounters[type].getCountLocked(which);
diff --git a/core/java/com/android/internal/os/CameraPowerCalculator.java b/core/java/com/android/internal/os/CameraPowerCalculator.java
new file mode 100644
index 0000000..3273080
--- /dev/null
+++ b/core/java/com/android/internal/os/CameraPowerCalculator.java
@@ -0,0 +1,48 @@
+/*
+ * 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.os;
+
+import android.os.BatteryStats;
+
+/**
+ * Power calculator for the camera subsystem, excluding the flashlight.
+ *
+ * Note: Power draw for the flash unit should be included in the FlashlightPowerCalculator.
+ */
+public class CameraPowerCalculator extends PowerCalculator {
+ private final double mCameraPowerOnAvg;
+
+ public CameraPowerCalculator(PowerProfile profile) {
+ mCameraPowerOnAvg = profile.getAveragePower(PowerProfile.POWER_CAMERA);
+ }
+
+ @Override
+ public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
+ long rawUptimeUs, int statsType) {
+
+ // Calculate camera power usage. Right now, this is a (very) rough estimate based on the
+ // average power usage for a typical camera application.
+ final BatteryStats.Timer timer = u.getCameraTurnedOnTimer();
+ if (timer != null) {
+ final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000;
+ app.cameraTimeMs = totalTime;
+ app.cameraPowerMah = (totalTime * mCameraPowerOnAvg) / (1000*60*60);
+ } else {
+ app.cameraTimeMs = 0;
+ app.cameraPowerMah = 0;
+ }
+ }
+}
diff --git a/core/java/com/android/internal/os/FlashlightPowerCalculator.java b/core/java/com/android/internal/os/FlashlightPowerCalculator.java
new file mode 100644
index 0000000..fef66ff
--- /dev/null
+++ b/core/java/com/android/internal/os/FlashlightPowerCalculator.java
@@ -0,0 +1,46 @@
+/*
+ * 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.os;
+
+import android.os.BatteryStats;
+
+/**
+ * Power calculator for the flashlight.
+ */
+public class FlashlightPowerCalculator extends PowerCalculator {
+ private final double mFlashlightPowerOnAvg;
+
+ public FlashlightPowerCalculator(PowerProfile profile) {
+ mFlashlightPowerOnAvg = profile.getAveragePower(PowerProfile.POWER_FLASHLIGHT);
+ }
+
+ @Override
+ public void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
+ long rawUptimeUs, int statsType) {
+
+ // Calculate flashlight power usage. Right now, this is based on the average power draw
+ // of the flash unit when kept on over a short period of time.
+ final BatteryStats.Timer timer = u.getFlashlightTurnedOnTimer();
+ if (timer != null) {
+ final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000;
+ app.flashlightTimeMs = totalTime;
+ app.flashlightPowerMah = (totalTime * mFlashlightPowerOnAvg) / (1000*60*60);
+ } else {
+ app.flashlightTimeMs = 0;
+ app.flashlightPowerMah = 0;
+ }
+ }
+}
diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java
index 1efa565..4ede8dd 100644
--- a/core/java/com/android/internal/os/PowerProfile.java
+++ b/core/java/com/android/internal/os/PowerProfile.java
@@ -152,10 +152,17 @@ public class PowerProfile {
public static final String POWER_VIDEO = "dsp.video";
/**
- * Power consumption when camera flashlight is on.
+ * Average power consumption when camera flashlight is on.
*/
public static final String POWER_FLASHLIGHT = "camera.flashlight";
+ /**
+ * Average power consumption when the camera is on over all standard use cases.
+ *
+ * TODO: Add more fine-grained camera power metrics.
+ */
+ public static final String POWER_CAMERA = "camera.avg";
+
public static final String POWER_CPU_SPEEDS = "cpu.speeds";
/**
diff --git a/core/java/com/android/internal/os/ProcessCpuTracker.java b/core/java/com/android/internal/os/ProcessCpuTracker.java
index 8393e2a..bf97f1f 100644
--- a/core/java/com/android/internal/os/ProcessCpuTracker.java
+++ b/core/java/com/android/internal/os/ProcessCpuTracker.java
@@ -139,6 +139,8 @@ public class ProcessCpuTracker {
private float mLoad5 = 0;
private float mLoad15 = 0;
+ // All times are in milliseconds. They are converted from jiffies to milliseconds
+ // when extracted from the kernel.
private long mCurrentSampleTime;
private long mLastSampleTime;
@@ -191,12 +193,34 @@ public class ProcessCpuTracker {
// filter out kernel processes.
public long vsize;
+ /**
+ * Time in milliseconds.
+ */
public long base_uptime;
+
+ /**
+ * Time in milliseconds.
+ */
public long rel_uptime;
+ /**
+ * Time in milliseconds.
+ */
public long base_utime;
+
+ /**
+ * Time in milliseconds.
+ */
public long base_stime;
+
+ /**
+ * Time in milliseconds.
+ */
public int rel_utime;
+
+ /**
+ * Time in milliseconds.
+ */
public int rel_stime;
public long base_minfaults;
@@ -558,7 +582,7 @@ public class ProcessCpuTracker {
}
/**
- * Returns the total time (in clock ticks, or 1/100 sec) spent executing in
+ * Returns the total time (in milliseconds) spent executing in
* both user and system code. Safe to call without lock held.
*/
public long getCpuTimeForPid(int pid) {
@@ -575,26 +599,44 @@ public class ProcessCpuTracker {
}
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastUserTime() {
return mRelUserTime;
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastSystemTime() {
return mRelSystemTime;
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastIoWaitTime() {
return mRelIoWaitTime;
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastIrqTime() {
return mRelIrqTime;
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastSoftIrqTime() {
return mRelSoftIrqTime;
}
+ /**
+ * @return time in milliseconds.
+ */
final public int getLastIdleTime() {
return mRelIdleTime;
}
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 5ed4f70..971da77 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -508,7 +508,7 @@ public class ZygoteInit {
String args[] = {
"--setuid=1000",
"--setgid=1000",
- "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,1032,3001,3002,3003,3006,3007",
+ "--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,1021,1032,3001,3002,3003,3006,3007",
"--capabilities=" + capabilities + "," + capabilities,
"--nice-name=system_server",
"--runtime-args",
diff --git a/core/java/com/android/internal/view/FloatingActionMode.java b/core/java/com/android/internal/view/FloatingActionMode.java
index 8f3a82b..661dce1 100644
--- a/core/java/com/android/internal/view/FloatingActionMode.java
+++ b/core/java/com/android/internal/view/FloatingActionMode.java
@@ -128,11 +128,16 @@ public class FloatingActionMode extends ActionMode {
private void repositionToolbar() {
checkToolbarInitialized();
+
+ mContentRectOnWindow.set(mContentRect);
+ mContentRectOnWindow.offset(mViewPosition[0], mViewPosition[1]);
+ // Make sure that content rect is not out of the view's visible bounds.
mContentRectOnWindow.set(
- mContentRect.left + mViewPosition[0],
- mContentRect.top + mViewPosition[1],
- mContentRect.right + mViewPosition[0],
- mContentRect.bottom + mViewPosition[1]);
+ Math.max(mContentRectOnWindow.left, mViewRect.left),
+ Math.max(mContentRectOnWindow.top, mViewRect.top),
+ Math.min(mContentRectOnWindow.right, mViewRect.right),
+ Math.min(mContentRectOnWindow.bottom, mViewRect.bottom));
+
if (!mContentRectOnWindow.equals(mPreviousContentRectOnWindow)) {
if (!mPreviousContentRectOnWindow.isEmpty()) {
notifyContentRectMoving();
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 832f92f..0d80a7f 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -27,6 +27,8 @@
#include <sys/mman.h>
#include <cutils/ashmem.h>
+#define DEBUG_PARCEL 0
+
namespace android {
class WrappedPixelRef : public SkPixelRef {
@@ -959,75 +961,82 @@ static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) {
}
}
- int fd = p->readFileDescriptor();
- int dupFd = dup(fd);
- if (dupFd < 0) {
+ // Read the bitmap blob.
+ size_t size = bitmap->getSize();
+ android::Parcel::ReadableBlob blob;
+ android::status_t status = p->readBlob(size, &blob);
+ if (status) {
SkSafeUnref(ctable);
- doThrowRE(env, "Could not dup parcel fd.");
- return NULL;
- }
-
- bool readOnlyMapping = !isMutable;
- Bitmap* nativeBitmap = GraphicsJNI::mapAshmemPixelRef(env, bitmap.get(),
- ctable, dupFd, readOnlyMapping);
- SkSafeUnref(ctable);
- if (!nativeBitmap) {
- close(dupFd);
- doThrowRE(env, "Could not allocate ashmem pixel ref.");
+ doThrowRE(env, "Could not read bitmap blob.");
return NULL;
}
- bitmap->pixelRef()->setImmutable();
- return GraphicsJNI::createBitmap(env, nativeBitmap,
- getPremulBitmapCreateFlags(isMutable), NULL, NULL, density);
-}
-
-class Ashmem {
-public:
- Ashmem(size_t sz, bool removeWritePerm) : mSize(sz) {
- int fd = -1;
- void *addr = nullptr;
-
- // Create new ashmem region with read/write priv
- fd = ashmem_create_region("bitmap", sz);
- if (fd < 0) {
- goto error;
- }
- addr = mmap(nullptr, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (addr == MAP_FAILED) {
- goto error;
- }
- // If requested, remove the ability to make additional writeable to
- // this memory.
- if (removeWritePerm) {
- if (ashmem_set_prot_region(fd, PROT_READ) < 0) {
- goto error;
- }
+ // Map the bitmap in place from the ashmem region if possible otherwise copy.
+ Bitmap* nativeBitmap;
+ if (blob.fd() >= 0 && (blob.isMutable() || !isMutable)) {
+#if DEBUG_PARCEL
+ ALOGD("Bitmap.createFromParcel: mapped contents of %s bitmap from %s blob "
+ "(fds %s)",
+ isMutable ? "mutable" : "immutable",
+ blob.isMutable() ? "mutable" : "immutable",
+ p->allowFds() ? "allowed" : "forbidden");
+#endif
+ // Dup the file descriptor so we can keep a reference to it after the Parcel
+ // is disposed.
+ int dupFd = dup(blob.fd());
+ if (dupFd < 0) {
+ blob.release();
+ SkSafeUnref(ctable);
+ doThrowRE(env, "Could not allocate dup blob fd.");
+ return NULL;
}
- mFd = fd;
- mPtr = addr;
- return;
-error:
- if (fd >= 0) {
- close(fd);
+
+ // Map the pixels in place and take ownership of the ashmem region.
+ nativeBitmap = GraphicsJNI::mapAshmemPixelRef(env, bitmap.get(),
+ ctable, dupFd, const_cast<void*>(blob.data()), !isMutable);
+ SkSafeUnref(ctable);
+ if (!nativeBitmap) {
+ close(dupFd);
+ blob.release();
+ doThrowRE(env, "Could not allocate ashmem pixel ref.");
+ return NULL;
}
- if (addr) {
- munmap(addr, sz);
+
+ // Clear the blob handle, don't release it.
+ blob.clear();
+ } else {
+#if DEBUG_PARCEL
+ if (blob.fd() >= 0) {
+ ALOGD("Bitmap.createFromParcel: copied contents of mutable bitmap "
+ "from immutable blob (fds %s)",
+ p->allowFds() ? "allowed" : "forbidden");
+ } else {
+ ALOGD("Bitmap.createFromParcel: copied contents from %s blob "
+ "(fds %s)",
+ blob.isMutable() ? "mutable" : "immutable",
+ p->allowFds() ? "allowed" : "forbidden");
}
- }
- ~Ashmem() {
- if (mPtr) {
- close(mFd);
- munmap(mPtr, mSize);
+#endif
+
+ // Copy the pixels into a new buffer.
+ nativeBitmap = GraphicsJNI::allocateJavaPixelRef(env, bitmap.get(), ctable);
+ SkSafeUnref(ctable);
+ if (!nativeBitmap) {
+ blob.release();
+ doThrowRE(env, "Could not allocate java pixel ref.");
+ return NULL;
}
+ bitmap->lockPixels();
+ memcpy(bitmap->getPixels(), blob.data(), size);
+ bitmap->unlockPixels();
+
+ // Release the blob handle.
+ blob.release();
}
- void *getPtr() const { return mPtr; }
- int getFd() const { return mFd; }
-private:
- int mFd = -1;
- int mSize;
- void* mPtr = nullptr;
-};
+
+ return GraphicsJNI::createBitmap(env, nativeBitmap,
+ getPremulBitmapCreateFlags(isMutable), NULL, NULL, density);
+}
static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
jlong bitmapHandle,
@@ -1064,26 +1073,51 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject,
}
}
- bool ashmemSrc = androidBitmap->getAshmemFd() >= 0;
- if (ashmemSrc && !isMutable) {
- p->writeDupFileDescriptor(androidBitmap->getAshmemFd());
- } else {
- Ashmem dstAshmem(bitmap.getSize(), !isMutable);
- if (!dstAshmem.getPtr()) {
- doThrowRE(env, "Could not allocate ashmem for new bitmap.");
+ // Transfer the underlying ashmem region if we have one and it's immutable.
+ android::status_t status;
+ int fd = androidBitmap->getAshmemFd();
+ if (fd >= 0 && !isMutable && p->allowFds()) {
+#if DEBUG_PARCEL
+ ALOGD("Bitmap.writeToParcel: transferring immutable bitmap's ashmem fd as "
+ "immutable blob (fds %s)",
+ p->allowFds() ? "allowed" : "forbidden");
+#endif
+
+ status = p->writeDupImmutableBlobFileDescriptor(fd);
+ if (status) {
+ doThrowRE(env, "Could not write bitmap blob file descriptor.");
return JNI_FALSE;
}
+ return JNI_TRUE;
+ }
- bitmap.lockPixels();
- const void* pSrc = bitmap.getPixels();
- if (pSrc == NULL) {
- memset(dstAshmem.getPtr(), 0, bitmap.getSize());
- } else {
- memcpy(dstAshmem.getPtr(), pSrc, bitmap.getSize());
- }
- bitmap.unlockPixels();
- p->writeDupFileDescriptor(dstAshmem.getFd());
+ // Copy the bitmap to a new blob.
+ bool mutableCopy = isMutable;
+#if DEBUG_PARCEL
+ ALOGD("Bitmap.writeToParcel: copying %s bitmap into new %s blob (fds %s)",
+ isMutable ? "mutable" : "immutable",
+ mutableCopy ? "mutable" : "immutable",
+ p->allowFds() ? "allowed" : "forbidden");
+#endif
+
+ size_t size = bitmap.getSize();
+ android::Parcel::WritableBlob blob;
+ status = p->writeBlob(size, mutableCopy, &blob);
+ if (status) {
+ doThrowRE(env, "Could not copy bitmap to parcel blob.");
+ return JNI_FALSE;
}
+
+ bitmap.lockPixels();
+ const void* pSrc = bitmap.getPixels();
+ if (pSrc == NULL) {
+ memset(blob.data(), 0, size);
+ } else {
+ memcpy(blob.data(), pSrc, size);
+ }
+ bitmap.unlockPixels();
+
+ blob.release();
return JNI_TRUE;
}
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index ff22ef3..93259e7 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -623,20 +623,20 @@ android::Bitmap* GraphicsJNI::allocateAshmemPixelRef(JNIEnv* env, SkBitmap* bitm
}
android::Bitmap* GraphicsJNI::mapAshmemPixelRef(JNIEnv* env, SkBitmap* bitmap,
- SkColorTable* ctable, int fd, bool readOnly) {
- int flags;
-
+ SkColorTable* ctable, int fd, void* addr, bool readOnly) {
const SkImageInfo& info = bitmap->info();
if (info.fColorType == kUnknown_SkColorType) {
doThrowIAE(env, "unknown bitmap configuration");
return nullptr;
}
- // Create new ashmem region with read/write priv
- flags = readOnly ? (PROT_READ) : (PROT_READ | PROT_WRITE);
- void* addr = mmap(NULL, ashmem_get_size_region(fd), flags, MAP_SHARED, fd, 0);
- if (addr == MAP_FAILED) {
- return nullptr;
+ if (!addr) {
+ // Map existing ashmem region if not already mapped.
+ int flags = readOnly ? (PROT_READ) : (PROT_READ | PROT_WRITE);
+ addr = mmap(NULL, ashmem_get_size_region(fd), flags, MAP_SHARED, fd, 0);
+ if (addr == MAP_FAILED) {
+ return nullptr;
+ }
}
// we must respect the rowBytes value already set on the bitmap instead of
@@ -645,6 +645,9 @@ android::Bitmap* GraphicsJNI::mapAshmemPixelRef(JNIEnv* env, SkBitmap* bitmap,
android::Bitmap* wrapper = new android::Bitmap(addr, fd, info, rowBytes, ctable);
wrapper->getSkBitmap(bitmap);
+ if (readOnly) {
+ bitmap->pixelRef()->setImmutable();
+ }
// since we're already allocated, we lockPixels right away
// HeapAllocator behaves this way too
bitmap->lockPixels();
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index 1938e85..bcd834b 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -99,7 +99,7 @@ public:
SkColorTable* ctable);
static android::Bitmap* mapAshmemPixelRef(JNIEnv* env, SkBitmap* bitmap,
- SkColorTable* ctable, int fd, bool readOnly);
+ SkColorTable* ctable, int fd, void* addr, bool readOnly);
/**
* Given a bitmap we natively allocate a memory block to store the contents
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index a3a0551..2ee9283 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -211,7 +211,7 @@ static void android_os_Parcel_writeBlob(JNIEnv* env, jclass clazz, jlong nativeP
}
android::Parcel::WritableBlob blob;
- android::status_t err2 = parcel->writeBlob(length, &blob);
+ android::status_t err2 = parcel->writeBlob(length, false, &blob);
if (err2 != NO_ERROR) {
signalExceptionForError(env, clazz, err2);
return;
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 439affe..8accc0a 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -232,7 +232,6 @@
<protected-broadcast android:name="android.nfc.action.TRANSACTION_DETECTED" />
- <protected-broadcast android:name="android.nfc.cardemulation.action.REQUEST_SERVICE_RESOURCES" />
<protected-broadcast android:name="android.intent.action.CLEAR_DNS_CACHE" />
<protected-broadcast android:name="android.intent.action.PROXY_CHANGE" />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index a65c5c1..24c8d48 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3225,8 +3225,6 @@
<!-- A drawable that can be rendered in Android's system UI for representing
the service. -->
<attr name="apduServiceBanner" format="reference"/>
- <!-- Allows the app to update the description and service banner at run-time -->
- <attr name="dynamicResources" format="boolean"/>
<!-- Component name of an activity that allows the user to modify
the settings for this service. -->
<attr name="settingsActivity"/>
@@ -3243,8 +3241,6 @@
<!-- A drawable that can be rendered in Android's system UI for representing
the service. -->
<attr name="apduServiceBanner"/>
- <!-- Allows the app to update the description and service banner at run-time -->
- <attr name="dynamicResources"/>
<!-- Component name of an activity that allows the user to modify
the settings for this service. -->
<attr name="settingsActivity"/>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 1600e97..ef39c75 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2679,8 +2679,9 @@
<public type="attr" name="rightIndents" />
<public type="attr" name="showForAllUsers" />
- <!-- NFC CardEmulation: dynamically load service resources -->
- <public type="attr" name="dynamicResources" />
+
+ <attr name="__reserved1" format="boolean" />
+ <public type="attr" name="__reserved1" />
<attr name="__reserved0" format="boolean" />
<public type="attr" name="__reserved0" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 625ab59..a2f8918 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -688,7 +688,7 @@
<string name="permdesc_subscribedFeedsRead">Allows the app to get details about the currently synced feeds.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permlab_sendSms">send SMS messages</string>
+ <string name="permlab_sendSms">send and view SMS messages</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_sendSms">Allows the app to send SMS messages.
This may result in unexpected charges. Malicious apps may cost you money by
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 7782ed7..f89dced 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -194,7 +194,7 @@ please see styles_device_defaults.xml.
</style>
<style name="TextAppearance.Material.Subhead.Inverse">
- <item name="textColor">?attr/textColorSecondaryInverse</item>
+ <item name="textColor">?attr/textColorPrimaryInverse</item>
<item name="textColorHint">?attr/textColorHintInverse</item>
<item name="textColorHighlight">?attr/textColorHighlightInverse</item>
<item name="textColorLink">?attr/textColorLinkInverse</item>
diff --git a/core/res/res/xml/power_profile.xml b/core/res/res/xml/power_profile.xml
index 3215e17..28d99d8 100644
--- a/core/res/res/xml/power_profile.xml
+++ b/core/res/res/xml/power_profile.xml
@@ -37,6 +37,8 @@
<item name="wifi.scan">0.1</item> <!-- WIFI network scanning, ~100mA -->
<item name="dsp.audio">0.1</item> <!-- ~10mA -->
<item name="dsp.video">0.1</item> <!-- ~50mA -->
+ <item name="camera.flashlight">0.1</item> <!-- Avg. power for camera flash, ~160mA -->
+ <item name="camera.avg">0.1</item> <!-- Avg. power use of camera in standard usecases, ~550mA -->
<item name="radio.active">0.1</item> <!-- ~200mA -->
<item name="radio.scanning">0.1</item> <!-- cellular radio scanning for signal, ~10mA -->
<item name="gps.on">0.1</item> <!-- ~50mA -->
diff --git a/docs/html/images/systrace/display-rhythm.png b/docs/html/images/systrace/display-rhythm.png
deleted file mode 100644
index a249161..0000000
--- a/docs/html/images/systrace/display-rhythm.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/systrace/frame-selected-alert-tab.png b/docs/html/images/systrace/frame-selected-alert-tab.png
new file mode 100644
index 0000000..e4b666c
--- /dev/null
+++ b/docs/html/images/systrace/frame-selected-alert-tab.png
Binary files differ
diff --git a/docs/html/images/systrace/frame-selected.png b/docs/html/images/systrace/frame-selected.png
new file mode 100644
index 0000000..ee8e11f
--- /dev/null
+++ b/docs/html/images/systrace/frame-selected.png
Binary files differ
diff --git a/docs/html/images/systrace/frame-unselected.png b/docs/html/images/systrace/frame-unselected.png
new file mode 100644
index 0000000..abc93d4
--- /dev/null
+++ b/docs/html/images/systrace/frame-unselected.png
Binary files differ
diff --git a/docs/html/images/systrace/overview.png b/docs/html/images/systrace/overview.png
new file mode 100644
index 0000000..bd7f549
--- /dev/null
+++ b/docs/html/images/systrace/overview.png
Binary files differ
diff --git a/docs/html/images/systrace/process-rhythm.png b/docs/html/images/systrace/process-rhythm.png
deleted file mode 100644
index 7498cc7..0000000
--- a/docs/html/images/systrace/process-rhythm.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/systrace/report.png b/docs/html/images/systrace/report.png
deleted file mode 100644
index a642960..0000000
--- a/docs/html/images/systrace/report.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/preview/testing/performance.jd b/docs/html/preview/testing/performance.jd
index 003b619..abb41c4 100644
--- a/docs/html/preview/testing/performance.jd
+++ b/docs/html/preview/testing/performance.jd
@@ -158,6 +158,15 @@ Number Slow draw: 23342
</ul>
</li>
+ <li>INTENDED_VSYNC
+ <ul>
+ <li>The intended start point for the frame. If this value is different from VSYNC, there
+ was work occurring on the UI thread that prevented it from responding to the vsync signal
+ in a timely fashion.
+ </li>
+ </ul>
+ </li>
+
<li>VSYNC
<ul>
<li>The time value that was used in all the vsync listeners and drawing for the frame
@@ -172,16 +181,6 @@ Number Slow draw: 23342
</ul>
</li>
-
- <li>INTENDED_VSYNC
- <ul>
- <li>The intended start point for the frame. If this value is different from VSYNC, there
- was work occurring on the UI thread that prevented it from responding to the vsync signal
- in a timely fashion.
- </li>
- </ul>
- </li>
-
<li>OLDEST_INPUT_EVENT
<ul>
<li>The timestamp of the oldest input event in the input queue, or Long.MAX_VALUE if
diff --git a/docs/html/tools/data-binding/guide.jd b/docs/html/tools/data-binding/guide.jd
index ec16c6b..7c4c15a 100644
--- a/docs/html/tools/data-binding/guide.jd
+++ b/docs/html/tools/data-binding/guide.jd
@@ -141,7 +141,8 @@ page.tags="databinding", "layouts"
&mdash; it's a support library, so you can use it with all Android platform
versions back to <strong>Android 2.1</strong> (API level 7+).</p>
-<p>Android Studio <strong>1.3.0-beta1</strong> or higher is required.</p>
+<p>To use data binding, Android Plugin for Gradle <strong>1.3.0-beta1</strong>
+or higher is required.</p>
<h4>Beta release</h4>
@@ -156,7 +157,7 @@ versions back to <strong>Android 2.1</strong> (API level 7+).</p>
so use it at your own risk. That said, we do want your feedback! Please
let us know what is or isn’t working for you using the <a
href="https://code.google.com/p/android-developer-preview/">issue
- tracker</a>.
+ tracker</a>.
</li>
<li>
The Data Binding library beta release is subject to significant changes,
@@ -174,7 +175,7 @@ versions back to <strong>Android 2.1</strong> (API level 7+).</p>
Further Android Studio support will come in the future.
</li>
<li>
- By using the Data Binding library beta release, you acknowledge these
+ By using the Data Binding library beta release, you acknowledge these
caveats.</li>
</ul>
</div>
@@ -186,16 +187,13 @@ versions back to <strong>Android 2.1</strong> (API level 7+).</p>
<p>To get started with Data Binding, download the library from the Support
repository in the Android SDK manager. </p>
-<p>Make sure you are using a compatible version of Android Studio.
-The Data Binding plugin for Android Studio requires Android Studio <strong>1.3.0-beta1
-or higher</strong>.</p>
-<h2 id="build_environment">
- Build Environment
-</h2>
-
-<p>To get started with Data Binding, download the library from the Support repository in the Android SDK manager. </p>
+<p>The Data Binding plugin requires Android Plugin for Gradle <strong>1.3.0-beta1
+or higher</strong>, so update your build dependencies (in
+<code>build.gradle</code>) as needed.</p>
-<p>Make sure you are using a <strong>compatible version of Android Studio</strong>. The Data Binding plugin for Android Studio requires <strong>Android 1.3.0-beta1 or higher</strong>.</p>
+<p>Also, make sure you are using a compatible version of Android Studio.
+<strong>Android Studio 1.3</strong> adds the code-completion and layout-preview
+support for data binding.</p>
<p>
<strong>Setting Up Work Environment:</strong>
@@ -203,12 +201,12 @@ or higher</strong>.</p>
<p>
To set up your application to use data binding, add data binding to the class
- path of your build gradle file, right below "android".
+ path of your <code>build.gradle</code> file, right below "android".
</p>
<pre>
dependencies {
- classpath <strong>"com.android.tools.build:gradle:1.2.3"
+ classpath <strong>"com.android.tools.build:gradle:1.3.0-beta1"
</strong>classpath <strong>"com.android.databinding:dataBinder:</strong>1.0-rc0"
}
}
diff --git a/docs/html/tools/debugging/systrace.jd b/docs/html/tools/debugging/systrace.jd
index 6472152..5d2cd89 100644
--- a/docs/html/tools/debugging/systrace.jd
+++ b/docs/html/tools/debugging/systrace.jd
@@ -1,4 +1,4 @@
-page.title=Analyzing Display and Performance
+page.title=Analyzing UI Performance with Systrace
page.tags=systrace,speed
parent.title=Debugging
parent.link=index.html
@@ -8,22 +8,15 @@ parent.link=index.html
<div id="qv">
<h2>In this document</h2>
<ol>
- <li><a href="#overview">Overview</a>
- </li>
- <li><a href="#generate">Generating Traces</a>
+ <li><a href="#overview">Overview</a></li>
+ <li><a href="#generate">Generating a Trace</a></li>
+ <li><a href="#analysis">Analyzing a Trace</a>
<ol>
- <li><a href="#limit-trace">Limiting trace data</a></li>
- <li><a href="#running-4.3">Tracing on Android 4.3 and higher</a>
- <li><a href="#running-4.2">Tracing on Android 4.2 and lower</a></li>
+ <li><a href="#frames">Inspecting Frames</a></li>
+ <li><a href="#alerts">Investigating Alerts</a></li>
</ol>
</li>
<li><a href="#app-trace">Tracing Application Code</a></li>
- <li><a href="#analysis">Analyzing Traces</a>
- <ol>
- <li><a href="#long-processes">Long running processes</a></li>
- <li><a href="#display-interupts">Interruptions in display execution</a></li>
- </ol>
- </li>
</ol>
<h2>See also</h2>
<ol>
@@ -32,72 +25,55 @@ parent.link=index.html
</div>
</div>
-<p>After building features, eliminating bugs, and cleaning up your code, you should spend some
- time looking at the performance of your application. The speed and smoothness with which your
- application draws pixels and performs operations has an significant impact on your users'
- experience.</p>
-
-<p>Android applications operate within a shared resource environment, and the performance of
- your application can be impacted by how efficiently it interacts with those resources in
- the larger system. Applications also operate in a multithreaded environment, competing with other
- threaded processes for resources, which can cause performance problems that are hard to diagnose.
-</p>
-
-<p>The Systrace tool allows you to collect and review code execution data for your
- application and the Android system. You can use this data to diagnose execution problems and
- improve the performance of your application.</p>
+<p>While developing your application, you should check that user interactions are buttery smooth,
+running at a consistent 60 frames per second. If something goes wrong, and a frame gets dropped, the
+first step in fixing the problem is understanding what the system is doing.</p>
+<p>The Systrace tool allows you to collect and inspect timing information across an entire Android
+device, which is called a <em>trace</em>. It shows where time and CPU cycles are being spent,
+displaying what each thread and process is doing at any given time. It also inpects the captured
+tracing information to highlight problems that it observes, from list item recycling to rendering
+content, and provide recommendations about how to fix them. This document explains how to navigate
+the trace files produced by the tool, and use them to analyze the performance of an application's
+user interface (UI).</p>
<h2 id="overview">Overview</h2>
-<p>Systrace helps you analyze how the execution of your application fits into the larger
- Android environment, letting you see system and applications process execution on a common
- timeline. The tool allows you to generate highly detailed, interactive reports from devices
- running Android 4.1 and higher, such as the report in figure 1.</p>
+<p>Systrace helps you analyze how the execution of your application fits into the many running
+systems on an Android device. It puts together system and application thread execution on a common
+timeline. In order to analyze your app with Systrace, you first collect a trace log of your app, and
+the system activity. The generated trace allows you to view highly detailed, interactive reports
+showing everything happening the system for the traced duration.</p>
-<img src="{@docRoot}images/systrace/report.png" alt="Systrace example report" id="figure1" />
+<img src="{@docRoot}images/systrace/overview.png" alt="Systrace example overview" id="figure1" />
<p class="img-caption">
- <strong>Figure 1.</strong> An example Systrace report on 5 seconds of process execution
- for a running application and related Android system processes.
+ <strong>Figure 1.</strong> An example Systrace, showing 5 seconds of scrolling an app when it
+ is not performing well.
</p>
+<p>Figure 1. shows a trace captured while scrolling an app that is not rendering smoothly. By
+default, a zoomed out view of the traced duration is shown. The horizontal axis is time, and trace
+events are grouped by process, and then by thread on the vertical axis.</p>
-<h2 id="generate">Generating Traces</h2>
+<p>The groupings are in the order Kernel, SurfaceFlinger (the android compositor process), followed
+by apps, each labeled by package name. Each app process contains all of the tracing signals from
+each thread it contains, including a hierarchy of high level tracing events based on the enabled
+tracing categories.</p>
-<p>In order to create a trace of your application, you must perform a few setup steps. First, you
- must have a device running Android 4.1 or higher. Set up the device for
- <a href="{@docRoot}tools/device.html#setting-up">debugging</a>, connect it to your development
- system, and install your application. Some types of trace information, specifically disk activity
- and kernel work queues, require that you have root access to the device. However, most Systrace
- log data only requires that the device be enabled for developer debugging.</p>
-<p>Systrace traces can be run either from a
- <a href="{@docRoot}tools/help/systrace.html#options">command line</a> or from a
- <a href="{@docRoot}tools/help/systrace.html#gui">graphical user interface</a>. This guide
- focuses on using the command line options.</p>
+<h2 id="generate">Generating a Trace</h2>
+<p>In order to create a trace of your application, you must perform a few setup steps. First, you
+must have a device running Android 4.1 (API 16) or higher. Set up the device
+for <a href="{@docRoot}tools/device.html#setting-up">debugging</a>, connect it to your development
+system, and install your application. Some types of trace information, specifically disk activity
+and kernel work queues, require that you have root access to the device. However, most Systrace log
+data only requires that the device be enabled for developer debugging.</p>
-<h3 id="limit-trace">Limiting trace data</h3>
-
-<p>The Systrace tool can generate a potentially huge amount of data from applications
- and system sources. To limit the amount of data the tool collects and make the data more relevant
- to your analysis, use the following options:</p>
-
-<ul>
- <li>Limit the amount of time covered by the trace with the {@code -t, --time} option. The default
- length of a trace is 5 seconds.</li>
- <li>Limit the size of the data collected by the trace with the {@code -b, --buf-size} option.</li>
- <li>Specify what types of processes are traced. The types of processes that can be traced depends
- on the version of Android you are running:
- <ul>
- <li>Android 4.2 and lower devices: Use the {@code --set-tags} option and the {@code --disk},
- {@code --cpu-freq}, {@code --cpu-idle}, {@code --cpu-load} options.</li>
- <li>Android 4.3 and higher devices: Use the {@code --list-categories} option to see what
- categories are available on your test device.</li>
- </ul>
- </li>
-</ul>
-
+<p>Systrace traces can be run either from
+a <a href="{@docRoot}tools/help/systrace.html#options">command line</a> or from a
+<a href="{@docRoot}tools/help/systrace.html#gui">graphical user interface</a>. This guide focuses on
+using the command line options.</p>
<h3 id="running-4.3">Tracing on Android 4.3 and higher</h3>
@@ -116,7 +92,7 @@ $ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm
</ol>
<p>For more information on the available options for running Systrace, see the
-<a href="{@docRoot}tools/help/systrace.html#options-4.3">Systrace</a> help page.</p>
+<a href="#options-4.3">Systrace</a> help page.</p>
<h3 id="running-4.2">Tracing on Android 4.2 and lower</h3>
@@ -127,9 +103,9 @@ $ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm
<ul>
<li>General system processes such as graphics, audio and input processes (selected using trace
- <a href="{@docRoot}tools/help/systrace.html#tags">category tags</a>).</li>
+ <a href="#tags">category tags</a>).</li>
<li>Low level system information such as CPU, kernel and disk activity (selected using
- <a href="{@docRoot}tools/help/systrace.html#options">options</a>).</li>
+ <a href="#options">options</a>).</li>
</ul>
<p>To set trace tags for Systrace using the command-line:</p>
@@ -178,14 +154,85 @@ $ python systrace.py --cpu-freq --cpu-load --time=10 -o mytracefile.html
</ol>
<p>For more information on the available options for running Systrace, see the
-<a href="{@docRoot}tools/help/systrace.html#options-pre-4.3">Systrace</a> help page.</p>
+<a href="#options-pre-4.3">Systrace</a> help page.</p>
+
+
+<h2 id="analysis">Analyzing a Trace</h2>
+
+<p>After you have generated a trace, open the output html file using a web browser. This section
+explains how to analyze and interpret the information that the tool produces to find and fix UI
+performance problems.</p>
+
+<h3 id="frames">Inspecting Frames</h3>
+
+<p>Each app that is rendering frames shows a row of frame circles, which are typically colored
+green. Circles that are colored yellow or red, exceeding the 16.6 millisecond run time limit
+required to maintain a stable 60 frames per second. Zoom in using the 'w' key to see the frames of
+your application, and look for long-running frames getting in the way of smoothness.</p>
+
+<p class="note">
+ <strong>Note:</strong> Hit the '?' key, or the button in the top right for help navigating the
+ trace.
+</p>
+
+<img src="{@docRoot}images/systrace/frame-unselected.png" alt="Zoomed in view of a frame" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Systrace display after zooming in on a long-running frame.
+</p>
+
+<p>Clicking on one such frame highlights it, focusing only on the work done by the system for that
+frame. On devices running Android 5.0 (API level 21) or higher, this work is split between the UI
+Thread and RenderThread. On prior versions, all work in creating a frame is done on the UI
+Thread.</p>
+
+<p>Click on individual components of the frame to see how long they took to run. Some events, such
+as <em>performTraversals</em>, describe what the system is doing in that method when you select
+it. Selecting a frame displays any alerts present in that frame.</p>
+
+<h3 id="alerts">Investigating Alerts</h3>
+
+<p>Systrace does automatic analysis of the events in the trace, and highlights many performance
+problems as alerts, suggesting what to do next.</p>
+
+<img src="{@docRoot}images/systrace/frame-selected.png" alt="Problematic frame selected" id="figure3" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Selecting the problematic frame, an alert is shown identifying a problem.
+</p>
+
+<p>After you select a slow frame such as the one shown in Figure 3, an alert may be displayed. In
+the case above, it calls out that the primary problem with the frame is too much work being done
+inside {@link android.widget.ListView} recycling and rebinding. There are links to the relevant
+events in the trace, which can be followed to explain more about what the system is doing during
+this time.</p>
+
+<p>If you see too much work being done on the UI thread, as in this case with this
+{@link android.widget.ListView} work, you can
+use <a href="{@docRoot}tools/debugging/debugging-tracing.html">Traceview</a>, the app code profiling
+tool, to investigate exactly what is taking so much time.</p>
+
+<p>Note that you can also find about every alert in the trace by clicking the <em>Alerts</em> tab to
+the far right of the window. Doing so expands the Alerts panel, where you can see every alert that
+the tool discovered in your trace, along with an occurrence count.</p>
+
+<img src="{@docRoot}images/systrace/frame-selected-alert-tab.png" alt="Alert tab shown" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Clicking the Alert button to the right reveals the alert tab.
+</p>
+
+<p>The Alerts panel helps you see which problems occur in the trace, and how often they contribute
+to jank. Think of the alerts panel as a list of bugs to be fixed, often a tiny change or improvement
+in one area can eliminate an entire class of alerts from your application!</p>
<h2 id="app-trace">Tracing Application Code</h2>
-<p>The Systrace tool can trace the execution of code within your application. In Android
-4.3 (API level 18) and higher, you can use the methods of the {@link android.os.Trace} class to
-add instrumentation to your application code and see the results in a Systrace report.</p>
+<p>The tracing signals defined by the framework do not have visibility into everything your
+application is doing, so you may want to add your own. In Android 4.3 (API level 18) and higher, you
+can use the methods of the {@link android.os.Trace} class to add signals to your code. This
+technique can help you see what work your application's threads are doing at any given time. Tracing
+begin and end events do add overhead while a trace is being captured, a few microseconds each, but
+sprinkling in a few per frame, or per worker thread task can go a long way to adding context to a
+trace of your app.</p>
<p>The following code example shows how to use the {@link android.os.Trace} class to track
execution of an application method, including two nested code blocks within that method.</p>
@@ -212,6 +259,8 @@ public void ProcessPeople() {
}
}
</pre>
+
+<!-- todo: move these two Notes to the android.os.Trace class -->
<p class="note">
<strong>Note:</strong> When you nest trace calls within each other, the
{@link android.os.Trace#endSection} method ends the most recently called
@@ -229,99 +278,10 @@ public void ProcessPeople() {
<p>When using application-level tracing with Systrace, you must specify the package name of your
application in the user interface or specify the {@code -a} or {@code --app=} options on the
command line. For more information, see the
-<a href="{@docRoot}tools/help/systrace.html">Systrace</a> help page.</p>
-
-<!-- todo: add ndk coverage -->
-
-
-<h2 id="analysis">Analyzing Traces</h2>
+<a href="{@docRoot}tools/help/systrace.html">Systrace usage guide</a>.</p>
-<p>After you have generated a trace using Systrace, it lists the location of the output
- file and you can open the report using a web browser.
- How you use the trace data depends on the performance issues you are investigating. However,
- this section provides some general instructions on how to analyze a trace.</p>
-
-<p>The reports generated by Systrace are interactive, allowing you to zoom into and out of
- the process execution details. Use the <em>W</em> key to zoom in, the <em>S</em>
- key to zoom out, the <em>A</em> key to pan left and the <em>D</em> key to pan
- right. Select a task in timeline using your mouse to get more information about the task.
- For more information about the using the keyboard navigation shortcuts and navigation, see the
- <a href="{@docRoot}tools/help/systrace.html#viewing-options">Systrace</a> reference
- documentation.</p>
-
-<h3 id="long-processes">Long running processes</h3>
-
-<p>A well-behaved application executes many small operations quickly and with a regular rhythm,
- with individual operations completing within few milliseconds, depending on the device
- and the processes being performed, as shown in figure 2:</p>
-
-<img src="{@docRoot}images/systrace/process-rhythm.png" alt="Systrace exerpt of app processing"
-id="figure2" />
-<p class="img-caption">
- <strong>Figure 2.</strong> Excerpt from a trace of a smoothly running application with a regular
- execution rhythm.
-</p>
-
-<p>The trace excerpt in figure 2 shows a well-behaved application with
- a regular process rhythm (1). The lower section of figure 2 shows a magnified section of
- the trace indicated by the dotted outline, which reveals some irregularity in the process
- execution. In particular, one of the wider task bars, indicated by (2), is taking slightly
- longer (14 milliseconds) than other, similar tasks on this thread, which are averaging between
- 9 and 12 milliseconds to complete. This particular task execution length is likely not noticeable
- to a user, unless it impacts another process with specific timing, such as a screen update.</p>
-
-<p>Long running processes show up as thicker than usual execution bars in a trace. These thicker
- bars can indicate a problem in your application performance. When they show up in your
- trace, zoom in on the process using the
- <a href="{@docRoot}tools/help/systrace.html#viewing-options">keyboard navigation</a> shortcuts to
- identify the task causing the problem, and click on the task to get more information. You should
- also look at other processes running at the same time, looking for a thread in one process that is
- being blocked by another process.</p>
-
-
-<h3 id="display-interupts">Interruptions in display execution</h3>
-
-<p>The Systrace tool is particularly useful in analyzing application display slowness,
- or pauses in animations, because it shows you the execution of your application across multiple
- system processes. With display execution, drawing screen frames with a regular rhythm is essential
- for good performance. Having a regular rhythm for display ensures that animations and motion are
- smooth on screen. If an application drops out of this rhythm, the display can become jerky or slow
- from the users perspective.</p>
-
-<p>If you are analyzing an application for this type of problem, examine the
- <strong>SurfaceFlinger</strong> process in the Systrace report where your application is
- also executing to look for places where it drops out of its regular rhythm.</p>
-
-<img src="{@docRoot}images/systrace/display-rhythm.png" alt="Systrace exerpt of display processing"
-id="figure3" />
-<p class="img-caption">
- <strong>Figure 3.</strong> Excerpt from a trace of an application showing interruptions in
- display processing.
-</p>
-
-<p>The trace excerpt in figure 3 shows an section of a trace that indicates an interruption in the
- device display. The section of the <strong>SurfaceFlinger</strong> process in top excerpt,
- indicated by (1), shows that display frames are being missed. These
- dropped frames are potentially causing the display to stutter or halt. Zooming into this problem
- area in the lower trace, shows that a memory operation (image buffer dequeuing and allocation) in
- the <strong>surfaceflinger</strong> secondary thread is taking a long time (2). This delay
- causes the application to miss the display update window, indicated by the dotted
- line. As the developer of this application, you should investigate other threads in your
- application that may also be trying to allocate memory at the same time or otherwise blocking
- memory allocation with another request or task.</p>
-
-<p>Regular, rhythmic execution of the <strong>SurfaceFlinger</strong> process is essential to smooth
- display of screen content, particularly for animations and motion. Interruptions in the regular
- execution pattern of this thread is not always an indication of a display problem with your
- application. Further testing is required to determine if this is actually a performance problem
- from a user perspective. Being able to identify display execution patterns like the example above
- can help you detect display problems and build a smooth-running, high-performance application.
-</p>
-
-<p class="note">
- <strong>Note:</strong> When using Systrace to analyze display problems, make sure
- you activate the tracing tags for <strong>Graphics</strong> and <strong>Views</strong>.
-</p>
+<p>You should enable app level tracing when profiling your app, even if you have not added signals
+yourself. Library code can include very useful tracing signals when you enable application-level
+tracing. The {@link android.support.v7.widget.RecyclerView} class is a great example of this,
+providing information about several important stages of work it executes.</p>
-<p>For more information on the command line options and keyboard controls for Systrace,
-see the <a href="{@docRoot}tools/help/systrace.html">Systrace</a> help page.</p> \ No newline at end of file
diff --git a/docs/html/tools/help/systrace.jd b/docs/html/tools/help/systrace.jd
index 4461da9..2a8e86f 100644
--- a/docs/html/tools/help/systrace.jd
+++ b/docs/html/tools/help/systrace.jd
@@ -13,9 +13,7 @@ parent.link=index.html
<p>The Systrace tool is particularly useful in diagnosing display problems where an
application is slow to draw or stutters while displaying motion or animation. For more information
on how to use Systrace, see <a href="{@docRoot}tools/debugging/systrace.html">Analyzing
- Display and Performance</a>.</p>
-
-
+ UI Performance with Systrace</a>.</p>
<h2 id="requirements">Requirements</h2>
@@ -37,7 +35,7 @@ of these methods.</p>
<a href="{@docRoot}sdk/installing/studio.html">Android Studio</a>,
or the Android <a href="{@docRoot}tools/help/monitor.html">Device Monitor</a>.
-<p>To run the Systrace user interface:</p>
+<p>To run the Systrace capture user interface:</p>
<div class="toggle-content closed">
<p style="margin-top:5px"><a href="#" onclick="return toggleContent(this)">
@@ -100,7 +98,6 @@ or the Android <a href="{@docRoot}tools/help/monitor.html">Device Monitor</a>.
</div>
-
<h2 id="options">Command Line Usage</h2>
<p>The Systrace tool has different command line options for devices running Android 4.3 (API
@@ -118,9 +115,9 @@ $ python systrace.py [options] [category1] [category2] ... [categoryN]
<h3 id="options-4.3">Android 4.3 and higher options</h3>
-<p>When you use Systrace on devices running Android 4.3 and higher, you must specify at least one
-trace category tag. Here is an example execution run that sets trace tags and generates a trace
-from a connected device.</p>
+<p>When you use Systrace on devices running Android 4.3 and higher, you can omit trace category tags
+to get the defaults, or you may manually specify tags for inclusion. Here is an example execution
+run that sets trace tags and generates a trace from a connected device.</p>
<pre>
$ cd <em>android-sdk</em>/platform-tools/systrace
@@ -220,19 +217,10 @@ $ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm
<a href="{@docRoot}guide/topics/manifest/manifest-element.html#package">package names</a>.
The apps must contain tracing instrumentation calls from the {@link android.os.Trace} class.
For more information, see <a href="{@docRoot}tools/debugging/systrace.html#app-trace">Analyzing
- Display and Performance</a>.
+ UI Performance with Systrace</a>.
</td>
</tr>
-
-
- <tr>
- <td><code>--link-assets</code></td>
-
- <td>Link to the original CSS or JavaScript resources instead of embedding them in the HTML
- trace report.</td>
- </tr>
-
<tr>
<td><code>--from-file=&lt;<em>FROM_FILE</em>&gt;</code></td>
@@ -240,13 +228,6 @@ $ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm
</tr>
<tr>
- <td><code>--asset-dir=&lt;<em>ASSET_DIR</em>&gt;</code></td>
-
- <td>Specify a directory for the trace report assets. This option is useful for maintaining a
- single set of assets for multiple Systrace reports.</td>
- </tr>
-
- <tr>
<td style="white-space:nowrap">
<code>-e &lt;<em>DEVICE_SERIAL</em>&gt;<br>
--serial=&lt;<em>DEVICE_SERIAL</em>&gt;</code></td>
@@ -375,13 +356,6 @@ $ python systrace.py --disk --time=10 -o mynewtrace.html
</td>
</tr>
- <tr>
- <td><code>--link-assets</code></td>
-
- <td>Link to the original CSS or JS resources instead of embedding them in the HTML trace
- report.</td>
- </tr>
-
</table>
<p>You can set the trace <a href="#tags">tags</a> for Systrace on
@@ -455,16 +429,4 @@ trace HTML report.</p>
<td>Select the previous event on the currently selected timeline.</td>
</tr>
- <tr>
- <td><strong>Double Click</strong></td>
-
- <td>Zoom into the trace timeline.</td>
- </tr>
-
- <tr>
- <td><strong>Shift+Double Click</strong></td>
-
- <td>Zoom out of the trace timeline.</td>
- </tr>
-
</table>
diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd
index e7de000..0113347 100644
--- a/docs/html/tools/studio/index.jd
+++ b/docs/html/tools/studio/index.jd
@@ -83,11 +83,11 @@ The <em>Android</em> project view:</p>
<img src="{@docRoot}images/tools/projectview01.png" />
<p class="img-caption"><strong>Figure 1.</strong> Show the Android project view.</p>
<img src="{@docRoot}images/tools/studio-projectview_scripts.png" />
- <p class="img-caption"><strong>Figure 2.</strong> Show project build Files.</p>
+ <p class="img-caption"><strong>Figure 2.</strong> Show project build files.</p>
<p>The <em>Android</em> project view shows all the build files at the top level of the project
hierarchy under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the
-top level of the project hierarchy and contains these three elements at the top level:</p>
+top level of the project hierarchy and contains these four elements at the top level:</p>
<ul>
<li><code>java/</code> - Source files for the module.</li>
@@ -109,10 +109,10 @@ from the <strong>Project</strong> drop-down. </p>
should notice that the project structure appears different than you may be used to in Eclipse. Each
instance of Android Studio contains a project with one or more application modules. Each
application module folder contains the complete source sets for that module, including
-{@code src/main} and {@code src/androidTest} directories, resources, build
+{@code src/main/} and {@code src/androidTest/} directories, resources, build
file and the Android manifest. For the most part, you will need to modify the files under each
-module's {@code src/main} directory for source code updates, the gradle.build file for build
-specification and the files under {@code src/androidTest} directory for test case creation.
+module's {@code src/main/} directory for source code updates, the gradle.build file for build
+specification and the files under {@code src/androidTest/} directory for test case creation.
<p> <img src="{@docRoot}images/tools/studio-project-layout.png" alt="" /></p>
<p> <class="img-caption"><strong>Figure 3.</strong> View Android Studio <em>Project</em>
@@ -131,7 +131,7 @@ development: </p>
</ul>
<p>For example, selecting the <strong>Problems</strong> view of your project displays links to the
-source files containing any recognized coding and syntax errors, such as missing a XML element
+source files containing any recognized coding and syntax errors, such as missing an XML element
closing tag in a layout file.<p>
<p>For more information, see
@@ -199,7 +199,7 @@ uniquely identify application packages for publishing. The application ID is set
</pre>
<p class="note"><strong>Note:</strong> The <em>applicationId</em> is specified only in your
-build.gradle file, and not in the AndroidManifest.xml file.</p>
+{@code build.gradle} file, and not in the AndroidManifest.xml file.</p>
<p>When using build variants, the build system enables you to uniquely identify different
packages for each product flavors and build types. The application ID in the build type is added as
@@ -643,7 +643,7 @@ When running the Android Plugin from the command line or on machines where Andro
installed, set the Android Plugin for Gradle proxy settings in the Gradle build file.</p>
<p>For application-specific HTTP proxy settings, set the proxy settings in the
-<strong>build.gradle</strong> file as required for each application module.</p>
+{@code build.gradle} file as required for each application module.</p>
<pre>
apply plugin: 'com.android.application'
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 9951330..82515d4 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -130,7 +130,7 @@
<li><a href="<?cs var:toroot ?>tools/debugging/debugging-ui.html"><span class="en">Optimizing your UI</span></a></li>
<li><a href="<?cs var:toroot ?>tools/debugging/debugging-tracing.html"><span class="en">Profiling with Traceview and dmtracedump</span></a></li>
<li><a href="<?cs var:toroot ?>tools/debugging/annotations.html"><span class="en">Improving Code Inspection with Annotations</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/debugging/systrace.html"><span class="en">Analyzing Display and Performance</span></a></li>
+ <li><a href="<?cs var:toroot ?>tools/debugging/systrace.html"><span class="en">Analyzing UI Performance</span></a></li>
<li><a href="<?cs var:toroot ?>tools/debugging/debugging-memory.html">Investigating Your RAM Usage</a></li>
<li><a href="<?cs var:toroot ?>tools/debugging/debugging-devtools.html"><span class="en">Using the Dev Tools App</span></a></li>
</ul>
diff --git a/docs/html/training/articles/perf-tips.jd b/docs/html/training/articles/perf-tips.jd
index e9df51b..4a3184c 100644
--- a/docs/html/training/articles/perf-tips.jd
+++ b/docs/html/training/articles/perf-tips.jd
@@ -427,7 +427,7 @@ Traceview.</p>
<ul>
<li><a href="{@docRoot}tools/debugging/debugging-tracing.html">Profiling with
Traceview and dmtracedump</a></li>
- <li><a href="{@docRoot}tools/debugging/systrace.html">Analysing Display and Performance
+ <li><a href="{@docRoot}tools/debugging/systrace.html">Analyzing UI Performance
with Systrace</a></li>
</ul>
diff --git a/docs/html/training/wearables/apps/always-on.jd b/docs/html/training/wearables/apps/always-on.jd
index 5bb6064..d384974 100644
--- a/docs/html/training/wearables/apps/always-on.jd
+++ b/docs/html/training/wearables/apps/always-on.jd
@@ -30,6 +30,11 @@ list as they shop at the market. Making an app constantly visible has an impact
so you should carefully consider that impact when adding this feature to your app.
</p>
+<div class="video-wrapper-left">
+<iframe src="https://www.youtube.com/embed/7m6Z9d0fDaM" frameborder="0"
+allowfullscreen></iframe>
+</div>
+
<p>Android Wear devices running Android version 5.1 or higher allow apps to remain in the
foreground while saving battery power. Android Wear apps can control what’s displayed on the
wearable device screen while the device is in a low-power ambient mode. Wear apps that run in both
diff --git a/docs/html/tv/adt-1/index.jd b/docs/html/tv/adt-1/index.jd
index 82760ed..4f62796 100644
--- a/docs/html/tv/adt-1/index.jd
+++ b/docs/html/tv/adt-1/index.jd
@@ -274,14 +274,6 @@ $ adb connect &lt;ip-address-for-adt-1&gt;:4321
starts the multi-color cycle, release the small, round button, and ADT-1 boots up. If you release
the button while the LED is flashing red, the device will be in Fastboot mode.</p>
-<p>
- <strong>There is a hardware problem with my ADT-1. How do I return it?</strong>
-</p>
-<p>You can request a return of the device using the
- <a href="https://support.google.com/googleplay/android-developer/contact/adt_rma">return
- merchandise authorization form</a>.
-</p>
-
<h2 id="emote">Android TV Remote Control App</h2>
diff --git a/graphics/java/android/graphics/drawable/Animatable2.java b/graphics/java/android/graphics/drawable/Animatable2.java
new file mode 100644
index 0000000..7c7e60e
--- /dev/null
+++ b/graphics/java/android/graphics/drawable/Animatable2.java
@@ -0,0 +1,61 @@
+/*
+ * 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 android.graphics.drawable;
+
+import android.annotation.NonNull;
+
+/**
+ * Abstract class that drawables supporting animations and callbacks should extend.
+ */
+public interface Animatable2 extends Animatable {
+
+ /**
+ * Adds a callback to listen to the animation events.
+ *
+ * @param callback Callback to add.
+ */
+ void registerAnimationCallback(@NonNull AnimationCallback callback);
+
+ /**
+ * Removes the specified animation callback.
+ *
+ * @param callback Callback to remove.
+ * @return {@code false} if callback didn't exist in the call back list, or {@code true} if
+ * callback has been removed successfully.
+ */
+ boolean unregisterAnimationCallback(@NonNull AnimationCallback callback);
+
+ /**
+ * Removes all existing animation callbacks.
+ */
+ void clearAnimationCallbacks();
+
+ public static abstract class AnimationCallback {
+ /**
+ * Called when the animation starts.
+ *
+ * @param drawable The drawable started the animation.
+ */
+ public void onAnimationStart(Drawable drawable) {};
+ /**
+ * Called when the animation ends.
+ *
+ * @param drawable The drawable finished the animation.
+ */
+ public void onAnimationEnd(Drawable drawable) {};
+ }
+}
diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
index 100c2f4..1ae10d3 100644
--- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
@@ -16,6 +16,7 @@ package android.graphics.drawable;
import android.animation.Animator;
import android.animation.AnimatorInflater;
+import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.Animator.AnimatorListener;
import android.annotation.NonNull;
@@ -42,7 +43,6 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.List;
/**
* This class uses {@link android.animation.ObjectAnimator} and
@@ -129,7 +129,7 @@ import java.util.List;
* @attr ref android.R.styleable#AnimatedVectorDrawableTarget_name
* @attr ref android.R.styleable#AnimatedVectorDrawableTarget_animation
*/
-public class AnimatedVectorDrawable extends Drawable implements Animatable {
+public class AnimatedVectorDrawable extends Drawable implements Animatable2 {
private static final String LOGTAG = "AnimatedVectorDrawable";
private static final String ANIMATED_VECTOR = "animated-vector";
@@ -153,6 +153,10 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
private boolean mMutated;
+ /** Use a internal AnimatorListener to support callbacks during animation events. */
+ private ArrayList<Animatable2.AnimationCallback> mAnimationCallbacks = null;
+ private AnimatorListener mAnimatorListener = null;
+
public AnimatedVectorDrawable() {
this(null, null);
}
@@ -380,36 +384,6 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
}
}
- /**
- * Adds a listener to the set of listeners that are sent events through the life of an
- * animation.
- *
- * @param listener the listener to be added to the current set of listeners for this animation.
- */
- public void addListener(AnimatorListener listener) {
- mAnimatorSet.addListener(listener);
- }
-
- /**
- * Removes a listener from the set listening to this animation.
- *
- * @param listener the listener to be removed from the current set of listeners for this
- * animation.
- */
- public void removeListener(AnimatorListener listener) {
- mAnimatorSet.removeListener(listener);
- }
-
- /**
- * Gets the set of {@link android.animation.Animator.AnimatorListener} objects that are currently
- * listening for events on this <code>AnimatedVectorDrawable</code> object.
- *
- * @return List<AnimatorListener> The set of listeners.
- */
- public List<AnimatorListener> getListeners() {
- return mAnimatorSet.getListeners();
- }
-
private static class AnimatedVectorDrawableState extends ConstantState {
int mChangingConfigurations;
VectorDrawable mVectorDrawable;
@@ -604,6 +578,15 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
return mAnimatorSet.isStarted();
}
+ /**
+ * Resets the AnimatedVectorDrawable to the start state as specified in the animators.
+ */
+ public void reset() {
+ // TODO: Use reverse or seek to implement reset, when AnimatorSet supports them.
+ start();
+ mAnimatorSet.cancel();
+ }
+
@Override
public void start() {
ensureAnimatorSet();
@@ -674,4 +657,77 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
unscheduleSelf(what);
}
};
-}
+
+ @Override
+ public void registerAnimationCallback(@NonNull AnimationCallback callback) {
+ if (callback == null) {
+ return;
+ }
+
+ // Add listener accordingly.
+ if (mAnimationCallbacks == null) {
+ mAnimationCallbacks = new ArrayList<>();
+ }
+
+ mAnimationCallbacks.add(callback);
+
+ if (mAnimatorListener == null) {
+ // Create a animator listener and trigger the callback events when listener is
+ // triggered.
+ mAnimatorListener = new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ ArrayList<AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks);
+ int size = tmpCallbacks.size();
+ for (int i = 0; i < size; i ++) {
+ tmpCallbacks.get(i).onAnimationStart(AnimatedVectorDrawable.this);
+ }
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ ArrayList<AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks);
+ int size = tmpCallbacks.size();
+ for (int i = 0; i < size; i ++) {
+ tmpCallbacks.get(i).onAnimationEnd(AnimatedVectorDrawable.this);
+ }
+ }
+ };
+ }
+ mAnimatorSet.addListener(mAnimatorListener);
+ }
+
+ // A helper function to clean up the animator listener in the mAnimatorSet.
+ private void removeAnimatorSetListener() {
+ if (mAnimatorListener != null) {
+ mAnimatorSet.removeListener(mAnimatorListener);
+ mAnimatorListener = null;
+ }
+ }
+
+ @Override
+ public boolean unregisterAnimationCallback(@NonNull AnimationCallback callback) {
+ if (mAnimationCallbacks == null || callback == null) {
+ // Nothing to be removed.
+ return false;
+ }
+ boolean removed = mAnimationCallbacks.remove(callback);
+
+ // When the last call back unregistered, remove the listener accordingly.
+ if (mAnimationCallbacks.size() == 0) {
+ removeAnimatorSetListener();
+ }
+ return removed;
+ }
+
+ @Override
+ public void clearAnimationCallbacks() {
+ removeAnimatorSetListener();
+ if (mAnimationCallbacks == null) {
+ return;
+ }
+
+ mAnimationCallbacks.clear();
+ }
+
+} \ No newline at end of file
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index b9f3f2a..5e205bd 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -311,6 +311,11 @@ public class VectorDrawable extends Drawable {
}
@Override
+ public ColorFilter getColorFilter() {
+ return mColorFilter;
+ }
+
+ @Override
public void setTintList(ColorStateList tint) {
final VectorDrawableState state = mVectorState;
if (state.mTint != tint) {
diff --git a/media/java/android/media/tv/DvbDeviceInfo.java b/media/java/android/media/tv/DvbDeviceInfo.java
index 1885a34..e07f3a6 100644
--- a/media/java/android/media/tv/DvbDeviceInfo.java
+++ b/media/java/android/media/tv/DvbDeviceInfo.java
@@ -16,14 +16,10 @@
package android.media.tv;
-import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
-import android.media.tv.TvInputManager;
import android.util.Log;
-import java.lang.IllegalArgumentException;
-
/**
* Simple container for information about DVB device.
* Not for third-party developers.
diff --git a/media/java/android/media/tv/ITvInputSessionWrapper.java b/media/java/android/media/tv/ITvInputSessionWrapper.java
index fed0ddf..5ad1bce 100644
--- a/media/java/android/media/tv/ITvInputSessionWrapper.java
+++ b/media/java/android/media/tv/ITvInputSessionWrapper.java
@@ -285,8 +285,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
@Override
public void timeShiftSeekTo(long timeMs) {
- mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_TIME_SHIFT_SEEK_TO,
- Long.valueOf(timeMs)));
+ mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_TIME_SHIFT_SEEK_TO, timeMs));
}
@Override
@@ -298,7 +297,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
@Override
public void timeShiftEnablePositionTracking(boolean enable) {
mCaller.executeOrSendMessage(mCaller.obtainMessageO(
- DO_TIME_SHIFT_ENABLE_POSITION_TRACKING, Boolean.valueOf(enable)));
+ DO_TIME_SHIFT_ENABLE_POSITION_TRACKING, enable));
}
private final class TvInputEventReceiver extends InputEventReceiver {
diff --git a/media/java/android/media/tv/TvContract.java b/media/java/android/media/tv/TvContract.java
index f5a6f2b..91b1a49 100644
--- a/media/java/android/media/tv/TvContract.java
+++ b/media/java/android/media/tv/TvContract.java
@@ -485,8 +485,7 @@ public final class TvContract {
/** The video resolution for ultra high-definition. */
public static final String VIDEO_RESOLUTION_UHD = "VIDEO_RESOLUTION_UHD";
- private static final Map<String, String> VIDEO_FORMAT_TO_RESOLUTION_MAP =
- new HashMap<String, String>();
+ private static final Map<String, String> VIDEO_FORMAT_TO_RESOLUTION_MAP = new HashMap<>();
static {
VIDEO_FORMAT_TO_RESOLUTION_MAP.put(VIDEO_FORMAT_480I, VIDEO_RESOLUTION_SD);
@@ -1128,7 +1127,7 @@ public final class TvContract {
/** The genre for Tech/Science. */
public static final String TECH_SCIENCE = "TECH_SCIENCE";
- private static final ArraySet<String> CANONICAL_GENRES = new ArraySet<String>();
+ private static final ArraySet<String> CANONICAL_GENRES = new ArraySet<>();
static {
CANONICAL_GENRES.add(FAMILY_KIDS);
CANONICAL_GENRES.add(SPORTS);
diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java
index 46d33b4..4b1fa13 100644
--- a/media/java/android/media/tv/TvInputInfo.java
+++ b/media/java/android/media/tv/TvInputInfo.java
@@ -626,7 +626,7 @@ public final class TvInputInfo implements Parcelable {
public static Set<String> getHiddenTvInputIds(Context context, int userId) {
String hiddenIdsString = Settings.Secure.getStringForUser(
context.getContentResolver(), Settings.Secure.TV_INPUT_HIDDEN_INPUTS, userId);
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
if (TextUtils.isEmpty(hiddenIdsString)) {
return set;
}
@@ -648,7 +648,7 @@ public final class TvInputInfo implements Parcelable {
public static Map<String, String> getCustomLabels(Context context, int userId) {
String labelsString = Settings.Secure.getStringForUser(
context.getContentResolver(), Settings.Secure.TV_INPUT_CUSTOM_LABELS, userId);
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
if (TextUtils.isEmpty(labelsString)) {
return map;
}
diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java
index 7fc19f1..01de898 100644
--- a/media/java/android/media/tv/TvInputManager.java
+++ b/media/java/android/media/tv/TvInputManager.java
@@ -221,16 +221,15 @@ public final class TvInputManager {
private final Object mLock = new Object();
// @GuardedBy("mLock")
- private final List<TvInputCallbackRecord> mCallbackRecords =
- new LinkedList<TvInputCallbackRecord>();
+ private final List<TvInputCallbackRecord> mCallbackRecords = new LinkedList<>();
// A mapping from TV input ID to the state of corresponding input.
// @GuardedBy("mLock")
- private final Map<String, Integer> mStateMap = new ArrayMap<String, Integer>();
+ private final Map<String, Integer> mStateMap = new ArrayMap<>();
// A mapping from the sequence number of a session to its SessionCallbackRecord.
private final SparseArray<SessionCallbackRecord> mSessionCallbackRecordMap =
- new SparseArray<SessionCallbackRecord>();
+ new SparseArray<>();
// A sequence number for the next session to be created. Should be protected by a lock
// {@code mSessionCallbackRecordMap}.
@@ -238,8 +237,6 @@ public final class TvInputManager {
private final ITvInputClient mClient;
- private final ITvInputManagerCallback mManagerCallback;
-
private final int mUserId;
/**
@@ -879,7 +876,7 @@ public final class TvInputManager {
}
}
};
- mManagerCallback = new ITvInputManagerCallback.Stub() {
+ ITvInputManagerCallback managerCallback = new ITvInputManagerCallback.Stub() {
@Override
public void onInputStateChanged(String inputId, int state) {
synchronized (mLock) {
@@ -921,7 +918,7 @@ public final class TvInputManager {
};
try {
if (mService != null) {
- mService.registerCallback(mManagerCallback, mUserId);
+ mService.registerCallback(managerCallback, mUserId);
List<TvInputInfo> infos = mService.getTvInputList(mUserId);
synchronized (mLock) {
for (TvInputInfo info : infos) {
@@ -985,7 +982,7 @@ public final class TvInputManager {
Log.w(TAG, "Unrecognized input ID: " + inputId);
return INPUT_STATE_DISCONNECTED;
}
- return state.intValue();
+ return state;
}
}
@@ -1076,7 +1073,7 @@ public final class TvInputManager {
@SystemApi
public List<TvContentRating> getBlockedRatings() {
try {
- List<TvContentRating> ratings = new ArrayList<TvContentRating>();
+ List<TvContentRating> ratings = new ArrayList<>();
for (String rating : mService.getBlockedRatings(mUserId)) {
ratings.add(TvContentRating.unflattenFromString(rating));
}
@@ -1334,8 +1331,8 @@ public final class TvInputManager {
// protect pending input events and the input channel.
private final InputEventHandler mHandler = new InputEventHandler(Looper.getMainLooper());
- private final Pool<PendingEvent> mPendingEventPool = new SimplePool<PendingEvent>(20);
- private final SparseArray<PendingEvent> mPendingEvents = new SparseArray<PendingEvent>(20);
+ private final Pool<PendingEvent> mPendingEventPool = new SimplePool<>(20);
+ private final SparseArray<PendingEvent> mPendingEvents = new SparseArray<>(20);
private final SparseArray<SessionCallbackRecord> mSessionCallbackRecordMap;
private IBinder mToken;
@@ -1344,11 +1341,11 @@ public final class TvInputManager {
private final Object mMetadataLock = new Object();
// @GuardedBy("mMetadataLock")
- private final List<TvTrackInfo> mAudioTracks = new ArrayList<TvTrackInfo>();
+ private final List<TvTrackInfo> mAudioTracks = new ArrayList<>();
// @GuardedBy("mMetadataLock")
- private final List<TvTrackInfo> mVideoTracks = new ArrayList<TvTrackInfo>();
+ private final List<TvTrackInfo> mVideoTracks = new ArrayList<>();
// @GuardedBy("mMetadataLock")
- private final List<TvTrackInfo> mSubtitleTracks = new ArrayList<TvTrackInfo>();
+ private final List<TvTrackInfo> mSubtitleTracks = new ArrayList<>();
// @GuardedBy("mMetadataLock")
private String mSelectedAudioTrackId;
// @GuardedBy("mMetadataLock")
@@ -1589,17 +1586,17 @@ public final class TvInputManager {
if (mAudioTracks == null) {
return null;
}
- return new ArrayList<TvTrackInfo>(mAudioTracks);
+ return new ArrayList<>(mAudioTracks);
} else if (type == TvTrackInfo.TYPE_VIDEO) {
if (mVideoTracks == null) {
return null;
}
- return new ArrayList<TvTrackInfo>(mVideoTracks);
+ return new ArrayList<>(mVideoTracks);
} else if (type == TvTrackInfo.TYPE_SUBTITLE) {
if (mSubtitleTracks == null) {
return null;
}
- return new ArrayList<TvTrackInfo>(mSubtitleTracks);
+ return new ArrayList<>(mSubtitleTracks);
}
}
throw new IllegalArgumentException("invalid type: " + type);
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index d480696..50a215c 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -27,7 +27,6 @@ import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.hardware.hdmi.HdmiDeviceInfo;
import android.media.PlaybackParams;
-import android.media.tv.TvInputService.HardwareSession;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -98,7 +97,7 @@ public abstract class TvInputService extends Service {
*/
private final Handler mServiceHandler = new ServiceHandler();
private final RemoteCallbackList<ITvInputServiceCallback> mCallbacks =
- new RemoteCallbackList<ITvInputServiceCallback>();
+ new RemoteCallbackList<>();
private TvInputManager mTvInputManager;
@@ -341,9 +340,13 @@ public abstract class TvInputService extends Service {
}
/**
- * Notifies the channel of the session is retuned by TV input.
+ * Informs the application that the current channel is re-tuned for some reason and the
+ * session now displays the content from a new channel. This is used to handle special cases
+ * such as when the current channel becomes unavailable, it is necessary to send the user to
+ * a certain channel or the user changes channel in some other way (e.g. by using a
+ * dedicated remote).
*
- * @param channelUri The URI of a channel.
+ * @param channelUri The URI of the new channel.
*/
public void notifyChannelRetuned(final Uri channelUri) {
executeOrPostRunnable(new Runnable() {
@@ -374,7 +377,7 @@ public abstract class TvInputService extends Service {
* @throws IllegalArgumentException if {@code tracks} contains redundant tracks.
*/
public void notifyTracksChanged(final List<TvTrackInfo> tracks) {
- Set<String> trackIdSet = new HashSet<String>();
+ Set<String> trackIdSet = new HashSet<>();
for (TvTrackInfo track : tracks) {
String trackId = track.getId();
if (trackIdSet.contains(trackId)) {
diff --git a/packages/PrintSpooler/res/values-zh-rCN/donottranslate.xml b/packages/PrintSpooler/res/values-zh-rCN/donottranslate.xml
deleted file mode 100644
index f069da3..0000000
--- a/packages/PrintSpooler/res/values-zh-rCN/donottranslate.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2013 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.
--->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-
- <string name="mediasize_default">PRC_9</string>
- <string name="mediasize_standard">@string/mediasize_standard_china</string>
-
-</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9f38185..a6313ad 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -341,9 +341,6 @@
<!-- The grow amount for the camera and phone circles when hinting -->
<dimen name="hint_grow_amount_sideways">60dp</dimen>
- <!-- The chevron padding to the circle when hinting -->
- <dimen name="hint_chevron_circle_padding">16dp</dimen>
-
<!-- Distance between notifications and header when they are considered to be colliding. -->
<dimen name="header_notifications_collide_distance">48dp</dimen>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 834d5dd..61ae9b9 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -644,7 +644,7 @@
<!-- QuickSettings: Wifi (Off) [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_off_label">Wi-Fi Off</string>
<!-- QuickSettings: Wifi detail panel, text when there are no items [CHAR LIMIT=NONE] -->
- <string name="quick_settings_wifi_detail_empty_text">No saved networks available</string>
+ <string name="quick_settings_wifi_detail_empty_text">No Wi-Fi networks available</string>
<!-- QuickSettings: Cast title [CHAR LIMIT=NONE] -->
<string name="quick_settings_cast_title">Cast</string>
<!-- QuickSettings: Cast detail panel, status text when casting [CHAR LIMIT=NONE] -->
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
index 08659e9..79af706 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -20,6 +20,7 @@ import android.os.Vibrator;
import android.provider.Settings;
import android.util.Log;
import android.view.Gravity;
+import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -296,13 +297,7 @@ public class AssistManager {
}
private void vibrate() {
- if (Settings.System.getIntForUser(mContext.getContentResolver(),
- Settings.System.HAPTIC_FEEDBACK_ENABLED, 1, UserHandle.USER_CURRENT) != 0) {
- Resources res = mContext.getResources();
- Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
- vibrator.vibrate(res.getInteger(R.integer.config_search_panel_view_vibration_duration),
- VIBRATION_ATTRIBUTES);
- }
+ mView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
}
public boolean isAssistantIntentAvailable() {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 0dcc0b9..86910fe 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -658,7 +658,7 @@ public class KeyguardViewMediator extends SystemUI {
mPendingLock = true;
}
- if (mPendingLock || mPendingReset) {
+ if (mPendingLock) {
playSounds(true);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
index 062ded2..6db4020 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
@@ -26,6 +26,7 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
@@ -200,7 +201,8 @@ public class TaskViewHeader extends FrameLayout {
mActivityDescription.setContentDescription(t.contentDescription);
// Try and apply the system ui tint
- int existingBgColor = getBackgroundColor();
+ int existingBgColor = (getBackground() instanceof ColorDrawable) ?
+ ((ColorDrawable) getBackground()).getColor() : 0;
if (existingBgColor != t.colorPrimary) {
mBackgroundColorDrawable.setColor(t.colorPrimary);
mBackgroundColor = t.colorPrimary;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index f05ac1a..6fb4b48 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1902,7 +1902,7 @@ public abstract class BaseStatusBar extends SystemUI implements
logUpdate(entry, n);
}
boolean applyInPlace = shouldApplyInPlace(entry, n);
- boolean shouldInterrupt = shouldInterrupt(notification);
+ boolean shouldInterrupt = shouldInterrupt(entry);
boolean alertAgain = alertAgain(entry, n);
entry.notification = notification;
@@ -2073,7 +2073,8 @@ public abstract class BaseStatusBar extends SystemUI implements
|| (newNotification.flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0;
}
- protected boolean shouldInterrupt(StatusBarNotification sbn) {
+ protected boolean shouldInterrupt(Entry entry) {
+ StatusBarNotification sbn = entry.notification;
if (mNotificationData.shouldFilterOut(sbn)) {
if (DEBUG) {
Log.d(TAG, "Skipping HUN check for " + sbn.getKey() + " since it's filtered out.");
@@ -2098,10 +2099,12 @@ public abstract class BaseStatusBar extends SystemUI implements
Notification.HEADS_UP_ALLOWED) != Notification.HEADS_UP_NEVER;
boolean accessibilityForcesLaunch = isFullscreen
&& mAccessibilityManager.isTouchExplorationEnabled();
+ boolean justLaunchedFullScreenIntent = entry.hasJustLaunchedFullScreenIntent();
boolean interrupt = (isFullscreen || (isHighPriority && (isNoisy || hasTicker)))
&& isAllowed
&& !accessibilityForcesLaunch
+ && !justLaunchedFullScreenIntent
&& mPowerManager.isScreenOn()
&& (!mStatusBarKeyguardViewManager.isShowing()
|| mStatusBarKeyguardViewManager.isOccluded())
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
index 374d970..58fb2b1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
@@ -60,22 +60,18 @@ public class KeyguardAffordanceView extends ImageView {
private final int mNormalColor;
private final ArgbEvaluator mColorInterpolator;
private final FlingAnimationUtils mFlingAnimationUtils;
- private final Drawable mArrowDrawable;
- private final int mHintChevronPadding;
private float mCircleRadius;
private int mCenterX;
private int mCenterY;
private ValueAnimator mCircleAnimator;
private ValueAnimator mAlphaAnimator;
private ValueAnimator mScaleAnimator;
- private ValueAnimator mArrowAnimator;
private float mCircleStartValue;
private boolean mCircleWillBeHidden;
private int[] mTempPoint = new int[2];
private float mImageScale;
private int mCircleColor;
private boolean mIsLeft;
- private float mArrowAlpha = 0.0f;
private View mPreviewView;
private float mCircleStartRadius;
private float mMaxCircleSize;
@@ -113,12 +109,6 @@ public class KeyguardAffordanceView extends ImageView {
mAlphaAnimator = null;
}
};
- private AnimatorListenerAdapter mArrowEndListener = new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mArrowAnimator = null;
- }
- };
public KeyguardAffordanceView(Context context) {
this(context, null);
@@ -144,17 +134,12 @@ public class KeyguardAffordanceView extends ImageView {
mInverseColor = 0xff000000;
mMinBackgroundRadius = mContext.getResources().getDimensionPixelSize(
R.dimen.keyguard_affordance_min_background_radius);
- mHintChevronPadding = mContext.getResources().getDimensionPixelSize(
- R.dimen.hint_chevron_circle_padding);
mAppearInterpolator = AnimationUtils.loadInterpolator(mContext,
android.R.interpolator.linear_out_slow_in);
mDisappearInterpolator = AnimationUtils.loadInterpolator(mContext,
android.R.interpolator.fast_out_linear_in);
mColorInterpolator = new ArgbEvaluator();
mFlingAnimationUtils = new FlingAnimationUtils(mContext, 0.3f);
- mArrowDrawable = context.getDrawable(R.drawable.ic_chevron_left);
- mArrowDrawable.setBounds(0, 0, mArrowDrawable.getIntrinsicWidth(),
- mArrowDrawable.getIntrinsicHeight());
}
@Override
@@ -169,7 +154,6 @@ public class KeyguardAffordanceView extends ImageView {
protected void onDraw(Canvas canvas) {
mSupportHardware = canvas.isHardwareAccelerated();
drawBackgroundCircle(canvas);
- drawArrow(canvas);
canvas.save();
canvas.scale(mImageScale, mImageScale, getWidth() / 2, getHeight() / 2);
super.onDraw(canvas);
@@ -183,22 +167,6 @@ public class KeyguardAffordanceView extends ImageView {
}
}
- private void drawArrow(Canvas canvas) {
- if (mArrowAlpha > 0) {
- canvas.save();
- canvas.translate(mCenterX, mCenterY);
- if (mIsLeft) {
- canvas.scale(-1.0f, 1.0f);
- }
- canvas.translate(- mCircleRadius - mHintChevronPadding
- - mArrowDrawable.getIntrinsicWidth() / 2,
- - mArrowDrawable.getIntrinsicHeight() / 2);
- mArrowDrawable.setAlpha((int) (mArrowAlpha * 255));
- mArrowDrawable.draw(canvas);
- canvas.restore();
- }
- }
-
private void updateIconColor() {
Drawable drawable = getDrawable().mutate();
float alpha = mCircleRadius / mMinBackgroundRadius;
@@ -533,36 +501,6 @@ public class KeyguardAffordanceView extends ImageView {
return mCircleRadius;
}
- public void showArrow(boolean show) {
- cancelAnimator(mArrowAnimator);
- float targetAlpha = show ? 1.0f : 0.0f;
- if (mArrowAlpha == targetAlpha) {
- return;
- }
- ValueAnimator animator = ValueAnimator.ofFloat(mArrowAlpha, targetAlpha);
- mArrowAnimator = animator;
- animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- mArrowAlpha = (float) animation.getAnimatedValue();
- invalidate();
- }
- });
- animator.addListener(mArrowEndListener);
- Interpolator interpolator = show
- ? mAppearInterpolator
- : mDisappearInterpolator;
- animator.setInterpolator(interpolator);
- float durationFactor = Math.abs(mArrowAlpha - targetAlpha);
- long duration = (long) (NORMAL_ANIMATION_DURATION * durationFactor);
- animator.setDuration(duration);
- animator.start();
- }
-
- public void setIsLeft(boolean left) {
- mIsLeft = left;
- }
-
@Override
public boolean performClick() {
if (isClickable()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 2a8b4ac..dbabe3f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar;
import android.app.Notification;
+import android.os.SystemClock;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.NotificationListenerService.RankingMap;
@@ -41,6 +42,8 @@ public class NotificationData {
private HeadsUpManager mHeadsUpManager;
public static final class Entry {
+ private static final long LAUNCH_COOLDOWN = 2000;
+ private static final long NOT_LAUNCHED_YET = -LAUNCH_COOLDOWN;
public String key;
public StatusBarNotification notification;
public StatusBarIconView icon;
@@ -49,6 +52,7 @@ public class NotificationData {
public boolean autoRedacted; // whether the redacted notification was generated by us
public boolean legacy; // whether the notification has a legacy, dark background
public int targetSdk;
+ private long lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET;
public Entry(StatusBarNotification n, StatusBarIconView ic) {
this.key = n.getKey();
@@ -72,6 +76,7 @@ public class NotificationData {
// We should fix this at some point.
autoRedacted = false;
legacy = false;
+ lastFullScreenIntentLaunchTime = NOT_LAUNCHED_YET;
if (row != null) {
row.reset();
}
@@ -92,6 +97,14 @@ public class NotificationData {
public View getPublicContentView() {
return row.getPublicLayout().getContractedChild();
}
+
+ public void notifyFullScreenIntentLaunched() {
+ lastFullScreenIntentLaunchTime = SystemClock.elapsedRealtime();
+ }
+
+ public boolean hasJustLaunchedFullScreenIntent() {
+ return SystemClock.elapsedRealtime() < lastFullScreenIntentLaunchTime + LAUNCH_COOLDOWN;
+ }
}
private final ArrayMap<String, Entry> mEntries = new ArrayMap<>();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
index 64735ee..0877ff9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
@@ -127,10 +127,8 @@ public class KeyguardAffordanceHelper {
private void initIcons() {
mLeftIcon = mCallback.getLeftIcon();
- mLeftIcon.setIsLeft(true);
mCenterIcon = mCallback.getCenterIcon();
mRightIcon = mCallback.getRightIcon();
- mRightIcon.setIsLeft(false);
updatePreviews();
}
@@ -261,7 +259,6 @@ public class KeyguardAffordanceHelper {
private void startHintAnimationPhase1(final boolean right, final Runnable onFinishedListener) {
final KeyguardAffordanceView targetView = right ? mRightIcon : mLeftIcon;
- targetView.showArrow(true);
ValueAnimator animator = getAnimatorToRadius(right, mHintGrowAmount);
animator.addListener(new AnimatorListenerAdapter() {
private boolean mCancelled;
@@ -277,7 +274,6 @@ public class KeyguardAffordanceHelper {
mSwipeAnimator = null;
mTargetedView = null;
onFinishedListener.run();
- targetView.showArrow(false);
} else {
startUnlockHintAnimationPhase2(right, onFinishedListener);
}
@@ -301,14 +297,8 @@ public class KeyguardAffordanceHelper {
public void onAnimationEnd(Animator animation) {
mSwipeAnimator = null;
mTargetedView = null;
- targetView.showArrow(false);
onFinishedListener.run();
}
-
- @Override
- public void onAnimationStart(Animator animation) {
- targetView.showArrow(false);
- }
});
animator.setInterpolator(mDisappearInterpolator);
animator.setDuration(HINT_PHASE2_DURATION);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
index d5209ea..54bd3e9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
@@ -229,10 +229,6 @@ public class PanelBar extends FrameLayout {
public void onTrackingStarted(PanelView panel) {
mTracking = true;
- if (DEBUG && panel != mTouchingPanel) {
- LOG("shouldn't happen: onTrackingStarted(%s) != mTouchingPanel(%s)",
- panel, mTouchingPanel);
- }
}
public void onTrackingStopped(PanelView panel, boolean expand) {
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 7c7bec9..984c201 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1153,7 +1153,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
if (shadeEntry == null) {
return;
}
- boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(notification);
+ boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(shadeEntry);
if (isHeadsUped) {
mHeadsUpManager.showNotification(shadeEntry);
// Mark as seen immediately
@@ -1171,6 +1171,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION,
notification.getKey());
notification.getNotification().fullScreenIntent.send();
+ shadeEntry.notifyFullScreenIntentLaunched();
} catch (PendingIntent.CanceledException e) {
}
}
@@ -2045,6 +2046,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION,
sbn.getKey());
notification.fullScreenIntent.send();
+ entry.entry.notifyFullScreenIntentLaunched();
} catch (PendingIntent.CanceledException e) {
}
}
diff --git a/rs/java/android/renderscript/ScriptGroup.java b/rs/java/android/renderscript/ScriptGroup.java
index d1a12f9..82d9a2f 100644
--- a/rs/java/android/renderscript/ScriptGroup.java
+++ b/rs/java/android/renderscript/ScriptGroup.java
@@ -131,28 +131,16 @@ public final class ScriptGroup extends BaseObj {
int i;
for (i = 0; i < args.length; i++) {
- Object obj = args[i];
fieldIDs[i] = 0;
- if (obj instanceof Input) {
- Input unbound = (Input)obj;
- unbound.addReference(this, i);
- } else {
- retrieveValueAndDependenceInfo(rs, i, args[i], values, sizes,
- depClosures, depFieldIDs);
- }
+ retrieveValueAndDependenceInfo(rs, i, null, args[i],
+ values, sizes, depClosures, depFieldIDs);
}
-
for (Map.Entry<Script.FieldID, Object> entry : globals.entrySet()) {
Object obj = entry.getValue();
Script.FieldID fieldID = entry.getKey();
fieldIDs[i] = fieldID.getID(rs);
- if (obj instanceof Input) {
- Input unbound = (Input)obj;
- unbound.addReference(this, fieldID);
- } else {
- retrieveValueAndDependenceInfo(rs, i, obj, values,
- sizes, depClosures, depFieldIDs);
- }
+ retrieveValueAndDependenceInfo(rs, i, fieldID, obj,
+ values, sizes, depClosures, depFieldIDs);
i++;
}
@@ -184,13 +172,8 @@ public final class ScriptGroup extends BaseObj {
Object obj = entry.getValue();
Script.FieldID fieldID = entry.getKey();
fieldIDs[i] = fieldID.getID(rs);
- if (obj instanceof Input) {
- Input unbound = (Input)obj;
- unbound.addReference(this, fieldID);
- } else {
- retrieveValueAndDependenceInfo(rs, i, obj, values,
- sizes, depClosures, depFieldIDs);
- }
+ retrieveValueAndDependenceInfo(rs, i, fieldID, obj, values,
+ sizes, depClosures, depFieldIDs);
i++;
}
@@ -200,9 +183,8 @@ public final class ScriptGroup extends BaseObj {
setID(id);
}
- private static
- void retrieveValueAndDependenceInfo(RenderScript rs,
- int index, Object obj,
+ private void retrieveValueAndDependenceInfo(RenderScript rs,
+ int index, Script.FieldID fid, Object obj,
long[] values, int[] sizes,
long[] depClosures,
long[] depFieldIDs) {
@@ -213,20 +195,25 @@ public final class ScriptGroup extends BaseObj {
depClosures[index] = f.getClosure().getID(rs);
Script.FieldID fieldID = f.getFieldID();
depFieldIDs[index] = fieldID != null ? fieldID.getID(rs) : 0;
- if (obj == null) {
- // Value is originally created by the owner closure
- values[index] = 0;
- sizes[index] = 0;
- return;
- }
} else {
depClosures[index] = 0;
depFieldIDs[index] = 0;
}
- ValueAndSize vs = new ValueAndSize(rs, obj);
- values[index] = vs.value;
- sizes[index] = vs.size;
+ if (obj instanceof Input) {
+ Input unbound = (Input)obj;
+ if (index < mArgs.length) {
+ unbound.addReference(this, index);
+ } else {
+ unbound.addReference(this, fid);
+ }
+ values[index] = 0;
+ sizes[index] = 0;
+ } else {
+ ValueAndSize vs = new ValueAndSize(rs, obj);
+ values[index] = vs.value;
+ sizes[index] = vs.size;
+ }
}
/**
@@ -258,7 +245,11 @@ public final class ScriptGroup extends BaseObj {
// without an associated value (reference). So this is not working for
// cross-module (cross-script) linking in this case where a field not
// explicitly bound.
- f = new Future(this, field, mBindings.get(field));
+ Object obj = mBindings.get(field);
+ if (obj instanceof Future) {
+ obj = ((Future)obj).getValue();
+ }
+ f = new Future(this, field, obj);
mGlobalFuture.put(field, f);
}
@@ -266,12 +257,18 @@ public final class ScriptGroup extends BaseObj {
}
void setArg(int index, Object obj) {
+ if (obj instanceof Future) {
+ obj = ((Future)obj).getValue();
+ }
mArgs[index] = obj;
ValueAndSize vs = new ValueAndSize(mRS, obj);
mRS.nClosureSetArg(getID(mRS), index, vs.value, vs.size);
}
void setGlobal(Script.FieldID fieldID, Object obj) {
+ if (obj instanceof Future) {
+ obj = ((Future)obj).getValue();
+ }
mBindings.put(fieldID, obj);
ValueAndSize vs = new ValueAndSize(mRS, obj);
mRS.nClosureSetGlobal(getID(mRS), fieldID.getID(mRS), vs.value, vs.size);
@@ -344,6 +341,7 @@ public final class ScriptGroup extends BaseObj {
// -1 means unset. Legal values are 0 .. n-1, where n is the number of
// arguments for the referencing closure.
List<Pair<Closure, Integer>> mArgIndex;
+ Object mValue;
Input() {
mFieldID = new ArrayList<Pair<Closure, Script.FieldID>>();
@@ -359,6 +357,7 @@ public final class ScriptGroup extends BaseObj {
}
void set(Object value) {
+ mValue = value;
for (Pair<Closure, Integer> p : mArgIndex) {
Closure closure = p.first;
int index = p.second.intValue();
@@ -370,6 +369,8 @@ public final class ScriptGroup extends BaseObj {
closure.setGlobal(fieldID, value);
}
}
+
+ Object get() { return mValue; }
}
private String mName;
@@ -434,7 +435,11 @@ public final class ScriptGroup extends BaseObj {
Object[] outputObjs = new Object[mOutputs2.length];
int i = 0;
for (Future f : mOutputs2) {
- outputObjs[i++] = f.getValue();
+ Object output = f.getValue();
+ if (output instanceof Input) {
+ output = ((Input)output).get();
+ }
+ outputObjs[i++] = output;
}
return outputObjs;
}
@@ -592,7 +597,8 @@ public final class ScriptGroup extends BaseObj {
Node n = mNodes.get(ct);
if (n.mInputs.size() == 0) {
if (n.mOutputs.size() == 0 && mNodes.size() > 1) {
- throw new RSInvalidStateException("Groups cannot contain unconnected scripts");
+ String msg = "Groups cannot contain unconnected scripts";
+ throw new RSInvalidStateException(msg);
}
validateDAGRecurse(n, ct+1);
}
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 63bbf24..af83a53 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -4411,6 +4411,8 @@ public class BackupManagerService {
* to perform one app backup per scheduled job execution, and to reschedule the job
* with zero latency as long as conditions remain right and we still have work to do.
*
+ * <p>This is the "start a full backup operation" entry point called by the scheduled job.
+ *
* @return Whether ongoing work will continue. The return value here will be passed
* along as the return value to the scheduled job's onStartJob() callback.
*/
@@ -4430,6 +4432,14 @@ public class BackupManagerService {
return false;
}
+ // Don't run the backup if we're in battery saver mode, but reschedule
+ // to try again in the not-so-distant future.
+ if (mPowerManager.isPowerSaveMode()) {
+ if (DEBUG) Slog.i(TAG, "Deferring scheduled full backups in battery saver mode");
+ FullBackupJob.schedule(mContext, KeyValueBackupJob.BATCH_INTERVAL);
+ return false;
+ }
+
if (DEBUG_SCHEDULING) {
Slog.i(TAG, "Beginning scheduled full backup operation");
}
@@ -8515,18 +8525,23 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
public void backupNow() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "backupNow");
- if (DEBUG) Slog.v(TAG, "Scheduling immediate backup pass");
- synchronized (mQueueLock) {
- // Fire the intent that kicks off the whole shebang...
- try {
- mRunBackupIntent.send();
- } catch (PendingIntent.CanceledException e) {
- // should never happen
- Slog.e(TAG, "run-backup intent cancelled!");
- }
+ if (mPowerManager.isPowerSaveMode()) {
+ if (DEBUG) Slog.v(TAG, "Not running backup while in battery save mode");
+ KeyValueBackupJob.schedule(mContext); // try again in several hours
+ } else {
+ if (DEBUG) Slog.v(TAG, "Scheduling immediate backup pass");
+ synchronized (mQueueLock) {
+ // Fire the intent that kicks off the whole shebang...
+ try {
+ mRunBackupIntent.send();
+ } catch (PendingIntent.CanceledException e) {
+ // should never happen
+ Slog.e(TAG, "run-backup intent cancelled!");
+ }
- // ...and cancel any pending scheduled job, because we've just superseded it
- KeyValueBackupJob.cancel(mContext);
+ // ...and cancel any pending scheduled job, because we've just superseded it
+ KeyValueBackupJob.cancel(mContext);
+ }
}
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 44d00d7..99c4eda 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -908,14 +908,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
// network is blocked; clone and override state
info = new NetworkInfo(info);
info.setDetailedState(DetailedState.BLOCKED, null, null);
- if (DBG) {
+ if (VDBG) {
log("returning Blocked NetworkInfo for ifname=" +
lp.getInterfaceName() + ", uid=" + uid);
}
}
if (info != null && mLockdownTracker != null) {
info = mLockdownTracker.augmentNetworkInfo(info);
- if (DBG) log("returning Locked NetworkInfo");
+ if (VDBG) log("returning Locked NetworkInfo");
}
return info;
}
diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags
index c01d816..49d4c22 100644
--- a/services/core/java/com/android/server/EventLogTags.logtags
+++ b/services/core/java/com/android/server/EventLogTags.logtags
@@ -75,6 +75,8 @@ option java_package com.android.server
27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1)
# replaces 27510 with a row per notification
27531 notification_visibility (key|3),(visibile|1),(lifespan|1),(freshness|1)
+# a notification emited noise, vibration, or light
+27532 notification_alert (key|3),(buzz|1),(beep|1),(blink|1)
# ---------------------------
# Watchdog.java
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index f6998ca..a1e2a54 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -231,14 +231,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub
// make sure this is on the same looper as our NativeDaemonConnector for sync purposes
mFgHandler = new Handler(FgThread.get().getLooper());
- if ("simulator".equals(SystemProperties.get("ro.product.device"))) {
- mConnector = null;
- mThread = null;
- mDaemonHandler = null;
- mPhoneStateListener = null;
- return;
- }
-
// Don't need this wake lock, since we now have a time stamp for when
// the network actually went inactive. (It might be nice to still do this,
// but I don't want to do it through the power manager because that pollutes the
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 64e30e5..efc38e2 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -3613,6 +3613,26 @@ public final class ActivityManagerService extends ActivityManagerNative
return procState;
}
+ @Override
+ public boolean setProcessMemoryTrimLevel(String process, int userId, int level) {
+ ProcessRecord app = getProcessRecordLocked(process, userId, true);
+ if (app == null) {
+ return false;
+ }
+ if (app.trimMemoryLevel < level && app.thread != null &&
+ (level < ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN ||
+ app.trimMemoryLevel >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN)) {
+ try {
+ app.thread.scheduleTrimMemory(level);
+ app.trimMemoryLevel = level;
+ return true;
+ } catch (RemoteException e) {
+ // Fallthrough to failure case.
+ }
+ }
+ return false;
+ }
+
private void dispatchProcessesChanged() {
int N;
synchronized (this) {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 2d15d13..72383a8 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -625,12 +625,6 @@ public class NotificationManagerService extends SystemService {
@Override
public void onNotificationVisibilityChanged(
String[] newlyVisibleKeys, String[] noLongerVisibleKeys) {
- // Using ';' as separator since eventlogs uses ',' to separate
- // args.
- // TODO remove this: b/21248682
- EventLogTags.writeNotificationVisibilityChanged(
- TextUtils.join(";", newlyVisibleKeys),
- TextUtils.join(";", noLongerVisibleKeys));
synchronized (mNotificationList) {
for (String key : newlyVisibleKeys) {
NotificationRecord r = mNotificationsByKey.get(key);
@@ -2261,7 +2255,10 @@ public class NotificationManagerService extends SystemService {
}
private void buzzBeepBlinkLocked(NotificationRecord record) {
- boolean buzzBeepBlinked = false;
+ boolean buzz = false;
+ boolean beep = false;
+ boolean blink = false;
+
final Notification notification = record.sbn.getNotification();
// Should this notification make noise, vibe, or use the LED?
@@ -2343,7 +2340,7 @@ public class NotificationManagerService extends SystemService {
+ " with attributes " + audioAttributes);
player.playAsync(soundUri, record.sbn.getUser(), looping,
audioAttributes);
- buzzBeepBlinked = true;
+ beep = true;
}
} catch (RemoteException e) {
} finally {
@@ -2383,7 +2380,7 @@ public class NotificationManagerService extends SystemService {
: mFallbackVibrationPattern,
((notification.flags & Notification.FLAG_INSISTENT) != 0)
? 0: -1, audioAttributesForNotification(notification));
- buzzBeepBlinked = true;
+ buzz = true;
} finally {
Binder.restoreCallingIdentity(identity);
}
@@ -2394,7 +2391,7 @@ public class NotificationManagerService extends SystemService {
notification.vibrate,
((notification.flags & Notification.FLAG_INSISTENT) != 0)
? 0: -1, audioAttributesForNotification(notification));
- buzzBeepBlinked = true;
+ buzz = true;
}
}
}
@@ -2408,11 +2405,13 @@ public class NotificationManagerService extends SystemService {
if (mUseAttentionLight) {
mAttentionLight.pulse();
}
- buzzBeepBlinked = true;
+ blink = true;
} else if (wasShowLights) {
updateLightsLocked();
}
- if (buzzBeepBlinked) {
+ if (buzz || beep || blink) {
+ EventLogTags.writeNotificationAlert(record.getKey(),
+ buzz ? 1 : 0, beep ? 1 : 0, blink ? 1 : 0);
mHandler.post(mBuzzBeepBlinked);
}
}
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 46793b9..8f8b1a4 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -4093,7 +4093,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// If the device has a chin (e.g. some watches), a dead area at the bottom of the screen we
// need to provide information to the clients that want to pretend that you can draw there.
- if (isDefaultDisplay && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) {
+ // We only want to apply outsets to certain types of windows. For example, we never want to
+ // apply the outsets to floating dialogs, because they wouldn't make sense there.
+ final boolean useOutsets = attrs.type == TYPE_WALLPAPER
+ || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN
+ | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0;
+ if (isDefaultDisplay && useOutsets) {
osf = mTmpOutsetFrame;
osf.set(cf.left, cf.top, cf.right, cf.bottom);
int outset = ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources());
diff --git a/services/core/java/com/android/server/tv/TvInputHardwareManager.java b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
index ac8ad30..444969f 100644
--- a/services/core/java/com/android/server/tv/TvInputHardwareManager.java
+++ b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
@@ -88,7 +88,6 @@ class TvInputHardwareManager implements TvInputHal.Callback {
private final Map<String, TvInputInfo> mInputMap = new ArrayMap<>();
private final AudioManager mAudioManager;
- private IHdmiControlService mHdmiControlService;
private final IHdmiHotplugEventListener mHdmiHotplugEventListener =
new HdmiHotplugEventListener();
private final IHdmiDeviceEventListener mHdmiDeviceEventListener = new HdmiDeviceEventListener();
@@ -121,15 +120,15 @@ class TvInputHardwareManager implements TvInputHal.Callback {
public void onBootPhase(int phase) {
if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
- mHdmiControlService = IHdmiControlService.Stub.asInterface(ServiceManager.getService(
- Context.HDMI_CONTROL_SERVICE));
- if (mHdmiControlService != null) {
+ IHdmiControlService hdmiControlService = IHdmiControlService.Stub.asInterface(
+ ServiceManager.getService(Context.HDMI_CONTROL_SERVICE));
+ if (hdmiControlService != null) {
try {
- mHdmiControlService.addHotplugEventListener(mHdmiHotplugEventListener);
- mHdmiControlService.addDeviceEventListener(mHdmiDeviceEventListener);
- mHdmiControlService.addSystemAudioModeChangeListener(
+ hdmiControlService.addHotplugEventListener(mHdmiHotplugEventListener);
+ hdmiControlService.addDeviceEventListener(mHdmiDeviceEventListener);
+ hdmiControlService.addSystemAudioModeChangeListener(
mHdmiSystemAudioModeChangeListener);
- mHdmiDeviceList.addAll(mHdmiControlService.getInputDevices());
+ mHdmiDeviceList.addAll(hdmiControlService.getInputDevices());
} catch (RemoteException e) {
Slog.w(TAG, "Error registering listeners to HdmiControlService:", e);
}
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 60bbc48..5995e9c 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -34,11 +34,11 @@ import android.view.animation.ClipRectAnimation;
import android.view.animation.ClipRectLRAnimation;
import android.view.animation.ClipRectTBAnimation;
import android.view.animation.Interpolator;
-import android.view.animation.LinearInterpolator;
+import android.view.animation.PathInterpolator;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
-import android.view.animation.TranslateXAnimation;
import android.view.animation.TranslateYAnimation;
+
import com.android.internal.util.DumpUtils.Dump;
import com.android.server.AttributeCache;
import com.android.server.wm.WindowManagerService.H;
@@ -47,28 +47,28 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import static android.view.WindowManagerInternal.AppTransitionListener;
-import static com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_launchTaskBehindSourceAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation;
import static com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation;
-import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation;
import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
+import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
// State management of app transitions. When we are preparing for a
// transition, mNextAppTransition will be the kind of transition to
@@ -80,7 +80,7 @@ public class AppTransition implements Dump {
private static final boolean DEBUG_APP_TRANSITIONS =
WindowManagerService.DEBUG_APP_TRANSITIONS;
private static final boolean DEBUG_ANIM = WindowManagerService.DEBUG_ANIM;
-
+ private static final int CLIP_REVEAL_TRANSLATION_Y_DP = 8;
/** Not set up for a transition. */
public static final int TRANSIT_UNSET = -1;
@@ -121,13 +121,13 @@ public class AppTransition implements Dump {
public static final int TRANSIT_TASK_IN_PLACE = 17;
/** Fraction of animation at which the recents thumbnail stays completely transparent */
- private static final float RECENTS_THUMBNAIL_FADEIN_FRACTION = 0.7f;
+ private static final float RECENTS_THUMBNAIL_FADEIN_FRACTION = 0.5f;
/** Fraction of animation at which the recents thumbnail becomes completely transparent */
- private static final float RECENTS_THUMBNAIL_FADEOUT_FRACTION = 0.3f;
+ private static final float RECENTS_THUMBNAIL_FADEOUT_FRACTION = 0.5f;
- private static final int DEFAULT_APP_TRANSITION_DURATION = 250;
- private static final int THUMBNAIL_APP_TRANSITION_DURATION = 325;
- private static final int THUMBNAIL_APP_TRANSITION_ALPHA_DURATION = 325;
+ private static final int DEFAULT_APP_TRANSITION_DURATION = 336;
+ private static final int THUMBNAIL_APP_TRANSITION_DURATION = 336;
+ private static final int THUMBNAIL_APP_TRANSITION_ALPHA_DURATION = 336;
private final Context mContext;
private final Handler mH;
@@ -179,8 +179,14 @@ public class AppTransition implements Dump {
private final Interpolator mThumbnailFadeInInterpolator;
private final Interpolator mThumbnailFadeOutInterpolator;
private final Interpolator mLinearOutSlowInInterpolator;
- private final Interpolator mFastOutSlowInInterpolator;
- private final LinearInterpolator mLinearInterpolator;
+ private final Interpolator mFastOutLinearInInterpolator;
+ private final Interpolator mClipHorizontalInterpolator = new PathInterpolator(0, 0, 0.4f, 1f);
+
+ /** Interpolator to be used for animations that respond directly to a touch */
+ private final Interpolator mTouchResponseInterpolator =
+ new PathInterpolator(0.3f, 0f, 0.1f, 1f);
+
+ private final int mClipRevealTranslationY;
private int mCurrentUserId = 0;
@@ -191,9 +197,8 @@ public class AppTransition implements Dump {
mH = h;
mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
com.android.internal.R.interpolator.linear_out_slow_in);
- mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
- com.android.internal.R.interpolator.fast_out_slow_in);
- mLinearInterpolator = new LinearInterpolator();
+ mFastOutLinearInInterpolator = AnimationUtils.loadInterpolator(context,
+ com.android.internal.R.interpolator.fast_out_linear_in);
mConfigShortAnimTime = context.getResources().getInteger(
com.android.internal.R.integer.config_shortAnimTime);
mDecelerateInterpolator = AnimationUtils.loadInterpolator(context,
@@ -205,8 +210,9 @@ public class AppTransition implements Dump {
if (input < RECENTS_THUMBNAIL_FADEIN_FRACTION) {
return 0f;
}
- return (input - RECENTS_THUMBNAIL_FADEIN_FRACTION) /
+ float t = (input - RECENTS_THUMBNAIL_FADEIN_FRACTION) /
(1f - RECENTS_THUMBNAIL_FADEIN_FRACTION);
+ return mFastOutLinearInInterpolator.getInterpolation(t);
}
};
mThumbnailFadeOutInterpolator = new Interpolator() {
@@ -214,11 +220,14 @@ public class AppTransition implements Dump {
public float getInterpolation(float input) {
// Linear response for first fraction, then complete after that.
if (input < RECENTS_THUMBNAIL_FADEOUT_FRACTION) {
- return input / RECENTS_THUMBNAIL_FADEOUT_FRACTION;
+ float t = input / RECENTS_THUMBNAIL_FADEOUT_FRACTION;
+ return mLinearOutSlowInInterpolator.getInterpolation(t);
}
return 1f;
}
};
+ mClipRevealTranslationY = (int) (CLIP_REVEAL_TRANSLATION_Y_DP
+ * mContext.getResources().getDisplayMetrics().density);
}
boolean isTransitionSet() {
@@ -507,47 +516,47 @@ public class AppTransition implements Dump {
if (enter) {
// Reveal will expand and move faster in horizontal direction
- // Start from upper left of start and move to final position
final int appWidth = appFrame.width();
final int appHeight = appFrame.height();
- // Start from size of launch icon, expand to full width/height
+ float t = 0f;
+ if (appHeight > 0) {
+ t = (float) mNextAppTransitionStartY / appHeight;
+ }
+ int translationY = mClipRevealTranslationY
+ + (int)(appHeight / 7f * t);
+
+ int centerX = mNextAppTransitionStartX + mNextAppTransitionStartWidth / 2;
+ int centerY = mNextAppTransitionStartY + mNextAppTransitionStartHeight / 2;
+
+ // Clip third of the from size of launch icon, expand to full width/height
Animation clipAnimLR = new ClipRectLRAnimation(
- (appWidth - mNextAppTransitionStartWidth) / 2,
- (appWidth + mNextAppTransitionStartWidth) / 2, 0, appWidth);
- clipAnimLR.setInterpolator(mLinearOutSlowInInterpolator);
- clipAnimLR.setDuration(DEFAULT_APP_TRANSITION_DURATION);
+ centerX - mNextAppTransitionStartWidth / 3,
+ centerX + mNextAppTransitionStartWidth / 3,
+ 0, appWidth);
+ clipAnimLR.setInterpolator(mClipHorizontalInterpolator);
+ clipAnimLR.setDuration((long) (DEFAULT_APP_TRANSITION_DURATION / 2.5f));
Animation clipAnimTB = new ClipRectTBAnimation(
- (appHeight - mNextAppTransitionStartHeight) / 2,
- (appHeight + mNextAppTransitionStartHeight) / 2, 0, appHeight);
- clipAnimTB.setInterpolator(mFastOutSlowInInterpolator);
+ centerY - mNextAppTransitionStartHeight / 3 - translationY,
+ centerY + mNextAppTransitionStartHeight / 3 - translationY,
+ 0, appHeight);
+ clipAnimTB.setInterpolator(mTouchResponseInterpolator);
clipAnimTB.setDuration(DEFAULT_APP_TRANSITION_DURATION);
- // Start from middle of launch icon area, move to 0, 0
- int startMiddleX = mNextAppTransitionStartX +
- (mNextAppTransitionStartWidth - appWidth) / 2 - appFrame.left;
- int startMiddleY = mNextAppTransitionStartY +
- (mNextAppTransitionStartHeight - appHeight) / 2 - appFrame.top;
-
- TranslateXAnimation translateX = new TranslateXAnimation(
- Animation.ABSOLUTE, startMiddleX, Animation.ABSOLUTE, 0);
- translateX.setInterpolator(mLinearOutSlowInInterpolator);
- translateX.setDuration(DEFAULT_APP_TRANSITION_DURATION);
TranslateYAnimation translateY = new TranslateYAnimation(
- Animation.ABSOLUTE, startMiddleY, Animation.ABSOLUTE, 0);
- translateY.setInterpolator(mFastOutSlowInInterpolator);
+ Animation.ABSOLUTE, translationY, Animation.ABSOLUTE, 0);
+ translateY.setInterpolator(mLinearOutSlowInInterpolator);
translateY.setDuration(DEFAULT_APP_TRANSITION_DURATION);
// Quick fade-in from icon to app window
- final int alphaDuration = 100;
- AlphaAnimation alpha = new AlphaAnimation(0.1f, 1);
+ final int alphaDuration = DEFAULT_APP_TRANSITION_DURATION / 4;
+ AlphaAnimation alpha = new AlphaAnimation(0.5f, 1);
alpha.setDuration(alphaDuration);
- alpha.setInterpolator(mLinearInterpolator);
+ alpha.setInterpolator(mLinearOutSlowInInterpolator);
AnimationSet set = new AnimationSet(false);
set.addAnimation(clipAnimLR);
set.addAnimation(clipAnimTB);
- set.addAnimation(translateX);
set.addAnimation(translateY);
set.addAnimation(alpha);
set.initialize(appWidth, appHeight, appWidth, appHeight);
@@ -657,14 +666,14 @@ public class AppTransition implements Dump {
Animation scale = new ScaleAnimation(1f, scaleW, 1f, scaleW,
mNextAppTransitionStartX + (thumbWidth / 2f),
mNextAppTransitionStartY + (thumbHeight / 2f));
- scale.setInterpolator(mFastOutSlowInInterpolator);
+ scale.setInterpolator(mTouchResponseInterpolator);
scale.setDuration(THUMBNAIL_APP_TRANSITION_DURATION);
Animation alpha = new AlphaAnimation(1, 0);
alpha.setInterpolator(mThumbnailFadeOutInterpolator);
alpha.setDuration(THUMBNAIL_APP_TRANSITION_ALPHA_DURATION);
Animation translate = new TranslateAnimation(0, 0, 0, -unscaledStartY +
mNextAppTransitionInsets.top);
- translate.setInterpolator(mFastOutSlowInInterpolator);
+ translate.setInterpolator(mTouchResponseInterpolator);
translate.setDuration(THUMBNAIL_APP_TRANSITION_DURATION);
// This AnimationSet uses the Interpolators assigned above.
@@ -678,14 +687,14 @@ public class AppTransition implements Dump {
Animation scale = new ScaleAnimation(scaleW, 1f, scaleW, 1f,
mNextAppTransitionStartX + (thumbWidth / 2f),
mNextAppTransitionStartY + (thumbHeight / 2f));
- scale.setInterpolator(mFastOutSlowInInterpolator);
+ scale.setInterpolator(mTouchResponseInterpolator);
scale.setDuration(THUMBNAIL_APP_TRANSITION_DURATION);
Animation alpha = new AlphaAnimation(0f, 1f);
alpha.setInterpolator(mThumbnailFadeInInterpolator);
alpha.setDuration(THUMBNAIL_APP_TRANSITION_ALPHA_DURATION);
Animation translate = new TranslateAnimation(0, 0, -unscaledStartY +
mNextAppTransitionInsets.top, 0);
- translate.setInterpolator(mFastOutSlowInInterpolator);
+ translate.setInterpolator(mTouchResponseInterpolator);
translate.setDuration(THUMBNAIL_APP_TRANSITION_DURATION);
// This AnimationSet uses the Interpolators assigned above.
@@ -697,7 +706,7 @@ public class AppTransition implements Dump {
}
return prepareThumbnailAnimationWithDuration(a, appWidth, appHeight, 0,
- mFastOutSlowInInterpolator);
+ mTouchResponseInterpolator);
}
/**
@@ -833,7 +842,7 @@ public class AppTransition implements Dump {
int duration = Math.max(THUMBNAIL_APP_TRANSITION_ALPHA_DURATION,
THUMBNAIL_APP_TRANSITION_DURATION);
return prepareThumbnailAnimationWithDuration(a, appWidth, appHeight, duration,
- mFastOutSlowInInterpolator);
+ mTouchResponseInterpolator);
}
/**
@@ -941,6 +950,16 @@ public class AppTransition implements Dump {
return prepareThumbnailAnimation(a, appWidth, appHeight, transit);
}
+ /**
+ * @return true if and only if the first frame of the transition can be skipped, i.e. the first
+ * frame of the transition doesn't change the visuals on screen, so we can start
+ * directly with the second one
+ */
+ boolean canSkipFirstFrame() {
+ return mNextAppTransitionType != NEXT_TRANSIT_TYPE_CUSTOM
+ && mNextAppTransitionType != NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE
+ && mNextAppTransitionType != NEXT_TRANSIT_TYPE_CLIP_REVEAL;
+ }
Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter,
int appWidth, int appHeight, int orientation, Rect containingFrame, Rect contentInsets,
diff --git a/services/core/java/com/android/server/wm/AppWindowAnimator.java b/services/core/java/com/android/server/wm/AppWindowAnimator.java
index 2e89385..df7b23d 100644
--- a/services/core/java/com/android/server/wm/AppWindowAnimator.java
+++ b/services/core/java/com/android/server/wm/AppWindowAnimator.java
@@ -24,6 +24,7 @@ import static com.android.server.wm.WindowManagerService.TYPE_LAYER_OFFSET;
import android.graphics.Matrix;
import android.util.Slog;
import android.util.TimeUtils;
+import android.view.Choreographer;
import android.view.Display;
import android.view.SurfaceControl;
import android.view.WindowManagerPolicy;
@@ -89,6 +90,8 @@ public class AppWindowAnimator {
* See {@link #transferCurrentAnimation}*/
boolean usingTransferredAnimation = false;
+ private boolean mSkipFirstFrame = false;
+
static final Animation sDummyAnimation = new DummyAnimation();
public AppWindowAnimator(final AppWindowToken atoken) {
@@ -97,7 +100,7 @@ public class AppWindowAnimator {
mAnimator = atoken.mAnimator;
}
- public void setAnimation(Animation anim, int width, int height) {
+ public void setAnimation(Animation anim, int width, int height, boolean skipFirstFrame) {
if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting animation in " + mAppToken
+ ": " + anim + " wxh=" + width + "x" + height
+ " isVisible=" + mAppToken.isVisible());
@@ -125,6 +128,8 @@ public class AppWindowAnimator {
transformation.setAlpha(mAppToken.isVisible() ? 1 : 0);
hasTransformation = true;
+ this.mSkipFirstFrame = skipFirstFrame;
+
if (!mAppToken.appFullscreen) {
anim.setBackgroundColor(0);
}
@@ -271,6 +276,18 @@ public class AppWindowAnimator {
return hasMoreFrames;
}
+ private long getStartTimeCorrection() {
+ if (mSkipFirstFrame) {
+
+ // If the transition is an animation in which the first frame doesn't change the screen
+ // contents at all, we can just skip it and start at the second frame. So we shift the
+ // start time of the animation forward by minus the frame duration.
+ return -Choreographer.getInstance().getFrameIntervalNanos() / TimeUtils.NANOS_PER_MS;
+ } else {
+ return 0;
+ }
+ }
+
// This must be called while inside a transaction.
boolean stepAnimationLocked(long currentTime, final int displayId) {
if (mService.okToDisplay()) {
@@ -292,12 +309,14 @@ public class AppWindowAnimator {
" @ " + currentTime + " scale="
+ mService.getTransitionAnimationScaleLocked()
+ " allDrawn=" + mAppToken.allDrawn + " animating=" + animating);
- animation.setStartTime(currentTime);
+ long correction = getStartTimeCorrection();
+ animation.setStartTime(currentTime + correction);
animating = true;
if (thumbnail != null) {
thumbnail.show();
- thumbnailAnimation.setStartTime(currentTime);
+ thumbnailAnimation.setStartTime(currentTime + correction);
}
+ mSkipFirstFrame = false;
}
if (stepAnimation(currentTime)) {
// animation isn't over, step any thumbnail and that's
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 6b5c224..38e2765 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -3489,7 +3489,8 @@ public class WindowManagerService extends IWindowManager.Stub
}
Slog.v(TAG, "Loaded animation " + a + " for " + atoken, e);
}
- atoken.mAppAnimator.setAnimation(a, width, height);
+ atoken.mAppAnimator.setAnimation(a, width, height,
+ mAppTransition.canSkipFirstFrame());
}
} else {
atoken.mAppAnimator.clearAnimation();
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index ff748f2..825ef1a 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -6395,18 +6395,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
PackageManager packageManager = mContext.getPackageManager();
switch (grantState) {
case DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED: {
- packageManager.grantRuntimePermission(packageName, permission, user);
packageManager.updatePermissionFlags(permission, packageName,
PackageManager.FLAG_PERMISSION_POLICY_FIXED,
PackageManager.FLAG_PERMISSION_POLICY_FIXED, user);
+ packageManager.grantRuntimePermission(packageName, permission, user);
} break;
case DevicePolicyManager.PERMISSION_GRANT_STATE_DENIED: {
- packageManager.revokeRuntimePermission(packageName,
- permission, user);
packageManager.updatePermissionFlags(permission, packageName,
PackageManager.FLAG_PERMISSION_POLICY_FIXED,
PackageManager.FLAG_PERMISSION_POLICY_FIXED, user);
+ packageManager.revokeRuntimePermission(packageName,
+ permission, user);
} break;
case DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT: {
@@ -6428,14 +6428,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
String permission) throws RemoteException {
PackageManager packageManager = mContext.getPackageManager();
- // Do this before clearing the caller's identity
- int granted = packageManager.checkPermission(permission, packageName);
-
UserHandle user = Binder.getCallingUserHandle();
synchronized (this) {
getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER);
long ident = Binder.clearCallingIdentity();
try {
+ int granted = AppGlobals.getPackageManager().checkPermission(permission,
+ packageName, user.getIdentifier());
int permFlags = packageManager.getPermissionFlags(permission, packageName, user);
if ((permFlags & PackageManager.FLAG_PERMISSION_POLICY_FIXED)
!= PackageManager.FLAG_PERMISSION_POLICY_FIXED) {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 353bb5f..ccfaca7 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -62,7 +62,7 @@ public class CarrierConfigManager {
* effectively disable the "Sim network lock" feature.
*/
public static final String
- BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events";
+ KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL = "ignore_sim_network_locked_events_bool";
/**
* Flag indicating whether the Phone app should provide a "Dismiss" button on the SIM network
@@ -72,10 +72,10 @@ public class CarrierConfigManager {
* you don't know the PIN.)
*/
public static final String
- BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss";
+ KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
/** Flag indicating if the phone is a world phone */
- public static final String BOOL_WORLD_PHONE = "bool_world_phone";
+ public static final String KEY_WORLD_PHONE_BOOL = "world_phone_bool";
/**
* If true, enable vibration (haptic feedback) for key presses in the EmergencyDialer activity.
@@ -84,30 +84,30 @@ public class CarrierConfigManager {
* from config.xml under apps/Contacts.
*/
public static final String
- BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration";
+ KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL = "key_enable_dialer_vibration_bool";
/** Flag indicating if dtmf tone type is enabled */
- public static final String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled";
+ public static final String KEY_DTMF_TYPE_ENABLED_BOOL = "dtmf_type_enabled_bool";
/** Flag indicating if auto retry is enabled */
- public static final String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled";
+ public static final String KEY_AUTO_RETRY_ENABLED_BOOL = "auto_retry_enabled_bool";
/**
* Determine whether we want to play local DTMF tones in a call, or just let the radio/BP handle
* playing of the tones.
*/
- public static final String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones";
+ public static final String KEY_ALLOW_LOCAL_DTMF_TONES_BOOL = "allow_local_dtmf_tones_bool";
/**
* If true, show an onscreen "Dial" button in the dialer. In practice this is used on all
* platforms, even the ones with hard SEND/END keys, but for maximum flexibility it's controlled
* by a flag here (which can be overridden on a per-product basis.)
*/
- public static final String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button";
+ public static final String KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL = "show_onscreen_dial_button_bool";
/** Determines if device implements a noise suppression device for in call audio. */
public static final String
- BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression";
+ KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL = "has_in_call_noise_suppression_bool";
/**
* Determines if the current device should allow emergency numbers to be logged in the Call Log.
@@ -121,29 +121,29 @@ public class CarrierConfigManager {
* emergency numbers.
*/
public static final String
- BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log";
+ KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL = "allow_emergency_numbers_in_call_log_bool";
/** If true, removes the Voice Privacy option from Call Settings */
- public static final String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable";
+ public static final String KEY_VOICE_PRIVACY_DISABLE_BOOL = "voice_privacy_disable_bool";
/** Control whether users can reach the carrier portions of Cellular Network Settings. */
public static final String
- BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings";
+ KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool";
/** Control whether users can edit APNs in Settings. */
- public static final String BOOL_APN_EXPAND = "bool_apn_expand";
+ public static final String KEY_APN_EXPAND_BOOL = "apn_expand_bool";
/** Control whether users can choose a network operator. */
- public static final String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand";
+ public static final String KEY_OPERATOR_SELECTION_EXPAND_BOOL = "operator_selection_expand_bool";
/** Used in Cellular Network Settings for preferred network type. */
- public static final String BOOL_PREFER_2G = "bool_prefer_2g";
+ public static final String KEY_PREFER_2G_BOOL = "prefer_2g_bool";
/** Show cdma network mode choices 1x, 3G, global etc. */
- public static final String BOOL_SHOW_CDMA_CHOICES = "bool_show_cdma_choices";
+ public static final String KEY_SHOW_CDMA_CHOICES_BOOL = "show_cdma_choices_bool";
/** CDMA activation goes through HFA */
- public static final String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning";
+ public static final String KEY_USE_HFA_FOR_PROVISIONING_BOOL = "use_hfa_for_provisioning_bool";
/**
* CDMA activation goes through OTASP.
@@ -151,51 +151,51 @@ public class CarrierConfigManager {
* TODO: This should be combined with config_use_hfa_for_provisioning and implemented as an enum
* (NONE, HFA, OTASP).
*/
- public static final String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning";
+ public static final String KEY_USE_OTASP_FOR_PROVISIONING_BOOL = "use_otasp_for_provisioning_bool";
/** Display carrier settings menu if true */
- public static final String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable";
+ public static final String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";
/** Does not display additional call seting for IMS phone based on GSM Phone */
- public static final String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting";
+ public static final String KEY_ADDITIONAL_CALL_SETTING_BOOL = "additional_call_setting_bool";
/** Show APN Settings for some CDMA carriers */
- public static final String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma";
+ public static final String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
/** After a CDMA conference call is merged, the swap button should be displayed. */
- public static final String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge";
+ public static final String KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL = "support_swap_after_merge_bool";
/**
* Determine whether the voicemail notification is persistent in the notification bar. If true,
* the voicemail notifications cannot be dismissed from the notification bar.
*/
public static final String
- BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent";
+ KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL = "voicemail_notification_persistent_bool";
/** For IMS video over LTE calls, determines whether video pause signalling is supported. */
public static final String
- BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls";
+ KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL = "support_pause_ims_video_calls_bool";
/**
* Disables dialing "*228" (OTASP provisioning) on CDMA carriers where it is not supported or is
* potentially harmful by locking the SIM to 3G.
*/
public static final String
- BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code";
+ KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool";
/**
* Flag specifying whether VoLTE 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 BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available";
+ public static final String KEY_CARRIER_VOLTE_AVAILABLE_BOOL = "carrier_volte_available_bool";
/** Flag specifying whether VoLTE availability is based on provisioning. */
- public static final String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned";
+ public static final String KEY_CARRIER_VOLTE_PROVISIONED_BOOL = "carrier_volte_provisioned_bool";
/** Flag specifying whether VoLTE TTY is supported. */
- public static final String BOOL_CARRIER_VOLTE_TTY_SUPPORTED
- = "bool_carrier_volte_tty_supported";
+ public static final String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL
+ = "carrier_volte_tty_supported_bool";
/**
* If Voice Radio Technology is RIL_RADIO_TECHNOLOGY_LTE:14 or RIL_RADIO_TECHNOLOGY_UNKNOWN:0
@@ -203,7 +203,7 @@ public class CarrierConfigManager {
* RIL_RADIO_TECHNOLOGY_UNKNOWN:0 means there is no replacement value and that the default
* assumption for phone type (GSM) should be used.
*/
- public static final String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat";
+ public static final String KEY_VOLTE_REPLACEMENT_RAT_INT = "volte_replacement_rat_int";
/* The following 3 fields are related to carrier visual voicemail. */
@@ -212,14 +212,14 @@ public class CarrierConfigManager {
*
* @hide
*/
- public static final String STRING_VVM_DESTINATION_NUMBER = "string_vvm_destination_number";
+ public static final String KEY_VVM_DESTINATION_NUMBER_STRING = "vvm_destination_number_string";
/**
* The port through which the MO sms messages are sent through.
*
* @hide
*/
- public static final String INT_VVM_PORT_NUMBER = "int_vvm_port_number";
+ public static final String KEY_VVM_PORT_NUMBER_INT = "vvm_port_number_int";
/**
* The type of visual voicemail protocol the carrier adheres to. See {@link TelephonyManager}
@@ -227,7 +227,7 @@ public class CarrierConfigManager {
*
* @hide
*/
- public static final String STRING_VVM_TYPE = "string_vvm_type";
+ public static final String KEY_VVM_TYPE_STRING = "vvm_type_string";
/**
* The package name of the carrier's visual voicemail app to ensure that dialer visual voicemail
@@ -235,112 +235,113 @@ public class CarrierConfigManager {
*
* @hide
*/
- public static final String STRING_CARRIER_VVM_PACKAGE_NAME = "string_carrier_vvm_package_name";
+ public static final String KEY_CARRIER_VVM_PACKAGE_NAME_STRING = "carrier_vvm_package_name_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 BOOL_MMS_ALIAS_ENABLED = "aliasEnabled";
- public static final String BOOL_MMS_ALLOW_ATTACH_AUDIO = "allowAttachAudio";
- public static final String BOOL_MMS_APPEND_TRANSACTION_ID = "enabledTransID";
- public static final String BOOL_MMS_GROUP_MMS_ENABLED = "enableGroupMms";
- public static final String BOOL_MMS_MMS_DELIVERY_REPORT_ENABLED = "enableMMSDeliveryReports";
- public static final String BOOL_MMS_MMS_ENABLED = "enabledMMS";
- public static final String BOOL_MMS_MMS_READ_REPORT_ENABLED = "enableMMSReadReports";
- public static final String BOOL_MMS_MULTIPART_SMS_ENABLED = "enableMultipartSMS";
- public static final String BOOL_MMS_NOTIFY_WAP_MMSC_ENABLED = "enabledNotifyWapMMSC";
- public static final String BOOL_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES = "sendMultipartSmsAsSeparateMessages";
- public static final String BOOL_MMS_SHOW_CELL_BROADCAST_APP_LINKS = "config_cellBroadcastAppLinks";
- public static final String BOOL_MMS_SMS_DELIVERY_REPORT_ENABLED = "enableSMSDeliveryReports";
- public static final String BOOL_MMS_SUPPORT_HTTP_CHARSET_HEADER = "supportHttpCharsetHeader";
- public static final String BOOL_MMS_SUPPORT_MMS_CONTENT_DISPOSITION = "supportMmsContentDisposition";
- public static final String INT_MMS_ALIAS_MAX_CHARS = "aliasMaxChars";
- public static final String INT_MMS_ALIAS_MIN_CHARS = "aliasMinChars";
- public static final String INT_MMS_HTTP_SOCKET_TIMEOUT = "httpSocketTimeout";
- public static final String INT_MMS_MAX_IMAGE_HEIGHT = "maxImageHeight";
- public static final String INT_MMS_MAX_IMAGE_WIDTH = "maxImageWidth";
- public static final String INT_MMS_MAX_MESSAGE_SIZE = "maxMessageSize";
- public static final String INT_MMS_MESSAGE_TEXT_MAX_SIZE = "maxMessageTextSize";
- public static final String INT_MMS_RECIPIENT_LIMIT = "recipientLimit";
- public static final String INT_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD = "smsToMmsTextLengthThreshold";
- public static final String INT_MMS_SMS_TO_MMS_TEXT_THRESHOLD = "smsToMmsTextThreshold";
- public static final String INT_MMS_SUBJECT_MAX_LENGTH = "maxSubjectLength";
- public static final String STRING_MMS_EMAIL_GATEWAY_NUMBER = "emailGatewayNumber";
- public static final String STRING_MMS_HTTP_PARAMS = "httpParams";
- public static final String STRING_MMS_NAI_SUFFIX = "naiSuffix";
- public static final String STRING_MMS_UA_PROF_TAG_NAME = "uaProfTagName";
- public static final String STRING_MMS_UA_PROF_URL = "uaProfUrl";
- public static final String STRING_MMS_USER_AGENT = "userAgent";
+ public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
+ public static final String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
+ public static final String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
+ public static final String KEY_MMS_GROUP_MMS_ENABLED_BOOL = "enableGroupMms";
+ public static final String KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL = "enableMMSDeliveryReports";
+ public static final String KEY_MMS_MMS_ENABLED_BOOL = "enabledMMS";
+ public static final String KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL = "enableMMSReadReports";
+ public static final String KEY_MMS_MULTIPART_SMS_ENABLED_BOOL = "enableMultipartSMS";
+ public static final String KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL = "enabledNotifyWapMMSC";
+ public static final String KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL = "sendMultipartSmsAsSeparateMessages";
+ public static final String KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL = "config_cellBroadcastAppLinks";
+ public static final String KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL = "enableSMSDeliveryReports";
+ public static final String KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL = "supportHttpCharsetHeader";
+ public static final String KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL = "supportMmsContentDisposition";
+ public static final String KEY_MMS_ALIAS_MAX_CHARS_INT = "aliasMaxChars";
+ public static final String KEY_MMS_ALIAS_MIN_CHARS_INT = "aliasMinChars";
+ public static final String KEY_MMS_HTTP_SOCKET_TIMEOUT_INT = "httpSocketTimeout";
+ public static final String KEY_MMS_MAX_IMAGE_HEIGHT_INT = "maxImageHeight";
+ public static final String KEY_MMS_MAX_IMAGE_WIDTH_INT = "maxImageWidth";
+ public static final String KEY_MMS_MAX_MESSAGE_SIZE_INT = "maxMessageSize";
+ public static final String KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT = "maxMessageTextSize";
+ public static final String KEY_MMS_RECIPIENT_LIMIT_INT = "recipientLimit";
+ public static final String KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT = "smsToMmsTextLengthThreshold";
+ public static final String KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT = "smsToMmsTextThreshold";
+ public static final String KEY_MMS_SUBJECT_MAX_LENGTH_INT = "maxSubjectLength";
+ public static final String KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING = "emailGatewayNumber";
+ public static final String KEY_MMS_HTTP_PARAMS_STRING = "httpParams";
+ public static final String KEY_MMS_NAI_SUFFIX_STRING = "naiSuffix";
+ public static final String KEY_MMS_UA_PROF_TAG_NAME_STRING = "uaProfTagName";
+ public static final String KEY_MMS_UA_PROF_URL_STRING = "uaProfUrl";
+ public static final String KEY_MMS_USER_AGENT_STRING = "userAgent";
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
static {
sDefaults = new PersistableBundle();
- sDefaults.putBoolean(BOOL_ADDITIONAL_CALL_SETTING, true);
- sDefaults.putBoolean(BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG, false);
- sDefaults.putBoolean(BOOL_ALLOW_LOCAL_DTMF_TONES, true);
- sDefaults.putBoolean(BOOL_APN_EXPAND, true);
- sDefaults.putBoolean(BOOL_AUTO_RETRY_ENABLED, false);
- sDefaults.putBoolean(BOOL_CARRIER_SETTINGS_ENABLE, false);
- sDefaults.putBoolean(BOOL_CARRIER_VOLTE_AVAILABLE, false);
- sDefaults.putBoolean(BOOL_CARRIER_VOLTE_PROVISIONED, false);
- sDefaults.putBoolean(BOOL_CARRIER_VOLTE_TTY_SUPPORTED, true);
- sDefaults.putBoolean(BOOL_DISABLE_CDMA_ACTIVATION_CODE, false);
- sDefaults.putBoolean(BOOL_DTMF_TYPE_ENABLED, false);
- sDefaults.putBoolean(BOOL_ENABLE_DIALER_KEY_VIBRATION, true);
- sDefaults.putBoolean(BOOL_HAS_IN_CALL_NOISE_SUPPRESSION, false);
- sDefaults.putBoolean(BOOL_HIDE_CARRIER_NETWORK_SETTINGS, false);
- sDefaults.putBoolean(BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS, false);
- sDefaults.putBoolean(BOOL_OPERATOR_SELECTION_EXPAND, true);
- sDefaults.putBoolean(BOOL_PREFER_2G, true);
- sDefaults.putBoolean(BOOL_SHOW_APN_SETTING_CDMA, false);
- sDefaults.putBoolean(BOOL_SHOW_CDMA_CHOICES, false);
- sDefaults.putBoolean(BOOL_SHOW_ONSCREEN_DIAL_BUTTON, true);
- sDefaults.putBoolean(BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS, true);
- sDefaults.putBoolean(BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS, true);
- sDefaults.putBoolean(BOOL_SUPPORT_SWAP_AFTER_MERGE, true);
- sDefaults.putBoolean(BOOL_USE_HFA_FOR_PROVISIONING, false);
- sDefaults.putBoolean(BOOL_USE_OTASP_FOR_PROVISIONING, false);
- sDefaults.putBoolean(BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT, false);
- sDefaults.putBoolean(BOOL_VOICE_PRIVACY_DISABLE, false);
- sDefaults.putBoolean(BOOL_WORLD_PHONE, false);
- sDefaults.putInt(INT_VOLTE_REPLACEMENT_RAT, 0);
- sDefaults.putInt(INT_VVM_PORT_NUMBER, 0);
- sDefaults.putString(STRING_VVM_DESTINATION_NUMBER, "");
- sDefaults.putString(STRING_VVM_TYPE, "");
+ sDefaults.putBoolean(KEY_ADDITIONAL_CALL_SETTING_BOOL, true);
+ sDefaults.putBoolean(KEY_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG_BOOL, false);
+ sDefaults.putBoolean(KEY_ALLOW_LOCAL_DTMF_TONES_BOOL, true);
+ sDefaults.putBoolean(KEY_APN_EXPAND_BOOL, true);
+ 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_VOLTE_PROVISIONED_BOOL, false);
+ sDefaults.putBoolean(KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, true);
+ sDefaults.putBoolean(KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL, false);
+ sDefaults.putBoolean(KEY_DTMF_TYPE_ENABLED_BOOL, false);
+ sDefaults.putBoolean(KEY_ENABLE_DIALER_KEY_VIBRATION_BOOL, true);
+ sDefaults.putBoolean(KEY_HAS_IN_CALL_NOISE_SUPPRESSION_BOOL, false);
+ sDefaults.putBoolean(KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL, false);
+ sDefaults.putBoolean(KEY_IGNORE_SIM_NETWORK_LOCKED_EVENTS_BOOL, false);
+ sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
+ sDefaults.putBoolean(KEY_PREFER_2G_BOOL, true);
+ sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false);
+ sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false);
+ sDefaults.putBoolean(KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL, true);
+ sDefaults.putBoolean(KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL, true);
+ sDefaults.putBoolean(KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL, true);
+ sDefaults.putBoolean(KEY_SUPPORT_SWAP_AFTER_MERGE_BOOL, true);
+ sDefaults.putBoolean(KEY_USE_HFA_FOR_PROVISIONING_BOOL, false);
+ sDefaults.putBoolean(KEY_USE_OTASP_FOR_PROVISIONING_BOOL, false);
+ sDefaults.putBoolean(KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL, false);
+ sDefaults.putBoolean(KEY_VOICE_PRIVACY_DISABLE_BOOL, false);
+ sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, false);
+ sDefaults.putInt(KEY_VOLTE_REPLACEMENT_RAT_INT, 0);
+ 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, "");
// MMS defaults
- sDefaults.putBoolean(BOOL_MMS_ALIAS_ENABLED, false);
- sDefaults.putBoolean(BOOL_MMS_ALLOW_ATTACH_AUDIO, true);
- sDefaults.putBoolean(BOOL_MMS_APPEND_TRANSACTION_ID, false);
- sDefaults.putBoolean(BOOL_MMS_GROUP_MMS_ENABLED, true);
- sDefaults.putBoolean(BOOL_MMS_MMS_DELIVERY_REPORT_ENABLED, false);
- sDefaults.putBoolean(BOOL_MMS_MMS_ENABLED, true);
- sDefaults.putBoolean(BOOL_MMS_MMS_READ_REPORT_ENABLED, false);
- sDefaults.putBoolean(BOOL_MMS_MULTIPART_SMS_ENABLED, true);
- sDefaults.putBoolean(BOOL_MMS_NOTIFY_WAP_MMSC_ENABLED, false);
- sDefaults.putBoolean(BOOL_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES, false);
- sDefaults.putBoolean(BOOL_MMS_SHOW_CELL_BROADCAST_APP_LINKS, true);
- sDefaults.putBoolean(BOOL_MMS_SMS_DELIVERY_REPORT_ENABLED, true);
- sDefaults.putBoolean(BOOL_MMS_SUPPORT_HTTP_CHARSET_HEADER, false);
- sDefaults.putBoolean(BOOL_MMS_SUPPORT_MMS_CONTENT_DISPOSITION, true);
- sDefaults.putInt(INT_MMS_ALIAS_MAX_CHARS, 48);
- sDefaults.putInt(INT_MMS_ALIAS_MIN_CHARS, 2);
- sDefaults.putInt(INT_MMS_HTTP_SOCKET_TIMEOUT, 60 * 1000);
- sDefaults.putInt(INT_MMS_MAX_IMAGE_HEIGHT, 480);
- sDefaults.putInt(INT_MMS_MAX_IMAGE_WIDTH, 640);
- sDefaults.putInt(INT_MMS_MAX_MESSAGE_SIZE, 300 * 1024);
- sDefaults.putInt(INT_MMS_MESSAGE_TEXT_MAX_SIZE, -1);
- sDefaults.putInt(INT_MMS_RECIPIENT_LIMIT, Integer.MAX_VALUE);
- sDefaults.putInt(INT_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD, -1);
- sDefaults.putInt(INT_MMS_SMS_TO_MMS_TEXT_THRESHOLD, -1);
- sDefaults.putInt(INT_MMS_SUBJECT_MAX_LENGTH, 40);
- sDefaults.putString(STRING_MMS_EMAIL_GATEWAY_NUMBER, "");
- sDefaults.putString(STRING_MMS_HTTP_PARAMS, "");
- sDefaults.putString(STRING_MMS_NAI_SUFFIX, "");
- sDefaults.putString(STRING_MMS_UA_PROF_TAG_NAME, "x-wap-profile");
- sDefaults.putString(STRING_MMS_UA_PROF_URL, "");
- sDefaults.putString(STRING_MMS_USER_AGENT, "");
+ sDefaults.putBoolean(KEY_MMS_ALIAS_ENABLED_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_APPEND_TRANSACTION_ID_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_GROUP_MMS_ENABLED_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_MMS_DELIVERY_REPORT_ENABLED_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_MMS_ENABLED_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_MMS_READ_REPORT_ENABLED_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_MULTIPART_SMS_ENABLED_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_NOTIFY_WAP_MMSC_ENABLED_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_SHOW_CELL_BROADCAST_APP_LINKS_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_SMS_DELIVERY_REPORT_ENABLED_BOOL, true);
+ sDefaults.putBoolean(KEY_MMS_SUPPORT_HTTP_CHARSET_HEADER_BOOL, false);
+ sDefaults.putBoolean(KEY_MMS_SUPPORT_MMS_CONTENT_DISPOSITION_BOOL, true);
+ sDefaults.putInt(KEY_MMS_ALIAS_MAX_CHARS_INT, 48);
+ sDefaults.putInt(KEY_MMS_ALIAS_MIN_CHARS_INT, 2);
+ sDefaults.putInt(KEY_MMS_HTTP_SOCKET_TIMEOUT_INT, 60 * 1000);
+ sDefaults.putInt(KEY_MMS_MAX_IMAGE_HEIGHT_INT, 480);
+ sDefaults.putInt(KEY_MMS_MAX_IMAGE_WIDTH_INT, 640);
+ sDefaults.putInt(KEY_MMS_MAX_MESSAGE_SIZE_INT, 300 * 1024);
+ sDefaults.putInt(KEY_MMS_MESSAGE_TEXT_MAX_SIZE_INT, -1);
+ sDefaults.putInt(KEY_MMS_RECIPIENT_LIMIT_INT, Integer.MAX_VALUE);
+ sDefaults.putInt(KEY_MMS_SMS_TO_MMS_TEXT_LENGTH_THRESHOLD_INT, -1);
+ sDefaults.putInt(KEY_MMS_SMS_TO_MMS_TEXT_THRESHOLD_INT, -1);
+ sDefaults.putInt(KEY_MMS_SUBJECT_MAX_LENGTH_INT, 40);
+ sDefaults.putString(KEY_MMS_EMAIL_GATEWAY_NUMBER_STRING, "");
+ sDefaults.putString(KEY_MMS_HTTP_PARAMS_STRING, "");
+ sDefaults.putString(KEY_MMS_NAI_SUFFIX_STRING, "");
+ sDefaults.putString(KEY_MMS_UA_PROF_TAG_NAME_STRING, "x-wap-profile");
+ sDefaults.putString(KEY_MMS_UA_PROF_URL_STRING, "");
+ sDefaults.putString(KEY_MMS_USER_AGENT_STRING, "");
}
/**
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 33e52bf..193285f 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -387,7 +387,9 @@ public class SubscriptionManager {
public SubscriptionInfo getActiveSubscriptionInfo(int subId) {
if (VDBG) logd("[getActiveSubscriptionInfo]+ subId=" + subId);
if (!isValidSubscriptionId(subId)) {
- logd("[getActiveSubscriptionInfo]- invalid subId");
+ if (DBG) {
+ logd("[getActiveSubscriptionInfo]- invalid subId");
+ }
return null;
}
@@ -751,7 +753,9 @@ public class SubscriptionManager {
*/
public static int getSlotId(int subId) {
if (!isValidSubscriptionId(subId)) {
- logd("[getSlotId]- fail");
+ if (DBG) {
+ logd("[getSlotId]- fail");
+ }
}
int result = INVALID_SIM_SLOT_INDEX;
@@ -793,7 +797,9 @@ public class SubscriptionManager {
/** @hide */
public static int getPhoneId(int subId) {
if (!isValidSubscriptionId(subId)) {
- logd("[getPhoneId]- fail");
+ if (DBG) {
+ logd("[getPhoneId]- fail");
+ }
return INVALID_PHONE_INDEX;
}
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
index 56c8119..087e68a 100644
--- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
@@ -14,10 +14,10 @@
package com.android.test.dynamic;
-import android.animation.Animator;
-import android.animation.Animator.AnimatorListener;
import android.app.Activity;
+import android.graphics.drawable.Animatable2;
import android.graphics.drawable.AnimatedVectorDrawable;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@@ -56,22 +56,15 @@ public class AnimatedVectorDrawableTest extends Activity implements View.OnClick
button.setHeight(400);
button.setBackgroundResource(icon[i]);
AnimatedVectorDrawable d = (AnimatedVectorDrawable) button.getBackground();
- d.addListener(new AnimatorListener() {
- @Override
- public void onAnimationStart(Animator animation) {
+ d.registerAnimationCallback(new Animatable2.AnimationCallback() {
+ @Override
+ public void onAnimationStart(Drawable drawable) {
Log.v(LOGCAT, "Animator start");
}
- @Override
- public void onAnimationRepeat(Animator animation) {
- Log.v(LOGCAT, "Animator repeat");
- }
- @Override
- public void onAnimationEnd(Animator animation) {
- Log.v(LOGCAT, "Animator end");
- }
- @Override
- public void onAnimationCancel(Animator animation) {
- Log.v(LOGCAT, "Animator cancel");
+
+ @Override
+ public void onAnimationEnd(Drawable drawable) {
+ Log.v(LOGCAT, "Animator end");
}
});
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index 7ced126..503e4a2 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -829,7 +829,8 @@ public class RttManager {
Log.e(TAG, "Request " + index + ": two side RTT is not supported");
return false;
} else if(params.bssid == null || params.bssid.isEmpty()) {
- Log.e(TAG,"No BSSID is input");
+ Log.e(TAG,"No BSSID in params");
+ return false;
} else if ( params.numberBurst != 0 ) {
Log.e(TAG, "Request " + index + ": Illegal number of burst: " + params.numberBurst);
return false;