diff options
27 files changed, 395 insertions, 233 deletions
diff --git a/api/current.txt b/api/current.txt index 6984b078e1aa..8fc3a7263a93 100644 --- a/api/current.txt +++ b/api/current.txt @@ -82,7 +82,6 @@ package android { field public static final java.lang.String READ_SMS = "android.permission.READ_SMS"; field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS"; field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS"; - field public static final java.lang.String READ_WRITE_ALL_VOICEMAIL = "com.android.voicemail.permission.READ_WRITE_ALL_VOICEMAIL"; field public static final java.lang.String READ_WRITE_OWN_VOICEMAIL = "com.android.voicemail.permission.READ_WRITE_OWN_VOICEMAIL"; field public static final java.lang.String REBOOT = "android.permission.REBOOT"; field public static final java.lang.String RECEIVE_BOOT_COMPLETED = "android.permission.RECEIVE_BOOT_COMPLETED"; @@ -185,14 +184,14 @@ package android { public static final class R.attr { ctor public R.attr(); field public static final int absListViewStyle = 16842858; // 0x101006a - field public static final int accessibilityEventTypes = 16843649; // 0x1010381 - field public static final int accessibilityFeedbackType = 16843651; // 0x1010383 - field public static final int accessibilityFlags = 16843653; // 0x1010385 + field public static final int accessibilityEventTypes = 16843648; // 0x1010380 + field public static final int accessibilityFeedbackType = 16843650; // 0x1010382 + field public static final int accessibilityFlags = 16843652; // 0x1010384 field public static final int accountPreferences = 16843423; // 0x101029f field public static final int accountType = 16843407; // 0x101028f field public static final int action = 16842797; // 0x101002d field public static final int actionBarSize = 16843499; // 0x10102eb - field public static final int actionBarSplitStyle = 16843675; // 0x101039b + field public static final int actionBarSplitStyle = 16843670; // 0x1010396 field public static final int actionBarStyle = 16843470; // 0x10102ce field public static final int actionBarTabBarStyle = 16843508; // 0x10102f4 field public static final int actionBarTabStyle = 16843507; // 0x10102f3 @@ -208,10 +207,10 @@ package android { field public static final int actionModeCopyDrawable = 16843538; // 0x1010312 field public static final int actionModeCutDrawable = 16843537; // 0x1010311 field public static final int actionModePasteDrawable = 16843539; // 0x1010313 - field public static final int actionModeSelectAllDrawable = 16843647; // 0x101037f - field public static final int actionModeStyle = 16843688; // 0x10103a8 + field public static final int actionModeSelectAllDrawable = 16843646; // 0x101037e + field public static final int actionModeStyle = 16843682; // 0x10103a2 field public static final int actionOverflowButtonStyle = 16843510; // 0x10102f6 - field public static final int actionProviderClass = 16843677; // 0x101039d + field public static final int actionProviderClass = 16843671; // 0x1010397 field public static final int actionViewClass = 16843516; // 0x10102fc field public static final int activatedBackgroundIndicator = 16843517; // 0x10102fd field public static final int activityCloseEnterAnimation = 16842938; // 0x10100ba @@ -223,7 +222,7 @@ package android { field public static final int alertDialogIcon = 16843605; // 0x1010355 field public static final int alertDialogStyle = 16842845; // 0x101005d field public static final int alertDialogTheme = 16843529; // 0x1010309 - field public static final int alignmentMode = 16843641; // 0x1010379 + field public static final int alignmentMode = 16843640; // 0x1010378 field public static final int allContactsName = 16843468; // 0x10102cc field public static final int allowBackup = 16843392; // 0x1010280 field public static final int allowClearUserData = 16842757; // 0x1010005 @@ -257,8 +256,8 @@ package android { field public static final int background = 16842964; // 0x10100d4 field public static final int backgroundDimAmount = 16842802; // 0x1010032 field public static final int backgroundDimEnabled = 16843295; // 0x101021f - field public static final int backgroundSplit = 16843679; // 0x101039f - field public static final int backgroundStacked = 16843678; // 0x101039e + field public static final int backgroundSplit = 16843673; // 0x1010399 + field public static final int backgroundStacked = 16843672; // 0x1010398 field public static final int backupAgent = 16843391; // 0x101027f field public static final int baseline = 16843548; // 0x101031c field public static final int baselineAlignBottom = 16843042; // 0x1010122 @@ -267,7 +266,7 @@ package android { field public static final int borderlessButtonStyle = 16843563; // 0x101032b field public static final int bottom = 16843184; // 0x10101b0 field public static final int bottomBright = 16842957; // 0x10100cd - field public static final int bottomChevronDrawable = 16843660; // 0x101038c + field public static final int bottomChevronDrawable = 16843659; // 0x101038b field public static final int bottomDark = 16842953; // 0x10100c9 field public static final int bottomLeftRadius = 16843179; // 0x10101ab field public static final int bottomMedium = 16842958; // 0x10100ce @@ -286,7 +285,7 @@ package android { field public static final int cacheColorHint = 16843009; // 0x1010101 field public static final int calendarViewShown = 16843596; // 0x101034c field public static final int calendarViewStyle = 16843613; // 0x101035d - field public static final int canRetrieveWindowContent = 16843654; // 0x1010386 + field public static final int canRetrieveWindowContent = 16843653; // 0x1010385 field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230 field public static final deprecated int capitalize = 16843113; // 0x1010169 field public static final int centerBright = 16842956; // 0x10100cc @@ -315,18 +314,18 @@ package android { field public static final int codes = 16843330; // 0x1010242 field public static final int collapseColumns = 16843083; // 0x101014b field public static final int color = 16843173; // 0x10101a5 - field public static final int colorActivatedHighlight = 16843684; // 0x10103a4 + field public static final int colorActivatedHighlight = 16843678; // 0x101039e field public static final int colorBackground = 16842801; // 0x1010031 field public static final int colorBackgroundCacheHint = 16843435; // 0x10102ab - field public static final int colorFocusedHighlight = 16843683; // 0x10103a3 + field public static final int colorFocusedHighlight = 16843677; // 0x101039d field public static final int colorForeground = 16842800; // 0x1010030 field public static final int colorForegroundInverse = 16843270; // 0x1010206 - field public static final int colorLongPressedHighlight = 16843682; // 0x10103a2 - field public static final int colorMultiSelectHighlight = 16843685; // 0x10103a5 - field public static final int colorPressedHighlight = 16843681; // 0x10103a1 - field public static final int columnCount = 16843638; // 0x1010376 + field public static final int colorLongPressedHighlight = 16843676; // 0x101039c + field public static final int colorMultiSelectHighlight = 16843679; // 0x101039f + field public static final int colorPressedHighlight = 16843675; // 0x101039b + field public static final int columnCount = 16843637; // 0x1010375 field public static final int columnDelay = 16843215; // 0x10101cf - field public static final int columnOrderPreserved = 16843639; // 0x1010377 + field public static final int columnOrderPreserved = 16843638; // 0x1010376 field public static final int columnWidth = 16843031; // 0x1010117 field public static final int compatibleWidthLimitDp = 16843621; // 0x1010365 field public static final int completionHint = 16843122; // 0x1010172 @@ -380,11 +379,11 @@ package android { field public static final int drawSelectorOnTop = 16843004; // 0x10100fc field public static final int drawable = 16843161; // 0x1010199 field public static final int drawableBottom = 16843118; // 0x101016e - field public static final int drawableEnd = 16843687; // 0x10103a7 + field public static final int drawableEnd = 16843681; // 0x10103a1 field public static final int drawableLeft = 16843119; // 0x101016f field public static final int drawablePadding = 16843121; // 0x1010171 field public static final int drawableRight = 16843120; // 0x1010170 - field public static final int drawableStart = 16843686; // 0x10103a6 + field public static final int drawableStart = 16843680; // 0x10103a0 field public static final int drawableTop = 16843117; // 0x101016d field public static final int drawingCacheQuality = 16842984; // 0x10100e8 field public static final int dropDownAnchor = 16843363; // 0x1010263 @@ -441,7 +440,7 @@ package android { field public static final int fastScrollTextColor = 16843609; // 0x1010359 field public static final int fastScrollThumbDrawable = 16843574; // 0x1010336 field public static final int fastScrollTrackDrawable = 16843577; // 0x1010339 - field public static final int feedbackCount = 16843666; // 0x1010392 + field public static final int feedbackCount = 16843665; // 0x1010391 field public static final int fillAfter = 16843197; // 0x10101bd field public static final int fillBefore = 16843196; // 0x10101bc field public static final int fillEnabled = 16843343; // 0x101024f @@ -494,7 +493,7 @@ package android { field public static final int hand_hour = 16843011; // 0x1010103 field public static final int hand_minute = 16843012; // 0x1010104 field public static final int handle = 16843354; // 0x101025a - field public static final int handleDrawable = 16843656; // 0x1010388 + field public static final int handleDrawable = 16843655; // 0x1010387 field public static final int handleProfiling = 16842786; // 0x1010022 field public static final int hapticFeedbackEnabled = 16843358; // 0x101025e field public static final int hardwareAccelerated = 16843475; // 0x10102d3 @@ -503,12 +502,12 @@ package android { field public static final int headerDividersEnabled = 16843310; // 0x101022e field public static final int height = 16843093; // 0x1010155 field public static final int hint = 16843088; // 0x1010150 - field public static final int hitRadius = 16843663; // 0x101038f + field public static final int hitRadius = 16843662; // 0x101038e field public static final int homeAsUpIndicator = 16843531; // 0x101030b field public static final int homeLayout = 16843549; // 0x101031d field public static final int horizontalDivider = 16843053; // 0x101012d field public static final int horizontalGap = 16843327; // 0x101023f - field public static final int horizontalOffset = 16843668; // 0x1010394 + field public static final int horizontalOffset = 16843667; // 0x1010393 field public static final int horizontalScrollViewStyle = 16843603; // 0x1010353 field public static final int horizontalSpacing = 16843028; // 0x1010114 field public static final int host = 16842792; // 0x1010028 @@ -554,7 +553,7 @@ package android { field public static final int installLocation = 16843447; // 0x10102b7 field public static final int interpolator = 16843073; // 0x1010141 field public static final int isAlwaysSyncable = 16843571; // 0x1010333 - field public static final int isAuxiliary = 16843648; // 0x1010380 + field public static final int isAuxiliary = 16843647; // 0x101037f field public static final int isDefault = 16843297; // 0x1010221 field public static final int isIndicator = 16843079; // 0x1010147 field public static final int isModifier = 16843334; // 0x1010246 @@ -591,7 +590,6 @@ package android { field public static final int layerType = 16843604; // 0x1010354 field public static final int layout = 16842994; // 0x10100f2 field public static final int layoutAnimation = 16842988; // 0x10100ec - field public static final int layoutDirection = 16843634; // 0x1010372 field public static final int layout_above = 16843140; // 0x1010184 field public static final int layout_alignBaseline = 16843142; // 0x1010186 field public static final int layout_alignBottom = 16843146; // 0x101018a @@ -608,20 +606,18 @@ package android { field public static final int layout_centerInParent = 16843151; // 0x101018f field public static final int layout_centerVertical = 16843153; // 0x1010191 field public static final int layout_column = 16843084; // 0x101014c - field public static final int layout_columnFlexibility = 16843646; // 0x101037e - field public static final int layout_columnSpan = 16843645; // 0x101037d + field public static final int layout_columnFlexibility = 16843645; // 0x101037d + field public static final int layout_columnSpan = 16843644; // 0x101037c field public static final int layout_gravity = 16842931; // 0x10100b3 field public static final int layout_height = 16842997; // 0x10100f5 field public static final int layout_margin = 16842998; // 0x10100f6 field public static final int layout_marginBottom = 16843002; // 0x10100fa - field public static final int layout_marginEnd = 16843674; // 0x101039a field public static final int layout_marginLeft = 16842999; // 0x10100f7 field public static final int layout_marginRight = 16843001; // 0x10100f9 - field public static final int layout_marginStart = 16843673; // 0x1010399 field public static final int layout_marginTop = 16843000; // 0x10100f8 - field public static final int layout_row = 16843642; // 0x101037a - field public static final int layout_rowFlexibility = 16843644; // 0x101037c - field public static final int layout_rowSpan = 16843643; // 0x101037b + field public static final int layout_row = 16843641; // 0x1010379 + field public static final int layout_rowFlexibility = 16843643; // 0x101037b + field public static final int layout_rowSpan = 16843642; // 0x101037a field public static final int layout_scale = 16843155; // 0x1010193 field public static final int layout_span = 16843085; // 0x101014d field public static final int layout_toLeftOf = 16843138; // 0x1010182 @@ -631,7 +627,7 @@ package android { field public static final int layout_x = 16843135; // 0x101017f field public static final int layout_y = 16843136; // 0x1010180 field public static final int left = 16843181; // 0x10101ad - field public static final int leftChevronDrawable = 16843657; // 0x1010389 + field public static final int leftChevronDrawable = 16843656; // 0x1010388 field public static final int lineSpacingExtra = 16843287; // 0x1010217 field public static final int lineSpacingMultiplier = 16843288; // 0x1010218 field public static final int lines = 16843092; // 0x1010154 @@ -643,8 +639,8 @@ package android { field public static final int listDividerAlertDialog = 16843525; // 0x1010305 field public static final int listPopupWindowStyle = 16843519; // 0x10102ff field public static final int listPreferredItemHeight = 16842829; // 0x101004d - field public static final int listPreferredItemHeightLarge = 16843669; // 0x1010395 - field public static final int listPreferredItemHeightSmall = 16843670; // 0x1010396 + field public static final int listPreferredItemHeightLarge = 16843668; // 0x1010394 + field public static final int listPreferredItemHeightSmall = 16843669; // 0x1010395 field public static final int listSelector = 16843003; // 0x10100fb field public static final int listSeparatorTextViewStyle = 16843272; // 0x1010208 field public static final int listViewStyle = 16842868; // 0x1010074 @@ -675,8 +671,8 @@ package android { field public static final int minHeight = 16843072; // 0x1010140 field public static final int minLevel = 16843185; // 0x10101b1 field public static final int minLines = 16843094; // 0x1010156 - field public static final int minResizeHeight = 16843690; // 0x10103aa - field public static final int minResizeWidth = 16843689; // 0x10103a9 + field public static final int minResizeHeight = 16843684; // 0x10103a4 + field public static final int minResizeWidth = 16843683; // 0x10103a3 field public static final int minSdkVersion = 16843276; // 0x101020c field public static final int minWidth = 16843071; // 0x101013f field public static final int mode = 16843134; // 0x101017e @@ -692,7 +688,7 @@ package android { field public static final int nextFocusUp = 16842979; // 0x10100e3 field public static final int noHistory = 16843309; // 0x101022d field public static final int normalScreens = 16843397; // 0x1010285 - field public static final int notificationTimeout = 16843652; // 0x1010384 + field public static final int notificationTimeout = 16843651; // 0x1010383 field public static final int numColumns = 16843032; // 0x1010118 field public static final int numStars = 16843076; // 0x1010144 field public static final deprecated int numeric = 16843109; // 0x1010165 @@ -706,17 +702,15 @@ package android { field public static final int orderingFromXml = 16843239; // 0x10101e7 field public static final int orientation = 16842948; // 0x10100c4 field public static final int outAnimation = 16843128; // 0x1010178 - field public static final int outerRadius = 16843662; // 0x101038e + field public static final int outerRadius = 16843661; // 0x101038d field public static final int overScrollFooter = 16843459; // 0x10102c3 field public static final int overScrollHeader = 16843458; // 0x10102c2 field public static final int overScrollMode = 16843457; // 0x10102c1 - field public static final int packageNames = 16843650; // 0x1010382 + field public static final int packageNames = 16843649; // 0x1010381 field public static final int padding = 16842965; // 0x10100d5 field public static final int paddingBottom = 16842969; // 0x10100d9 - field public static final int paddingEnd = 16843672; // 0x1010398 field public static final int paddingLeft = 16842966; // 0x10100d6 field public static final int paddingRight = 16842968; // 0x10100d8 - field public static final int paddingStart = 16843671; // 0x1010397 field public static final int paddingTop = 16842967; // 0x10100d7 field public static final int panelBackground = 16842846; // 0x101005e field public static final int panelColorBackground = 16842849; // 0x1010061 @@ -797,17 +791,17 @@ package android { field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int right = 16843183; // 0x10101af - field public static final int rightChevronDrawable = 16843658; // 0x101038a + field public static final int rightChevronDrawable = 16843657; // 0x1010389 field public static final int ringtonePreferenceStyle = 16842899; // 0x1010093 field public static final int ringtoneType = 16843257; // 0x10101f9 field public static final int rotation = 16843558; // 0x1010326 field public static final int rotationX = 16843559; // 0x1010327 field public static final int rotationY = 16843560; // 0x1010328 - field public static final int rowCount = 16843636; // 0x1010374 + field public static final int rowCount = 16843635; // 0x1010373 field public static final int rowDelay = 16843216; // 0x10101d0 field public static final int rowEdgeFlags = 16843329; // 0x1010241 field public static final int rowHeight = 16843058; // 0x1010132 - field public static final int rowOrderPreserved = 16843637; // 0x1010375 + field public static final int rowOrderPreserved = 16843636; // 0x1010374 field public static final int saveEnabled = 16842983; // 0x10100e7 field public static final int scaleGravity = 16843262; // 0x10101fe field public static final int scaleHeight = 16843261; // 0x10101fd @@ -873,7 +867,7 @@ package android { field public static final int smallIcon = 16843422; // 0x101029e field public static final int smallScreens = 16843396; // 0x1010284 field public static final int smoothScrollbar = 16843313; // 0x1010231 - field public static final int snapMargin = 16843665; // 0x1010391 + field public static final int snapMargin = 16843664; // 0x1010390 field public static final int soundEffectsEnabled = 16843285; // 0x1010215 field public static final int spacing = 16843027; // 0x1010113 field public static final int spinnerDropDownItemStyle = 16842887; // 0x1010087 @@ -921,7 +915,7 @@ package android { field public static final int subtitleTextStyle = 16843513; // 0x10102f9 field public static final int suggestActionMsg = 16843228; // 0x10101dc field public static final int suggestActionMsgColumn = 16843229; // 0x10101dd - field public static final int suggestionsEnabled = 16843635; // 0x1010373 + field public static final int suggestionsEnabled = 16843634; // 0x1010372 field public static final int summary = 16843241; // 0x10101e9 field public static final int summaryColumn = 16843426; // 0x10102a2 field public static final int summaryOff = 16843248; // 0x10101f0 @@ -938,7 +932,7 @@ package android { field public static final int tag = 16842961; // 0x10100d1 field public static final int targetActivity = 16843266; // 0x1010202 field public static final int targetClass = 16842799; // 0x101002f - field public static final int targetDrawables = 16843655; // 0x1010387 + field public static final int targetDrawables = 16843654; // 0x1010386 field public static final int targetPackage = 16842785; // 0x1010021 field public static final int targetSdkVersion = 16843376; // 0x1010270 field public static final int taskAffinity = 16842770; // 0x1010012 @@ -953,7 +947,7 @@ package android { field public static final int tension = 16843370; // 0x101026a field public static final int testOnly = 16843378; // 0x1010272 field public static final int text = 16843087; // 0x101014f - field public static final int textAllCaps = 16843680; // 0x10103a0 + field public static final int textAllCaps = 16843674; // 0x101039a field public static final int textAppearance = 16842804; // 0x1010034 field public static final int textAppearanceButton = 16843271; // 0x1010207 field public static final int textAppearanceInverse = 16842805; // 0x1010035 @@ -990,7 +984,6 @@ package android { field public static final int textColorTertiary = 16843282; // 0x1010212 field public static final int textColorTertiaryInverse = 16843283; // 0x1010213 field public static final int textCursorDrawable = 16843618; // 0x1010362 - field public static final int textDirection = 16843676; // 0x101039c field public static final int textEditNoPasteWindowLayout = 16843541; // 0x1010315 field public static final int textEditPasteWindowLayout = 16843540; // 0x1010314 field public static final int textEditSideNoPasteWindowLayout = 16843615; // 0x101035f @@ -1030,7 +1023,7 @@ package android { field public static final int toYScale = 16843205; // 0x10101c5 field public static final int top = 16843182; // 0x10101ae field public static final int topBright = 16842955; // 0x10100cb - field public static final int topChevronDrawable = 16843659; // 0x101038b + field public static final int topChevronDrawable = 16843658; // 0x101038a field public static final int topDark = 16842951; // 0x10100c7 field public static final int topLeftRadius = 16843177; // 0x10101a9 field public static final int topOffset = 16843352; // 0x1010258 @@ -1046,7 +1039,7 @@ package android { field public static final int unfocusedMonthDateColor = 16843588; // 0x1010344 field public static final int unselectedAlpha = 16843278; // 0x101020e field public static final int updatePeriodMillis = 16843344; // 0x1010250 - field public static final int useDefaultMargins = 16843640; // 0x1010378 + field public static final int useDefaultMargins = 16843639; // 0x1010377 field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310 field public static final int useLevel = 16843167; // 0x101019f field public static final int userVisible = 16843409; // 0x1010291 @@ -1060,10 +1053,10 @@ package android { field public static final int verticalCorrection = 16843322; // 0x101023a field public static final int verticalDivider = 16843054; // 0x101012e field public static final int verticalGap = 16843328; // 0x1010240 - field public static final int verticalOffset = 16843667; // 0x1010393 + field public static final int verticalOffset = 16843666; // 0x1010392 field public static final int verticalScrollbarPosition = 16843572; // 0x1010334 field public static final int verticalSpacing = 16843029; // 0x1010115 - field public static final int vibrationDuration = 16843664; // 0x1010390 + field public static final int vibrationDuration = 16843663; // 0x101038f field public static final int visibility = 16842972; // 0x10100dc field public static final int visible = 16843156; // 0x1010194 field public static final int vmSafeMode = 16843448; // 0x10102b8 @@ -1080,7 +1073,7 @@ package android { field public static final int wallpaperIntraOpenExitAnimation = 16843416; // 0x1010298 field public static final int wallpaperOpenEnterAnimation = 16843411; // 0x1010293 field public static final int wallpaperOpenExitAnimation = 16843412; // 0x1010294 - field public static final int waveDrawable = 16843661; // 0x101038d + field public static final int waveDrawable = 16843660; // 0x101038c field public static final int webTextViewStyle = 16843449; // 0x10102b9 field public static final int webViewStyle = 16842885; // 0x1010085 field public static final int weekDayTextAppearance = 16843592; // 0x1010348 @@ -16238,12 +16231,14 @@ package android.provider { } public static final class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { + field public static final java.lang.String PHOTO = "photo"; } protected static abstract interface ContactsContract.StreamItemPhotosColumns { field public static final java.lang.String ACTION = "action"; field public static final java.lang.String ACTION_URI = "action_uri"; - field public static final java.lang.String PICTURE = "picture"; + field public static final java.lang.String PHOTO_FILE_ID = "photo_file_id"; + field public static final java.lang.String PHOTO_URI = "photo_uri"; field public static final java.lang.String SORT_INDEX = "sort_index"; field public static final java.lang.String STREAM_ITEM_ID = "stream_item_id"; } @@ -16253,7 +16248,6 @@ package android.provider { field public static final android.net.Uri CONTENT_PHOTO_URI; field public static final android.net.Uri CONTENT_URI; field public static final java.lang.String MAX_ITEMS = "max_items"; - field public static final java.lang.String PHOTO_MAX_BYTES = "photo_max_bytes"; } public static final class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index 2952e6bd5856..f99b42074018 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -536,9 +536,11 @@ public class Instrumentation { */ public final Activity waitForActivityWithTimeout(long timeOut) { synchronized (this) { - try { - wait(timeOut); - } catch (InterruptedException e) { + if (mLastActivity == null) { + try { + wait(timeOut); + } catch (InterruptedException e) { + } } if (mLastActivity == null) { return null; diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 76f198c15e35..c2998916add4 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1747,9 +1747,9 @@ public final class ContactsContract { * Uri displayPhotoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO); * try { * AssetFileDescriptor fd = - * getContentResolver().openAssetFile(displayPhotoUri, "r"); + * getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); * return fd.createInputStream(); - * } catch (FileNotFoundException e) { + * } catch (IOException e) { * return null; * } * } @@ -2586,7 +2586,7 @@ public final class ContactsContract { * display photo. To access this directory append * {@link RawContacts.DisplayPhoto#CONTENT_DIRECTORY} to the raw contact URI. * The resulting URI represents an image file, and should be interacted with - * using ContentProvider.openAssetFile. + * using ContentResolver.openAssetFileDescriptor. * <p> * <p> * Note that this sub-directory also supports opening the photo as an asset file @@ -2605,7 +2605,7 @@ public final class ContactsContract { * RawContacts.DisplayPhoto.CONTENT_DIRECTORY); * try { * AssetFileDescriptor fd = - * getContentResolver().openAssetFile(rawContactPhotoUri, "rw"); + * getContentResolver().openAssetFileDescriptor(rawContactPhotoUri, "rw"); * OutputStream os = fd.createOutputStream(); * os.write(photo); * os.close(); @@ -2804,7 +2804,7 @@ public final class ContactsContract { /** * The package containing resources for this status: label and icon. - * <p>Type: NUMBER</p> + * <p>Type: TEXT</p> */ public static final String STATUS_RES_PACKAGE = "status_res_package"; @@ -2872,7 +2872,7 @@ public final class ContactsContract { * ContentValues values = new ContentValues(); * values.put(StreamItems.TEXT, "Breakfasted at Tiffanys"); * values.put(StreamItems.TIMESTAMP, timestamp); - * values.put(StreamItems.COMMENT, "3 people reshared this"); + * values.put(StreamItems.COMMENTS, "3 people reshared this"); * values.put(StreamItems.ACTION, action); * values.put(StreamItems.ACTION_URI, actionUri); * Uri streamItemUri = getContentResolver().insert( @@ -2887,7 +2887,7 @@ public final class ContactsContract { * values.put(StreamItems.RAW_CONTACT_ID, rawContactId); * values.put(StreamItems.TEXT, "Breakfasted at Tiffanys"); * values.put(StreamItems.TIMESTAMP, timestamp); - * values.put(StreamItems.COMMENT, "3 people reshared this"); + * values.put(StreamItems.COMMENTS, "3 people reshared this"); * values.put(StreamItems.ACTION, action); * values.put(StreamItems.ACTION_URI, actionUri); * Uri streamItemUri = getContentResolver().insert(StreamItems.CONTENT_URI, values); @@ -2906,7 +2906,7 @@ public final class ContactsContract { * <pre> * values.clear(); * values.put(StreamItemPhotos.SORT_INDEX, 1); - * values.put(StreamItemPhotos.PICTURE, photoData); + * values.put(StreamItemPhotos.PHOTO, photoData); * values.put(StreamItemPhotos.ACTION, action); * values.put(StreamItemPhotos.ACTION_URI, actionUri); * getContentResolver().insert(Uri.withAppendedPath( @@ -2920,7 +2920,7 @@ public final class ContactsContract { * values.clear(); * values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId); * values.put(StreamItemPhotos.SORT_INDEX, 1); - * values.put(StreamItemPhotos.PICTURE, photoData); + * values.put(StreamItemPhotos.PHOTO, photoData); * values.put(StreamItemPhotos.ACTION, action); * values.put(StreamItemPhotos.ACTION_URI, actionUri); * getContentResolver().insert(StreamItems.CONTENT_PHOTO_URI, values); @@ -3008,8 +3008,7 @@ public final class ContactsContract { /** * This URI allows the caller to query for the maximum number of stream items - * that will be stored under any single raw contact, as well as the maximum - * photo size (in bytes) accepted in stream item photos. + * that will be stored under any single raw contact. */ public static final Uri CONTENT_LIMIT_URI = Uri.withAppendedPath(AUTHORITY_URI, "stream_items_limit"); @@ -3022,13 +3021,6 @@ public final class ContactsContract { public static final String MAX_ITEMS = "max_items"; /** - * Queries to {@link ContactsContract.StreamItems#CONTENT_LIMIT_URI} will - * contain this column, with the value indicating the byte limit for - * individual photos. - */ - public static final String PHOTO_MAX_BYTES = "photo_max_bytes"; - - /** * <p> * A sub-directory of a single stream item entry that contains all of its * photo rows. To access this @@ -3067,7 +3059,7 @@ public final class ContactsContract { * The package name to use when creating {@link Resources} objects for * this stream item. This value is only designed for use when building * user interfaces, and should not be used to infer the owner. - * <P>Type: NUMBER</P> + * <P>Type: TEXT</P> */ public static final String RES_PACKAGE = "res_package"; @@ -3161,7 +3153,7 @@ public final class ContactsContract { * <pre> * ContentValues values = new ContentValues(); * values.put(StreamItemPhotos.SORT_INDEX, 1); - * values.put(StreamItemPhotos.PICTURE, photoData); + * values.put(StreamItemPhotos.PHOTO, photoData); * values.put(StreamItemPhotos.ACTION, action); * values.put(StreamItemPhotos.ACTION_URI, actionUri); * Uri photoUri = getContentResolver().insert(Uri.withAppendedPath( @@ -3176,7 +3168,7 @@ public final class ContactsContract { * ContentValues values = new ContentValues(); * values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId); * values.put(StreamItemPhotos.SORT_INDEX, 1); - * values.put(StreamItemPhotos.PICTURE, photoData); + * values.put(StreamItemPhotos.PHOTO, photoData); * values.put(StreamItemPhotos.ACTION, action); * values.put(StreamItemPhotos.ACTION_URI, actionUri); * Uri photoUri = getContentResolver().insert(StreamItems.CONTENT_PHOTO_URI, values); @@ -3198,7 +3190,7 @@ public final class ContactsContract { * <dd> * <pre> * ContentValues values = new ContentValues(); - * values.put(StreamItemPhotos.PICTURE, newPhotoData); + * values.put(StreamItemPhotos.PHOTO, newPhotoData); * getContentResolver().update( * ContentUris.withAppendedId( * Uri.withAppendedPath( @@ -3212,7 +3204,7 @@ public final class ContactsContract { * <pre> * ContentValues values = new ContentValues(); * values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId); - * values.put(StreamItemPhotos.PICTURE, newPhotoData); + * values.put(StreamItemPhotos.PHOTO, newPhotoData); * getContentResolver().update(StreamItems.CONTENT_PHOTO_URI, values); * </pre> * </dd> @@ -3271,6 +3263,21 @@ public final class ContactsContract { * null, null, null, StreamItemPhotos.SORT_INDEX); * </pre> * </dl> + * The record will contain both a {@link StreamItemPhotos#PHOTO_FILE_ID} and a + * {@link StreamItemPhotos#PHOTO_URI}. The {@link StreamItemPhotos#PHOTO_FILE_ID} + * can be used in conjunction with the {@link ContactsContract.DisplayPhoto} API to + * retrieve photo content, or you can open the {@link StreamItemPhotos#PHOTO_URI} as + * an asset file, as follows: + * <pre> + * public InputStream openDisplayPhoto(String photoUri) { + * try { + * AssetFileDescriptor fd = getContentResolver().openAssetFileDescriptor(photoUri, "r"); + * return fd.createInputStream(); + * } catch (IOException e) { + * return null; + * } + * } + * <pre> * </dd> * </dl> */ @@ -3280,6 +3287,20 @@ public final class ContactsContract { */ private StreamItemPhotos() { } + + /** + * <p> + * The binary representation of the photo. Any size photo can be inserted; + * the provider will resize it appropriately for storage and display. + * </p> + * <p> + * This is only intended for use when inserting or updating a stream item photo. + * To retrieve the photo that was stored, open {@link StreamItemPhotos#PHOTO_URI} + * as an asset file. + * </p> + * <P>Type: BLOB</P> + */ + public static final String PHOTO = "photo"; } /** @@ -3302,13 +3323,18 @@ public final class ContactsContract { public static final String SORT_INDEX = "sort_index"; /** - * The binary representation of the picture. Pictures larger than - * {@link ContactsContract.StreamItems#PHOTO_MAX_BYTES} bytes in size (as - * queryable from {@link ContactsContract.StreamItems#CONTENT_LIMIT_URI}) - * will be rejected. - * <P>Type: BLOB</P> + * Photo file ID for the photo. + * See {@link ContactsContract.DisplayPhoto}. + * <P>Type: NUMBER</P> + */ + public static final String PHOTO_FILE_ID = "photo_file_id"; + + /** + * URI for retrieving the photo content, automatically populated. Callers + * may retrieve the photo content by opening this URI as an asset file. + * <P>Type: TEXT</P> */ - public static final String PICTURE = "picture"; + public static final String PHOTO_URI = "photo_uri"; /** * The activity action to execute when the photo is tapped. @@ -7273,9 +7299,10 @@ public final class ContactsContract { * public InputStream openDisplayPhoto(long photoFileId) { * Uri displayPhotoUri = ContentUris.withAppendedId(DisplayPhoto.CONTENT_URI, photoKey); * try { - * AssetFileDescriptor fd = getContentResolver().openAssetFile(displayPhotoUri, "r"); + * AssetFileDescriptor fd = getContentResolver().openAssetFileDescriptor( + * displayPhotoUri, "r"); * return fd.createInputStream(); - * } catch (FileNotFoundException e) { + * } catch (IOException e) { * return null; * } * } diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index f3bcedb35740..f799af343f02 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -283,13 +283,6 @@ public final class MediaStore { */ public static final String IS_DRM = "is_drm"; - /** - * Used by the media scanner to suppress files from being processed as media files. - * - * <P>Type: INTEGER (boolean)</P> - * @hide - */ - public static final String NO_MEDIA = "no_media"; } /** diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ff5fa7f58b67..0108ecf17b6d 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -607,8 +607,6 @@ import java.util.concurrent.CopyOnWriteArrayList; * @attr ref android.R.styleable#View_paddingLeft * @attr ref android.R.styleable#View_paddingRight * @attr ref android.R.styleable#View_paddingTop - * @attr ref android.R.styleable#View_paddingStart - * @attr ref android.R.styleable#View_paddingEnd * @attr ref android.R.styleable#View_saveEnabled * @attr ref android.R.styleable#View_rotation * @attr ref android.R.styleable#View_rotationX diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index c88b922e8120..b116f0f58b44 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -117,12 +117,12 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; -import android.view.ViewRootImpl; import android.view.ViewConfiguration; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; +import android.view.ViewRootImpl; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.accessibility.AccessibilityEvent; @@ -3424,7 +3424,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return mHint; } - private boolean isMultilineInputType(int type) { + private static boolean isMultilineInputType(int type) { return (type & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE)) == (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE); } @@ -3500,7 +3500,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return mTransformation instanceof PasswordTransformationMethod; } - private boolean isPasswordInputType(int inputType) { + private static boolean isPasswordInputType(int inputType) { final int variation = inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION); return variation @@ -3511,7 +3511,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener == (EditorInfo.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_PASSWORD); } - private boolean isVisiblePasswordInputType(int inputType) { + private static boolean isVisiblePasswordInputType(int inputType) { final int variation = inputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION); return variation @@ -5084,6 +5084,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @hide * @param offsetRequired */ + @Override protected int getFadeHeight(boolean offsetRequired) { return mLayout != null ? mLayout.getHeight() : 0; } @@ -7618,7 +7619,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // mode (if any) as soon as this TextView is recycled. stopSelectionActionMode(); } - + @Override public void onFinishTemporaryDetach() { super.onFinishTemporaryDetach(); @@ -7626,7 +7627,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // usually because this instance is an editable field in a list if (!mDispatchTemporaryDetach) mTemporaryDetach = false; } - + @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { if (mTemporaryDetach) { @@ -9200,16 +9201,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * Paste actions, depending on what this View supports. * * A custom implementation can add new entries in the default menu in its - * {@link ActionMode.Callback#onPrepareActionMode(ActionMode, Menu)} method. The default actions - * can also be removed from the menu using {@link Menu#removeItem(int)} and passing - * {@link android.R.id#selectAll}, {@link android.R.id#cut}, {@link android.R.id#copy} or - * {@link android.R.id#paste} ids as parameters. + * {@link android.view.ActionMode.Callback#onPrepareActionMode(ActionMode, Menu)} method. The + * default actions can also be removed from the menu using {@link Menu#removeItem(int)} and + * passing {@link android.R.id#selectAll}, {@link android.R.id#cut}, {@link android.R.id#copy} + * or {@link android.R.id#paste} ids as parameters. * - * Returning false from {@link ActionMode.Callback#onCreateActionMode(ActionMode, Menu)} will - * prevent the action mode from being started. + * Returning false from + * {@link android.view.ActionMode.Callback#onCreateActionMode(ActionMode, Menu)} will prevent + * the action mode from being started. * * Action click events should be handled by the custom implementation of - * {@link ActionMode.Callback#onActionItemClicked(ActionMode, MenuItem)}. + * {@link android.view.ActionMode.Callback#onActionItemClicked(ActionMode, MenuItem)}. * * Note that text selection mode is not started when a TextView receives focus and the * {@link android.R.attr#selectAllOnFocus} flag has been set. The content is highlighted in @@ -9765,9 +9767,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mLastParentX = mTempCoords[0]; mLastParentY = mTempCoords[1]; } - } - onHandleMoved(); + onHandleMoved(); + } if (isPositionVisible()) { mContainer.update(mContainerPositionX, mContainerPositionY, @@ -10210,7 +10212,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPreviousTapPositionX = x; mPreviousTapPositionY = y; - break; case MotionEvent.ACTION_POINTER_DOWN: @@ -10526,6 +10527,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mTextDir = TextDirectionHeuristics.RTL; break; } + } /** diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 290f0493a5d9..103a32691735 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -300,15 +300,6 @@ android:label="@string/permlab_readWriteOwnVoicemail" android:description="@string/permdesc_readWriteOwnVoicemail" /> - <!-- Allows an application to read/write all voicemails. In order to be able - access all voicemails, this permission is needed in *addition* to - READ_WRITE_OWN_VOICEMAIL. --> - <permission android:name="com.android.voicemail.permission.READ_WRITE_ALL_VOICEMAIL" - android:permissionGroup="android.permission-group.PERSONAL_INFO" - android:protectionLevel="signature" - android:label="@string/permlab_readWriteAllVoicemail" - android:description="@string/permdesc_readWriteAllVoicemail" /> - <!-- ======================================= --> <!-- Permissions for accessing location info --> <!-- ======================================= --> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index ba2a03633a38..75f0c4e78f1d 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1719,8 +1719,6 @@ <public type="attr" name="textEditSuggestionsTopWindowLayout" /> <public type="attr" name="textEditSuggestionItemLayout" /> - <public type="attr" name="layoutDirection" /> - <public type="attr" name="suggestionsEnabled" /> <public type="attr" name="rowCount" /> @@ -1765,15 +1763,8 @@ <public type="attr" name="listPreferredItemHeightLarge" /> <public type="attr" name="listPreferredItemHeightSmall" /> - <public type="attr" name="paddingStart"/> - <public type="attr" name="paddingEnd"/> - <public type="attr" name="layout_marginStart"/> - <public type="attr" name="layout_marginEnd"/> - <public type="attr" name="actionBarSplitStyle" /> - <public type="attr" name="textDirection"/> - <public type="attr" name="actionProviderClass" /> <public type="attr" name="backgroundStacked" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 64f731639124..419734aebcc1 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2160,14 +2160,6 @@ voicemails that its associated service can access.</string> <!-- Title of an application permission, listed so the user can choose whether - they want to allow the application to do this. [CHAR LIMIT=NONE] --> - <string name="permlab_readWriteAllVoicemail">Access all voicemails</string> - <!-- Description of an application permission, listed so the user can choose whether - they want to allow the application to do this. [CHAR LIMIT=NONE] --> - <string name="permdesc_readWriteAllVoicemail">Allows the application to store and retrieve all - voicemails that this device can access.</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_writeGeolocationPermissions">Modify Browser geolocation permissions</string> <!-- Description of an application permission, listed so the user can choose whether diff --git a/data/fonts/DroidKufi-Bold.ttf b/data/fonts/DroidKufi-Bold.ttf Binary files differnew file mode 100644 index 000000000000..650919e2601d --- /dev/null +++ b/data/fonts/DroidKufi-Bold.ttf diff --git a/data/fonts/DroidKufi-Regular.ttf b/data/fonts/DroidKufi-Regular.ttf Binary files differnew file mode 100644 index 000000000000..af859750b699 --- /dev/null +++ b/data/fonts/DroidKufi-Regular.ttf diff --git a/data/fonts/DroidNaskh-Bold.ttf b/data/fonts/DroidNaskh-Bold.ttf Binary files differnew file mode 100644 index 000000000000..6b7d4f0b39d3 --- /dev/null +++ b/data/fonts/DroidNaskh-Bold.ttf diff --git a/data/fonts/DroidNaskh-Regular.ttf b/data/fonts/DroidNaskh-Regular.ttf Binary files differnew file mode 100644 index 000000000000..d11e1aebd04e --- /dev/null +++ b/data/fonts/DroidNaskh-Regular.ttf diff --git a/data/fonts/DroidSansArabic.ttf b/data/fonts/DroidSansArabic.ttf Binary files differdeleted file mode 100644 index bdefaacb04df..000000000000 --- a/data/fonts/DroidSansArabic.ttf +++ /dev/null diff --git a/data/fonts/fallback_fonts.xml b/data/fonts/fallback_fonts.xml index c56a05613779..6ac615df2af4 100644 --- a/data/fonts/fallback_fonts.xml +++ b/data/fonts/fallback_fonts.xml @@ -25,7 +25,7 @@ <familyset> <family> <fileset> - <file>DroidSansArabic.ttf</file> + <file>DroidNaskh-Regular.ttf</file> </fileset> </family> <family> diff --git a/data/fonts/fonts.mk b/data/fonts/fonts.mk index 59b4502ea5eb..9a590bb6ddb6 100644 --- a/data/fonts/fonts.mk +++ b/data/fonts/fonts.mk @@ -17,7 +17,7 @@ PRODUCT_COPY_FILES := \ frameworks/base/data/fonts/DroidSans.ttf:system/fonts/DroidSans.ttf \ frameworks/base/data/fonts/DroidSans-Bold.ttf:system/fonts/DroidSans-Bold.ttf \ - frameworks/base/data/fonts/DroidSansArabic.ttf:system/fonts/DroidSansArabic.ttf \ + frameworks/base/data/fonts/DroidNaskh-Regular.ttf:system/fonts/DroidNaskh-Regular.ttf \ frameworks/base/data/fonts/DroidSansEthiopic-Regular.ttf:system/fonts/DroidSansEthiopic-Regular.ttf \ frameworks/base/data/fonts/DroidSansHebrew-Regular.ttf:system/fonts/DroidSansHebrew-Regular.ttf \ frameworks/base/data/fonts/DroidSansHebrew-Bold.ttf:system/fonts/DroidSansHebrew-Bold.ttf \ diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 447a7ff88ba2..decd9f1826a9 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -442,6 +442,7 @@ void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) { if (mWidth && mHeight) { mStateVertex.updateSize(this); + mFBOCache.updateSize(); } } diff --git a/libs/rs/rsFBOCache.h b/libs/rs/rsFBOCache.h index f42e1f3a7f55..5d58ba405416 100644 --- a/libs/rs/rsFBOCache.h +++ b/libs/rs/rsFBOCache.h @@ -38,6 +38,7 @@ public: void resetAll(Context *); void setup(Context *); + void updateSize() { mDirty = true; } struct Hal { mutable void *drv; diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 2e9b64c9637e..682560a4cd3a 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -332,10 +332,10 @@ public class AudioService extends IAudioService.Stub { SOUND_EFFECT_DEFAULT_VOLUME_DB); mVolumePanel = new VolumePanel(context, this); - mSettingsObserver = new SettingsObserver(); mForcedUseForComm = AudioSystem.FORCE_NONE; createAudioSystemThread(); readPersistedSettings(); + mSettingsObserver = new SettingsObserver(); createStreamStates(); // Call setMode() to initialize mSetModeDeathHandlers mMode = AudioSystem.MODE_INVALID; @@ -433,15 +433,20 @@ public class AudioService extends IAudioService.Stub { mVibrateSetting = System.getInt(cr, System.VIBRATE_ON, 0); + // make sure settings for ringer mode are consistent with device type: non voice capable + // devices (tablets) include media stream in silent mode whereas phones don't. mRingerModeAffectedStreams = Settings.System.getInt(cr, Settings.System.MODE_RINGER_STREAMS_AFFECTED, ((1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_NOTIFICATION)| - (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED)| - (1 << AudioSystem.STREAM_MUSIC))); - - if (!mVoiceCapable) { + (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED))); + if (mVoiceCapable) { + mRingerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_MUSIC); + } else { mRingerModeAffectedStreams |= (1 << AudioSystem.STREAM_MUSIC); } + Settings.System.putInt(cr, + Settings.System.MODE_RINGER_STREAMS_AFFECTED, mRingerModeAffectedStreams); + mMuteAffectedStreams = System.getInt(cr, System.MUTE_STREAMS_AFFECTED, ((1 << AudioSystem.STREAM_MUSIC)|(1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_SYSTEM))); @@ -2172,12 +2177,14 @@ public class AudioService extends IAudioService.Stub { super.onChange(selfChange); synchronized (mSettingsLock) { int ringerModeAffectedStreams = Settings.System.getInt(mContentResolver, - Settings.System.MODE_RINGER_STREAMS_AFFECTED, - 0); - if (!mVoiceCapable) { + Settings.System.MODE_RINGER_STREAMS_AFFECTED, + ((1 << AudioSystem.STREAM_RING)|(1 << AudioSystem.STREAM_NOTIFICATION)| + (1 << AudioSystem.STREAM_SYSTEM)|(1 << AudioSystem.STREAM_SYSTEM_ENFORCED))); + if (mVoiceCapable) { + ringerModeAffectedStreams &= ~(1 << AudioSystem.STREAM_MUSIC); + } else { ringerModeAffectedStreams |= (1 << AudioSystem.STREAM_MUSIC); } - if (ringerModeAffectedStreams != mRingerModeAffectedStreams) { /* * Ensure all stream types that should be affected by ringer mode diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java index 8c8569a7488e..a8ac510259d4 100644 --- a/media/java/android/media/MediaScanner.java +++ b/media/java/android/media/MediaScanner.java @@ -372,8 +372,14 @@ public class MediaScanner private class FileInserter { - ContentValues[] mValues = new ContentValues[1000]; - int mIndex = 0; + private final Uri mUri; + private final ContentValues[] mValues; + private int mIndex; + + public FileInserter(Uri uri, int count) { + mUri = uri; + mValues = new ContentValues[count]; + } public Uri insert(ContentValues values) { if (mIndex == mValues.length) { @@ -389,13 +395,17 @@ public class MediaScanner mValues[mIndex++] = null; } try { - mMediaProvider.bulkInsert(mFilesUri, mValues); + mMediaProvider.bulkInsert(mUri, mValues); } catch (RemoteException e) { Log.e(TAG, "RemoteException in FileInserter.flush()", e); } mIndex = 0; } } + + private FileInserter mAudioInserter; + private FileInserter mVideoInserter; + private FileInserter mImageInserter; private FileInserter mFileInserter; // hashes file path to FileCacheEntry. @@ -707,9 +717,7 @@ public class MediaScanner map.put(MediaStore.MediaColumns.MIME_TYPE, mMimeType); map.put(MediaStore.MediaColumns.IS_DRM, mIsDrm); - if (mNoMedia) { - map.put(MediaStore.MediaColumns.NO_MEDIA, true); - } else { + if (!mNoMedia) { if (MediaFile.isVideoFileType(mFileType)) { map.put(Video.Media.ARTIST, (mArtist != null && mArtist.length() > 0 ? mArtist : MediaStore.UNKNOWN_STRING)); @@ -837,23 +845,35 @@ public class MediaScanner } } - // For inserts we always use the file URI so we can insert in bulk. - // For updates we compute the URI based on the media type. Uri tableUri = mFilesUri; + FileInserter inserter = mFileInserter; + if (!mNoMedia) { + if (MediaFile.isVideoFileType(mFileType)) { + tableUri = mVideoUri; + inserter = mVideoInserter; + } else if (MediaFile.isImageFileType(mFileType)) { + tableUri = mImagesUri; + inserter = mImageInserter; + } else if (MediaFile.isAudioFileType(mFileType)) { + tableUri = mAudioUri; + inserter = mAudioInserter; + } + } Uri result = null; if (rowId == 0) { if (mMtpObjectHandle != 0) { values.put(MediaStore.MediaColumns.MEDIA_SCANNER_NEW_OBJECT_ID, mMtpObjectHandle); } - int format = entry.mFormat; - if (format == 0) { - format = MediaFile.getFormatCode(entry.mPath, mMimeType); + if (tableUri == mFilesUri) { + int format = entry.mFormat; + if (format == 0) { + format = MediaFile.getFormatCode(entry.mPath, mMimeType); + } + values.put(Files.FileColumns.FORMAT, format); } - values.put(Files.FileColumns.FORMAT, format); - // new file, insert it - if (mFileInserter != null) { - result = mFileInserter.insert(values); + if (inserter != null) { + result = inserter.insert(values); } else { result = mMediaProvider.insert(tableUri, values); } @@ -863,16 +883,6 @@ public class MediaScanner entry.mRowId = rowId; } } else { - if (!mNoMedia) { - if (MediaFile.isVideoFileType(mFileType)) { - tableUri = mVideoUri; - } else if (MediaFile.isImageFileType(mFileType)) { - tableUri = mImagesUri; - } else if (MediaFile.isAudioFileType(mFileType)) { - tableUri = mAudioUri; - } - } - // updated file result = ContentUris.withAppendedId(tableUri, rowId); // path should never change, and we want to avoid replacing mixed cased paths @@ -1200,12 +1210,25 @@ public class MediaScanner initialize(volumeName); prescan(null, true); long prescan = System.currentTimeMillis(); - mFileInserter = new FileInserter(); + + // create FileInserters for bulk inserts + mAudioInserter = new FileInserter(mAudioUri, 500); + mVideoInserter = new FileInserter(mVideoUri, 500); + mImageInserter = new FileInserter(mImagesUri, 500); + mFileInserter = new FileInserter(mFilesUri, 500); for (int i = 0; i < directories.length; i++) { processDirectory(directories[i], mClient); } + + // flush remaining inserts + mAudioInserter.flush(); + mVideoInserter.flush(); + mImageInserter.flush(); mFileInserter.flush(); + mAudioInserter = null; + mVideoInserter = null; + mImageInserter = null; mFileInserter = null; long scan = System.currentTimeMillis(); diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 178039c6e03b..ed6e3c7aa7a5 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -84,6 +84,8 @@ void MediaPlayer::disconnect() if (p != 0) { p->disconnect(); } + + disconnectNativeWindow(); } // always call with lock held diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index afe4246f52b1..a5022e9d3d92 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 66; + private static final int DATABASE_VERSION = 67; private Context mContext; @@ -861,6 +861,36 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 66; } + if (upgradeVersion == 66) { + // This upgrade makes sure that MODE_RINGER_STREAMS_AFFECTED and + // NOTIFICATIONS_USE_RING_VOLUME settings are set according to device voice capability + db.beginTransaction(); + try { + int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) | + (1 << AudioManager.STREAM_NOTIFICATION) | + (1 << AudioManager.STREAM_SYSTEM) | + (1 << AudioManager.STREAM_SYSTEM_ENFORCED); + if (!mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable)) { + ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); + + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "'"); + db.execSQL("INSERT INTO system ('name', 'value') values ('" + + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "', '1')"); + } + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'"); + db.execSQL("INSERT INTO system ('name', 'value') values ('" + + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '" + + String.valueOf(ringerModeAffectedStreams) + "')"); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 67; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -1121,12 +1151,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadVibrateSetting(db, false); - // By default, only the ring/notification, system and music streams are affected + // By default: + // - ringtones, notification, system and music streams are affected by ringer mode + // on non voice capable devices (tablets) + // - ringtones, notification and system streams are affected by ringer mode + // on voice capable devices (phones) + int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) | + (1 << AudioManager.STREAM_NOTIFICATION) | + (1 << AudioManager.STREAM_SYSTEM) | + (1 << AudioManager.STREAM_SYSTEM_ENFORCED); + if (!mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable)) { + ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); + } loadSetting(stmt, Settings.System.MODE_RINGER_STREAMS_AFFECTED, - (1 << AudioManager.STREAM_RING) | (1 << AudioManager.STREAM_NOTIFICATION) | - (1 << AudioManager.STREAM_SYSTEM) | (1 << AudioManager.STREAM_SYSTEM_ENFORCED) | - (1 << AudioManager.STREAM_MUSIC)); - + ringerModeAffectedStreams); + loadSetting(stmt, Settings.System.MUTE_STREAMS_AFFECTED, ((1 << AudioManager.STREAM_MUSIC) | (1 << AudioManager.STREAM_RING) | @@ -1232,8 +1272,13 @@ public class DatabaseHelper extends SQLiteOpenHelper { R.bool.def_vibrate_in_silent); // Set notification volume to follow ringer volume by default - loadBooleanSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, - R.bool.def_notifications_use_ring_volume); + if (mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable)) { + loadBooleanSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, + R.bool.def_notifications_use_ring_volume); + } else { + loadSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, "1"); + } loadIntegerSetting(stmt, Settings.System.POINTER_SPEED, R.integer.def_pointer_speed); 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 b50fd81974ac..f4c4bbcf935e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -565,27 +565,33 @@ public class PhoneStatusBar extends StatusBar { final RemoteViews contentView = notification.notification.contentView; - if (false) { + if (DEBUG) { Slog.d(TAG, "old notification: when=" + oldNotification.notification.when + " ongoing=" + oldNotification.isOngoing() + " expanded=" + oldEntry.expanded - + " contentView=" + oldContentView); + + " contentView=" + oldContentView + + " rowParent=" + oldEntry.row.getParent()); Slog.d(TAG, "new notification: when=" + notification.notification.when + " ongoing=" + oldNotification.isOngoing() + " contentView=" + contentView); } + // Can we just reapply the RemoteViews in place? If when didn't change, the order // didn't change. - if (notification.notification.when == oldNotification.notification.when - && notification.isOngoing() == oldNotification.isOngoing() - && oldEntry.expanded != null + boolean contentsUnchanged = oldEntry.expanded != null && contentView != null && oldContentView != null && contentView.getPackage() != null && oldContentView.getPackage() != null && oldContentView.getPackage().equals(contentView.getPackage()) - && oldContentView.getLayoutId() == contentView.getLayoutId()) { - if (SPEW) Slog.d(TAG, "reusing notification"); + && oldContentView.getLayoutId() == contentView.getLayoutId(); + ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent(); + boolean orderUnchanged = notification.notification.when==oldNotification.notification.when + && notification.priority == oldNotification.priority; + // priority now encompasses isOngoing() + boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount()-1; + if (contentsUnchanged && (orderUnchanged || isLastAnyway)) { + if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key); oldEntry.notification = notification; try { // Reapply the RemoteViews diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index c7903c0e93a3..5dd3a6a3a11f 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -155,7 +155,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { private boolean mInetConditionChangeInFlight = false; private int mDefaultConnectionSequence = 0; + private Object mDnsLock = new Object(); private int mNumDnsEntries; + private boolean mDnsOverridden = false; private boolean mTestMode; private static ConnectivityService sServiceInstance; @@ -244,6 +246,13 @@ public class ConnectivityService extends IConnectivityManager.Stub { private static final int EVENT_SET_DEPENDENCY_MET = MAX_NETWORK_STATE_TRACKER_EVENT + 10; + /** + * used internally to restore DNS properties back to the + * default network + */ + private static final int EVENT_RESTORE_DNS = + MAX_NETWORK_STATE_TRACKER_EVENT + 11; + private Handler mHandler; // list of DeathRecipients used to make sure features are turned off when @@ -484,6 +493,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { continue; } mCurrentLinkProperties[netType] = null; + if (mNetConfigs[netType].isDefault()) mNetTrackers[netType].reconnect(); } IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); @@ -1889,6 +1899,50 @@ public class ConnectivityService extends IConnectivityManager.Stub { mContext.sendBroadcast(intent); } + // Caller must grab mDnsLock. + private boolean updateDns(String network, Collection<InetAddress> dnses, String domains) { + boolean changed = false; + int last = 0; + if (dnses.size() == 0 && mDefaultDns != null) { + ++last; + String value = mDefaultDns.getHostAddress(); + if (!value.equals(SystemProperties.get("net.dns1"))) { + if (DBG) { + log("no dns provided for " + network + " - using " + value); + } + changed = true; + SystemProperties.set("net.dns1", value); + } + } else { + for (InetAddress dns : dnses) { + ++last; + String key = "net.dns" + last; + String value = dns.getHostAddress(); + if (!changed && value.equals(SystemProperties.get(key))) { + continue; + } + if (DBG) { + log("adding dns " + value + " for " + network); + } + changed = true; + SystemProperties.set(key, value); + } + } + for (int i = last + 1; i <= mNumDnsEntries; ++i) { + String key = "net.dns" + i; + if (DBG) log("erasing " + key); + changed = true; + SystemProperties.set(key, ""); + } + mNumDnsEntries = last; + + if (!domains.equals(SystemProperties.get("net.dns.search"))) { + SystemProperties.set("net.dns.search", domains); + changed = true; + } + return changed; + } + private void handleDnsConfigurationChange(int netType) { // add default net's dns entries NetworkStateTracker nt = mNetTrackers[netType]; @@ -1898,40 +1952,12 @@ public class ConnectivityService extends IConnectivityManager.Stub { Collection<InetAddress> dnses = p.getDnses(); boolean changed = false; if (mNetConfigs[netType].isDefault()) { - int j = 1; - if (dnses.size() == 0 && mDefaultDns != null) { - String dnsString = mDefaultDns.getHostAddress(); - if (!dnsString.equals(SystemProperties.get("net.dns1"))) { - if (DBG) { - log("no dns provided - using " + dnsString); - } - changed = true; - SystemProperties.set("net.dns1", dnsString); - } - j++; - } else { - for (InetAddress dns : dnses) { - String dnsString = dns.getHostAddress(); - if (!changed && dnsString.equals(SystemProperties.get("net.dns" + j))) { - j++; - continue; - } - if (DBG) { - log("adding dns " + dns + " for " + - nt.getNetworkInfo().getTypeName()); - } - changed = true; - SystemProperties.set("net.dns" + j++, dnsString); - } - } - for (int k=j ; k<mNumDnsEntries; k++) { - if (changed || !TextUtils.isEmpty(SystemProperties.get("net.dns" + k))) { - if (DBG) log("erasing net.dns" + k); - changed = true; - SystemProperties.set("net.dns" + k, ""); + String network = nt.getNetworkInfo().getTypeName(); + synchronized (mDnsLock) { + if (!mDnsOverridden) { + changed = updateDns(network, dnses, ""); } } - mNumDnsEntries = j; } else { // set per-pid dns for attached secondary nets List pids = mNetRequestersPids[netType]; @@ -2138,6 +2164,13 @@ public class ConnectivityService extends IConnectivityManager.Stub { handleSetDependencyMet(msg.arg2, met); break; } + case EVENT_RESTORE_DNS: + { + if (mActiveDefaultNetwork != -1) { + handleDnsConfigurationChange(mActiveDefaultNetwork); + } + break; + } } } } @@ -2585,12 +2618,57 @@ public class ConnectivityService extends IConnectivityManager.Stub { private VpnCallback() { } - public synchronized void override(List<String> dnsServers, List<String> searchDomains) { - // TODO: override DNS servers and http proxy. + public void override(List<String> dnsServers, List<String> searchDomains) { + if (dnsServers == null) { + restore(); + return; + } + + // Convert DNS servers into addresses. + List<InetAddress> addresses = new ArrayList<InetAddress>(); + for (String address : dnsServers) { + // Double check the addresses and remove invalid ones. + try { + addresses.add(InetAddress.parseNumericAddress(address)); + } catch (Exception e) { + // ignore + } + } + if (addresses.isEmpty()) { + restore(); + return; + } + + // Concatenate search domains into a string. + StringBuilder buffer = new StringBuilder(); + if (searchDomains != null) { + for (String domain : searchDomains) { + buffer.append(domain).append(' '); + } + } + String domains = buffer.toString().trim(); + + // Apply DNS changes. + boolean changed = false; + synchronized (mDnsLock) { + changed = updateDns("VPN", addresses, domains); + mDnsOverridden = true; + } + if (changed) { + bumpDns(); + } + + // TODO: temporarily remove http proxy? } - public synchronized void restore() { - // TODO: restore VPN changes. + public void restore() { + synchronized (mDnsLock) { + if (!mDnsOverridden) { + return; + } + mDnsOverridden = false; + } + mHandler.sendEmptyMessage(EVENT_RESTORE_DNS); } } } diff --git a/tests/BiDiTests/Android b/tests/BiDiTests/Android deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/tests/BiDiTests/Android +++ /dev/null diff --git a/tests/BiDiTests/Android.mk b/tests/BiDiTests/Android-private.mk index ae29fc262b13..ae29fc262b13 100644 --- a/tests/BiDiTests/Android.mk +++ b/tests/BiDiTests/Android-private.mk diff --git a/tests/BiDiTests/new-attributes.txt b/tests/BiDiTests/new-attributes.txt new file mode 100644 index 000000000000..57854cc6b774 --- /dev/null +++ b/tests/BiDiTests/new-attributes.txt @@ -0,0 +1,9 @@ + <public type="attr" name="layoutDirection" /> + + <public type="attr" name="layout_marginStart"/> + <public type="attr" name="layout_marginEnd"/> + + <public type="attr" name="paddingStart"/> + <public type="attr" name="paddingEnd"/> + + <public type="attr" name="textDirection"/> |