diff options
101 files changed, 2658 insertions, 546 deletions
@@ -20979,45 +20979,17 @@ package android.view { public class Surface implements android.os.Parcelable { method public int describeContents(); - method public void freeze(); - method public void hide(); method public boolean isValid(); method public android.graphics.Canvas lockCanvas(android.graphics.Rect) throws java.lang.IllegalArgumentException, android.view.Surface.OutOfResourcesException; method public void readFromParcel(android.os.Parcel); - method public void setAlpha(float); - method public void setFlags(int, int); - method public void setFreezeTint(int); - method public void setLayer(int); - method public void setMatrix(float, float, float, float); - method public static void setOrientation(int, int); - method public void setPosition(int, int); - method public void setSize(int, int); - method public void setTransparentRegionHint(android.graphics.Region); - method public void show(); - method public void unfreeze(); method public void unlockCanvas(android.graphics.Canvas); method public void unlockCanvasAndPost(android.graphics.Canvas); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field public static final int FX_SURFACE_BLUR = 65536; // 0x10000 - field public static final int FX_SURFACE_DIM = 131072; // 0x20000 - field public static final int FX_SURFACE_MASK = 983040; // 0xf0000 - field public static final int FX_SURFACE_NORMAL = 0; // 0x0 - field public static final deprecated int GPU = 40; // 0x28 - field public static final deprecated int HARDWARE = 16; // 0x10 - field public static final int HIDDEN = 4; // 0x4 - field public static final int NON_PREMULTIPLIED = 256; // 0x100 - field public static final deprecated int PUSH_BUFFERS = 512; // 0x200 field public static final int ROTATION_0 = 0; // 0x0 field public static final int ROTATION_180 = 2; // 0x2 field public static final int ROTATION_270 = 3; // 0x3 field public static final int ROTATION_90 = 1; // 0x1 - field public static final int SECURE = 128; // 0x80 - field public static final deprecated int SURACE_FROZEN = 2; // 0x2 - field public static final int SURFACE_BLUR_FREEZE = 16; // 0x10 - field public static final int SURFACE_DITHER = 4; // 0x4 - field public static final int SURFACE_FROZEN = 2; // 0x2 - field public static final int SURFACE_HIDDEN = 1; // 0x1 } public static class Surface.OutOfResourcesException extends java.lang.Exception { diff --git a/api/current.txt b/api/current.txt index 876d555..1180440 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1499,6 +1499,12 @@ package android { field public static final int Animation_InputMethod = 16973910; // 0x1030056 field public static final int Animation_Toast = 16973828; // 0x1030004 field public static final int Animation_Translucent = 16973827; // 0x1030003 + field public static final int DeviceDefault_ButtonBar = 16974287; // 0x10301cf + field public static final int DeviceDefault_ButtonBar_AlertDialog = 16974288; // 0x10301d0 + field public static final int DeviceDefault_Light_ButtonBar = 16974290; // 0x10301d2 + field public static final int DeviceDefault_Light_ButtonBar_AlertDialog = 16974291; // 0x10301d3 + field public static final int DeviceDefault_Light_SegmentedButton = 16974292; // 0x10301d4 + field public static final int DeviceDefault_SegmentedButton = 16974289; // 0x10301d1 field public static final int Holo_ButtonBar = 16974053; // 0x10300e5 field public static final int Holo_ButtonBar_AlertDialog = 16974055; // 0x10300e7 field public static final int Holo_Light_ButtonBar = 16974054; // 0x10300e6 @@ -1513,6 +1519,40 @@ package android { field public static final int MediaButton_Previous = 16973880; // 0x1030038 field public static final int MediaButton_Rew = 16973884; // 0x103003c field public static final int TextAppearance = 16973886; // 0x103003e + field public static final int TextAppearance_DeviceDefault = 16974253; // 0x10301ad + field public static final int TextAppearance_DeviceDefault_DialogWindowTitle = 16974264; // 0x10301b8 + field public static final int TextAppearance_DeviceDefault_Inverse = 16974254; // 0x10301ae + field public static final int TextAppearance_DeviceDefault_Large = 16974255; // 0x10301af + field public static final int TextAppearance_DeviceDefault_Large_Inverse = 16974256; // 0x10301b0 + field public static final int TextAppearance_DeviceDefault_Medium = 16974257; // 0x10301b1 + field public static final int TextAppearance_DeviceDefault_Medium_Inverse = 16974258; // 0x10301b2 + field public static final int TextAppearance_DeviceDefault_SearchResult_Subtitle = 16974262; // 0x10301b6 + field public static final int TextAppearance_DeviceDefault_SearchResult_Title = 16974261; // 0x10301b5 + field public static final int TextAppearance_DeviceDefault_Small = 16974259; // 0x10301b3 + field public static final int TextAppearance_DeviceDefault_Small_Inverse = 16974260; // 0x10301b4 + field public static final int TextAppearance_DeviceDefault_Widget = 16974265; // 0x10301b9 + field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Menu = 16974286; // 0x10301ce + field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle = 16974279; // 0x10301c7 + field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle_Inverse = 16974283; // 0x10301cb + field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Title = 16974278; // 0x10301c6 + field public static final int TextAppearance_DeviceDefault_Widget_ActionBar_Title_Inverse = 16974282; // 0x10301ca + field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle = 16974281; // 0x10301c9 + field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle_Inverse = 16974285; // 0x10301cd + field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Title = 16974280; // 0x10301c8 + field public static final int TextAppearance_DeviceDefault_Widget_ActionMode_Title_Inverse = 16974284; // 0x10301cc + field public static final int TextAppearance_DeviceDefault_Widget_Button = 16974266; // 0x10301ba + field public static final int TextAppearance_DeviceDefault_Widget_DropDownHint = 16974271; // 0x10301bf + field public static final int TextAppearance_DeviceDefault_Widget_DropDownItem = 16974272; // 0x10301c0 + field public static final int TextAppearance_DeviceDefault_Widget_EditText = 16974274; // 0x10301c2 + field public static final int TextAppearance_DeviceDefault_Widget_IconMenu_Item = 16974267; // 0x10301bb + field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu = 16974275; // 0x10301c3 + field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu_Large = 16974276; // 0x10301c4 + field public static final int TextAppearance_DeviceDefault_Widget_PopupMenu_Small = 16974277; // 0x10301c5 + field public static final int TextAppearance_DeviceDefault_Widget_TabWidget = 16974268; // 0x10301bc + field public static final int TextAppearance_DeviceDefault_Widget_TextView = 16974269; // 0x10301bd + field public static final int TextAppearance_DeviceDefault_Widget_TextView_PopupMenu = 16974270; // 0x10301be + field public static final int TextAppearance_DeviceDefault_Widget_TextView_SpinnerItem = 16974273; // 0x10301c1 + field public static final int TextAppearance_DeviceDefault_WindowTitle = 16974263; // 0x10301b7 field public static final int TextAppearance_DialogWindowTitle = 16973889; // 0x1030041 field public static final int TextAppearance_Holo = 16974075; // 0x10300fb field public static final int TextAppearance_Holo_DialogWindowTitle = 16974103; // 0x1030117 @@ -1578,6 +1618,30 @@ package android { field public static final int Theme_Black = 16973832; // 0x1030008 field public static final int Theme_Black_NoTitleBar = 16973833; // 0x1030009 field public static final int Theme_Black_NoTitleBar_Fullscreen = 16973834; // 0x103000a + field public static final int Theme_DeviceDefault = 16974120; // 0x1030128 + field public static final int Theme_DeviceDefault_Dialog = 16974126; // 0x103012e + field public static final int Theme_DeviceDefault_DialogWhenLarge = 16974134; // 0x1030136 + field public static final int Theme_DeviceDefault_DialogWhenLarge_NoActionBar = 16974135; // 0x1030137 + field public static final int Theme_DeviceDefault_Dialog_MinWidth = 16974127; // 0x103012f + field public static final int Theme_DeviceDefault_Dialog_NoActionBar = 16974128; // 0x1030130 + field public static final int Theme_DeviceDefault_Dialog_NoActionBar_MinWidth = 16974129; // 0x1030131 + field public static final int Theme_DeviceDefault_InputMethod = 16974142; // 0x103013e + field public static final int Theme_DeviceDefault_Light = 16974123; // 0x103012b + field public static final int Theme_DeviceDefault_Light_DarkActionBar = 16974143; // 0x103013f + field public static final int Theme_DeviceDefault_Light_Dialog = 16974130; // 0x1030132 + field public static final int Theme_DeviceDefault_Light_DialogWhenLarge = 16974136; // 0x1030138 + field public static final int Theme_DeviceDefault_Light_DialogWhenLarge_NoActionBar = 16974137; // 0x1030139 + field public static final int Theme_DeviceDefault_Light_Dialog_MinWidth = 16974131; // 0x1030133 + field public static final int Theme_DeviceDefault_Light_Dialog_NoActionBar = 16974132; // 0x1030134 + field public static final int Theme_DeviceDefault_Light_Dialog_NoActionBar_MinWidth = 16974133; // 0x1030135 + field public static final int Theme_DeviceDefault_Light_NoActionBar = 16974124; // 0x103012c + field public static final int Theme_DeviceDefault_Light_NoActionBar_Fullscreen = 16974125; // 0x103012d + field public static final int Theme_DeviceDefault_Light_Panel = 16974139; // 0x103013b + field public static final int Theme_DeviceDefault_NoActionBar = 16974121; // 0x1030129 + field public static final int Theme_DeviceDefault_NoActionBar_Fullscreen = 16974122; // 0x103012a + field public static final int Theme_DeviceDefault_Panel = 16974138; // 0x103013a + field public static final int Theme_DeviceDefault_Wallpaper = 16974140; // 0x103013c + field public static final int Theme_DeviceDefault_Wallpaper_NoTitleBar = 16974141; // 0x103013d field public static final int Theme_Dialog = 16973835; // 0x103000b field public static final int Theme_Holo = 16973931; // 0x103006b field public static final int Theme_Holo_Dialog = 16973935; // 0x103006f @@ -1642,6 +1706,115 @@ package android { field public static final int Widget_CompoundButton_RadioButton = 16973850; // 0x103001a field public static final int Widget_CompoundButton_Star = 16973851; // 0x103001b field public static final int Widget_DatePicker = 16974062; // 0x10300ee + field public static final int Widget_DeviceDefault = 16974144; // 0x1030140 + field public static final int Widget_DeviceDefault_ActionBar = 16974187; // 0x103016b + field public static final int Widget_DeviceDefault_ActionBar_Solid = 16974195; // 0x1030173 + field public static final int Widget_DeviceDefault_ActionBar_TabBar = 16974194; // 0x1030172 + field public static final int Widget_DeviceDefault_ActionBar_TabText = 16974193; // 0x1030171 + field public static final int Widget_DeviceDefault_ActionBar_TabView = 16974192; // 0x1030170 + field public static final int Widget_DeviceDefault_ActionButton = 16974182; // 0x1030166 + field public static final int Widget_DeviceDefault_ActionButton_CloseMode = 16974186; // 0x103016a + field public static final int Widget_DeviceDefault_ActionButton_Overflow = 16974183; // 0x1030167 + field public static final int Widget_DeviceDefault_ActionButton_TextButton = 16974184; // 0x1030168 + field public static final int Widget_DeviceDefault_ActionMode = 16974185; // 0x1030169 + field public static final int Widget_DeviceDefault_AutoCompleteTextView = 16974151; // 0x1030147 + field public static final int Widget_DeviceDefault_Button = 16974145; // 0x1030141 + field public static final int Widget_DeviceDefault_Button_Borderless = 16974188; // 0x103016c + field public static final int Widget_DeviceDefault_Button_Borderless_Small = 16974149; // 0x1030145 + field public static final int Widget_DeviceDefault_Button_Inset = 16974147; // 0x1030143 + field public static final int Widget_DeviceDefault_Button_Small = 16974146; // 0x1030142 + field public static final int Widget_DeviceDefault_Button_Toggle = 16974148; // 0x1030144 + field public static final int Widget_DeviceDefault_CalendarView = 16974190; // 0x103016e + field public static final int Widget_DeviceDefault_CompoundButton_CheckBox = 16974152; // 0x1030148 + field public static final int Widget_DeviceDefault_CompoundButton_RadioButton = 16974169; // 0x1030159 + field public static final int Widget_DeviceDefault_CompoundButton_Star = 16974173; // 0x103015d + field public static final int Widget_DeviceDefault_DatePicker = 16974191; // 0x103016f + field public static final int Widget_DeviceDefault_DropDownItem = 16974177; // 0x1030161 + field public static final int Widget_DeviceDefault_DropDownItem_Spinner = 16974178; // 0x1030162 + field public static final int Widget_DeviceDefault_EditText = 16974154; // 0x103014a + field public static final int Widget_DeviceDefault_ExpandableListView = 16974155; // 0x103014b + field public static final int Widget_DeviceDefault_GridView = 16974156; // 0x103014c + field public static final int Widget_DeviceDefault_HorizontalScrollView = 16974171; // 0x103015b + field public static final int Widget_DeviceDefault_ImageButton = 16974157; // 0x103014d + field public static final int Widget_DeviceDefault_Light = 16974196; // 0x1030174 + field public static final int Widget_DeviceDefault_Light_ActionBar = 16974243; // 0x10301a3 + field public static final int Widget_DeviceDefault_Light_ActionBar_Solid = 16974247; // 0x10301a7 + field public static final int Widget_DeviceDefault_Light_ActionBar_Solid_Inverse = 16974248; // 0x10301a8 + field public static final int Widget_DeviceDefault_Light_ActionBar_TabBar = 16974246; // 0x10301a6 + field public static final int Widget_DeviceDefault_Light_ActionBar_TabBar_Inverse = 16974249; // 0x10301a9 + field public static final int Widget_DeviceDefault_Light_ActionBar_TabText = 16974245; // 0x10301a5 + field public static final int Widget_DeviceDefault_Light_ActionBar_TabText_Inverse = 16974251; // 0x10301ab + field public static final int Widget_DeviceDefault_Light_ActionBar_TabView = 16974244; // 0x10301a4 + field public static final int Widget_DeviceDefault_Light_ActionBar_TabView_Inverse = 16974250; // 0x10301aa + field public static final int Widget_DeviceDefault_Light_ActionButton = 16974239; // 0x103019f + field public static final int Widget_DeviceDefault_Light_ActionButton_CloseMode = 16974242; // 0x10301a2 + field public static final int Widget_DeviceDefault_Light_ActionButton_Overflow = 16974240; // 0x10301a0 + field public static final int Widget_DeviceDefault_Light_ActionMode = 16974241; // 0x10301a1 + field public static final int Widget_DeviceDefault_Light_ActionMode_Inverse = 16974252; // 0x10301ac + field public static final int Widget_DeviceDefault_Light_AutoCompleteTextView = 16974203; // 0x103017b + field public static final int Widget_DeviceDefault_Light_Button = 16974197; // 0x1030175 + field public static final int Widget_DeviceDefault_Light_Button_Borderless_Small = 16974201; // 0x1030179 + field public static final int Widget_DeviceDefault_Light_Button_Inset = 16974199; // 0x1030177 + field public static final int Widget_DeviceDefault_Light_Button_Small = 16974198; // 0x1030176 + field public static final int Widget_DeviceDefault_Light_Button_Toggle = 16974200; // 0x1030178 + field public static final int Widget_DeviceDefault_Light_CalendarView = 16974238; // 0x103019e + field public static final int Widget_DeviceDefault_Light_CompoundButton_CheckBox = 16974204; // 0x103017c + field public static final int Widget_DeviceDefault_Light_CompoundButton_RadioButton = 16974224; // 0x1030190 + field public static final int Widget_DeviceDefault_Light_CompoundButton_Star = 16974228; // 0x1030194 + field public static final int Widget_DeviceDefault_Light_DropDownItem = 16974232; // 0x1030198 + field public static final int Widget_DeviceDefault_Light_DropDownItem_Spinner = 16974233; // 0x1030199 + field public static final int Widget_DeviceDefault_Light_EditText = 16974206; // 0x103017e + field public static final int Widget_DeviceDefault_Light_ExpandableListView = 16974207; // 0x103017f + field public static final int Widget_DeviceDefault_Light_GridView = 16974208; // 0x1030180 + field public static final int Widget_DeviceDefault_Light_HorizontalScrollView = 16974226; // 0x1030192 + field public static final int Widget_DeviceDefault_Light_ImageButton = 16974209; // 0x1030181 + field public static final int Widget_DeviceDefault_Light_ListPopupWindow = 16974235; // 0x103019b + field public static final int Widget_DeviceDefault_Light_ListView = 16974210; // 0x1030182 + field public static final int Widget_DeviceDefault_Light_ListView_DropDown = 16974205; // 0x103017d + field public static final int Widget_DeviceDefault_Light_PopupMenu = 16974236; // 0x103019c + field public static final int Widget_DeviceDefault_Light_PopupWindow = 16974211; // 0x1030183 + field public static final int Widget_DeviceDefault_Light_ProgressBar = 16974212; // 0x1030184 + field public static final int Widget_DeviceDefault_Light_ProgressBar_Horizontal = 16974213; // 0x1030185 + field public static final int Widget_DeviceDefault_Light_ProgressBar_Inverse = 16974217; // 0x1030189 + field public static final int Widget_DeviceDefault_Light_ProgressBar_Large = 16974216; // 0x1030188 + field public static final int Widget_DeviceDefault_Light_ProgressBar_Large_Inverse = 16974219; // 0x103018b + field public static final int Widget_DeviceDefault_Light_ProgressBar_Small = 16974214; // 0x1030186 + field public static final int Widget_DeviceDefault_Light_ProgressBar_Small_Inverse = 16974218; // 0x103018a + field public static final int Widget_DeviceDefault_Light_ProgressBar_Small_Title = 16974215; // 0x1030187 + field public static final int Widget_DeviceDefault_Light_RatingBar = 16974221; // 0x103018d + field public static final int Widget_DeviceDefault_Light_RatingBar_Indicator = 16974222; // 0x103018e + field public static final int Widget_DeviceDefault_Light_RatingBar_Small = 16974223; // 0x103018f + field public static final int Widget_DeviceDefault_Light_ScrollView = 16974225; // 0x1030191 + field public static final int Widget_DeviceDefault_Light_SeekBar = 16974220; // 0x103018c + field public static final int Widget_DeviceDefault_Light_Spinner = 16974227; // 0x1030193 + field public static final int Widget_DeviceDefault_Light_Tab = 16974237; // 0x103019d + field public static final int Widget_DeviceDefault_Light_TabWidget = 16974229; // 0x1030195 + field public static final int Widget_DeviceDefault_Light_TextView = 16974202; // 0x103017a + field public static final int Widget_DeviceDefault_Light_TextView_SpinnerItem = 16974234; // 0x103019a + field public static final int Widget_DeviceDefault_Light_WebTextView = 16974230; // 0x1030196 + field public static final int Widget_DeviceDefault_Light_WebView = 16974231; // 0x1030197 + field public static final int Widget_DeviceDefault_ListPopupWindow = 16974180; // 0x1030164 + field public static final int Widget_DeviceDefault_ListView = 16974158; // 0x103014e + field public static final int Widget_DeviceDefault_ListView_DropDown = 16974153; // 0x1030149 + field public static final int Widget_DeviceDefault_PopupMenu = 16974181; // 0x1030165 + field public static final int Widget_DeviceDefault_PopupWindow = 16974159; // 0x103014f + field public static final int Widget_DeviceDefault_ProgressBar = 16974160; // 0x1030150 + field public static final int Widget_DeviceDefault_ProgressBar_Horizontal = 16974161; // 0x1030151 + field public static final int Widget_DeviceDefault_ProgressBar_Large = 16974164; // 0x1030154 + field public static final int Widget_DeviceDefault_ProgressBar_Small = 16974162; // 0x1030152 + field public static final int Widget_DeviceDefault_ProgressBar_Small_Title = 16974163; // 0x1030153 + field public static final int Widget_DeviceDefault_RatingBar = 16974166; // 0x1030156 + field public static final int Widget_DeviceDefault_RatingBar_Indicator = 16974167; // 0x1030157 + field public static final int Widget_DeviceDefault_RatingBar_Small = 16974168; // 0x1030158 + field public static final int Widget_DeviceDefault_ScrollView = 16974170; // 0x103015a + field public static final int Widget_DeviceDefault_SeekBar = 16974165; // 0x1030155 + field public static final int Widget_DeviceDefault_Spinner = 16974172; // 0x103015c + field public static final int Widget_DeviceDefault_Tab = 16974189; // 0x103016d + field public static final int Widget_DeviceDefault_TabWidget = 16974174; // 0x103015e + field public static final int Widget_DeviceDefault_TextView = 16974150; // 0x1030146 + field public static final int Widget_DeviceDefault_TextView_SpinnerItem = 16974179; // 0x1030163 + field public static final int Widget_DeviceDefault_WebTextView = 16974175; // 0x103015f + field public static final int Widget_DeviceDefault_WebView = 16974176; // 0x1030160 field public static final int Widget_DropDownItem = 16973867; // 0x103002b field public static final int Widget_DropDownItem_Spinner = 16973868; // 0x103002c field public static final int Widget_EditText = 16973859; // 0x1030023 @@ -8454,6 +8627,7 @@ package android.graphics { ctor public SurfaceTexture(int, boolean); method public long getTimestamp(); method public void getTransformMatrix(float[]); + method public void release(); method public void setOnFrameAvailableListener(android.graphics.SurfaceTexture.OnFrameAvailableListener); method public void updateTexImage(); } @@ -11116,6 +11290,7 @@ package android.net { public class ConnectivityManager { method public android.net.NetworkInfo getActiveNetworkInfo(); + method public android.net.NetworkQuotaInfo getActiveNetworkQuotaInfo(); method public android.net.NetworkInfo[] getAllNetworkInfo(); method public boolean getBackgroundDataSetting(); method public android.net.NetworkInfo getNetworkInfo(int); @@ -11130,7 +11305,7 @@ package android.net { field public static final int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1 field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo"; field public static final java.lang.String EXTRA_IS_FAILOVER = "isFailover"; - field public static final java.lang.String EXTRA_NETWORK_INFO = "networkInfo"; + field public static final deprecated java.lang.String EXTRA_NETWORK_INFO = "networkInfo"; field public static final java.lang.String EXTRA_NO_CONNECTIVITY = "noConnectivity"; field public static final java.lang.String EXTRA_OTHER_NETWORK_INFO = "otherNetwork"; field public static final java.lang.String EXTRA_REASON = "reason"; @@ -11275,6 +11450,16 @@ package android.net { enum_constant public static final android.net.NetworkInfo.State UNKNOWN; } + public class NetworkQuotaInfo implements android.os.Parcelable { + method public int describeContents(); + method public long getEstimatedBytes(); + method public long getHardLimitBytes(); + method public long getSoftLimitBytes(); + method public void writeToParcel(android.os.Parcel, int); + field public static final android.os.Parcelable.Creator CREATOR; + field public static final long NO_LIMIT = -1L; // 0xffffffffffffffffL + } + public class ParseException extends java.lang.RuntimeException { field public java.lang.String response; } @@ -22068,45 +22253,18 @@ package android.view { public class Surface implements android.os.Parcelable { method public int describeContents(); - method public void freeze(); - method public void hide(); method public boolean isValid(); method public android.graphics.Canvas lockCanvas(android.graphics.Rect) throws java.lang.IllegalArgumentException, android.view.Surface.OutOfResourcesException; method public void readFromParcel(android.os.Parcel); - method public void setAlpha(float); - method public void setFlags(int, int); - method public void setFreezeTint(int); - method public void setLayer(int); - method public void setMatrix(float, float, float, float); - method public static void setOrientation(int, int); - method public void setPosition(int, int); - method public void setSize(int, int); - method public void setTransparentRegionHint(android.graphics.Region); - method public void show(); - method public void unfreeze(); + method public void release(); method public void unlockCanvas(android.graphics.Canvas); method public void unlockCanvasAndPost(android.graphics.Canvas); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field public static final int FX_SURFACE_BLUR = 65536; // 0x10000 - field public static final int FX_SURFACE_DIM = 131072; // 0x20000 - field public static final int FX_SURFACE_MASK = 983040; // 0xf0000 - field public static final int FX_SURFACE_NORMAL = 0; // 0x0 - field public static final deprecated int GPU = 40; // 0x28 - field public static final deprecated int HARDWARE = 16; // 0x10 - field public static final int HIDDEN = 4; // 0x4 - field public static final int NON_PREMULTIPLIED = 256; // 0x100 - field public static final deprecated int PUSH_BUFFERS = 512; // 0x200 field public static final int ROTATION_0 = 0; // 0x0 field public static final int ROTATION_180 = 2; // 0x2 field public static final int ROTATION_270 = 3; // 0x3 field public static final int ROTATION_90 = 1; // 0x1 - field public static final int SECURE = 128; // 0x80 - field public static final deprecated int SURACE_FROZEN = 2; // 0x2 - field public static final int SURFACE_BLUR_FREEZE = 16; // 0x10 - field public static final int SURFACE_DITHER = 4; // 0x4 - field public static final int SURFACE_FROZEN = 2; // 0x2 - field public static final int SURFACE_HIDDEN = 1; // 0x1 } public static class Surface.OutOfResourcesException extends java.lang.Exception { diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index ca6f085..28bc424 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1163,7 +1163,10 @@ public final class BluetoothAdapter { * <p> If this API returns true, it means the callback will be called. * The callback will be called with the current state of Bluetooth. * If the state is not what was requested, an internal error would be the - * reason. + * reason. If Bluetooth is already on and if this function is called to turn + * it on, the api will return true and a callback will be called. + * + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} * * @param on True for on, false for off. * @param callback The callback to notify changes to the state. diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index b6c64cb..22fdc98 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -598,7 +598,12 @@ public class PackageParser { assmgr = new AssetManager(); assmgr.setConfiguration(0, 0, null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Build.VERSION.RESOURCES_SDK_INT); + int cookie = assmgr.addAssetPath(packageFilePath); + if (cookie == 0) { + return null; + } + parser = assmgr.openXmlResourceParser(cookie, "AndroidManifest.xml"); } catch (Exception e) { if (assmgr != null) assmgr.close(); diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index 6767747..58c79fc 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -1708,6 +1708,7 @@ public class Camera { private static final String PIXEL_FORMAT_YUV420P = "yuv420p"; private static final String PIXEL_FORMAT_RGB565 = "rgb565"; private static final String PIXEL_FORMAT_JPEG = "jpeg"; + private static final String PIXEL_FORMAT_BAYER_RGGB = "bayer-rggb"; private HashMap<String, String> mMap; @@ -2258,6 +2259,7 @@ public class Camera { case ImageFormat.YV12: return PIXEL_FORMAT_YUV420P; case ImageFormat.RGB_565: return PIXEL_FORMAT_RGB565; case ImageFormat.JPEG: return PIXEL_FORMAT_JPEG; + case ImageFormat.BAYER_RGGB: return PIXEL_FORMAT_BAYER_RGGB; default: return null; } } diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index a564d97..eb9cd21 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -16,10 +16,11 @@ package android.net; +import static com.android.internal.util.Preconditions.checkNotNull; + import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.os.Binder; -import android.os.ParcelFileDescriptor; import android.os.RemoteException; import java.net.InetAddress; @@ -67,11 +68,19 @@ public class ConnectivityManager { * is set to {@code true} if there are no connected networks at all. */ public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE"; + /** * The lookup key for a {@link NetworkInfo} object. Retrieve with * {@link android.content.Intent#getParcelableExtra(String)}. + * + * @deprecated Since {@link NetworkInfo} can vary based on UID, applications + * should always obtain network information through + * {@link #getActiveNetworkInfo()} or + * {@link #getAllNetworkInfo()}. */ + @Deprecated public static final String EXTRA_NETWORK_INFO = "networkInfo"; + /** * The lookup key for a boolean that indicates whether a connect event * is for a network to which the connectivity manager was failing over @@ -515,6 +524,19 @@ public class ConnectivityManager { } /** + * Return quota status for the current active network, or {@code null} if no + * network is active. Quota status can change rapidly, so these values + * shouldn't be cached. + */ + public NetworkQuotaInfo getActiveNetworkQuotaInfo() { + try { + return mService.getActiveNetworkQuotaInfo(); + } catch (RemoteException e) { + return null; + } + } + + /** * Gets the value of the setting for enabling Mobile data. * * @return Whether mobile data is enabled. @@ -546,10 +568,7 @@ public class ConnectivityManager { * {@hide} */ public ConnectivityManager(IConnectivityManager service) { - if (service == null) { - throw new IllegalArgumentException("missing IConnectivityManager"); - } - mService = service; + mService = checkNotNull(service, "missing IConnectivityManager"); } /** diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index b1d99a4..f391200 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -18,6 +18,7 @@ package android.net; import android.net.LinkProperties; import android.net.NetworkInfo; +import android.net.NetworkQuotaInfo; import android.net.NetworkState; import android.net.ProxyProperties; import android.os.IBinder; @@ -47,6 +48,8 @@ interface IConnectivityManager NetworkState[] getAllNetworkState(); + NetworkQuotaInfo getActiveNetworkQuotaInfo(); + boolean setRadios(boolean onOff); boolean setRadio(int networkType, boolean turnOn); diff --git a/core/java/android/net/INetworkPolicyManager.aidl b/core/java/android/net/INetworkPolicyManager.aidl index 3e07b0a..633c38e 100644 --- a/core/java/android/net/INetworkPolicyManager.aidl +++ b/core/java/android/net/INetworkPolicyManager.aidl @@ -18,6 +18,8 @@ package android.net; import android.net.INetworkPolicyListener; import android.net.NetworkPolicy; +import android.net.NetworkQuotaInfo; +import android.net.NetworkState; import android.net.NetworkTemplate; /** @@ -27,6 +29,7 @@ import android.net.NetworkTemplate; */ interface INetworkPolicyManager { + /** Control UID policies. */ void setUidPolicy(int uid, int policy); int getUidPolicy(int uid); @@ -35,12 +38,17 @@ interface INetworkPolicyManager { void registerListener(INetworkPolicyListener listener); void unregisterListener(INetworkPolicyListener listener); + /** Control network policies atomically. */ void setNetworkPolicies(in NetworkPolicy[] policies); NetworkPolicy[] getNetworkPolicies(); + /** Snooze limit on policy matching given template. */ void snoozePolicy(in NetworkTemplate template); + /** Control if background data is restricted system-wide. */ void setRestrictBackground(boolean restrictBackground); boolean getRestrictBackground(); + NetworkQuotaInfo getNetworkQuotaInfo(in NetworkState state); + } diff --git a/core/java/android/net/NetworkQuotaInfo.aidl b/core/java/android/net/NetworkQuotaInfo.aidl new file mode 100644 index 0000000..98a02c4 --- /dev/null +++ b/core/java/android/net/NetworkQuotaInfo.aidl @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2011 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.net; + +parcelable NetworkQuotaInfo; diff --git a/core/java/android/net/NetworkQuotaInfo.java b/core/java/android/net/NetworkQuotaInfo.java new file mode 100644 index 0000000..b85f925 --- /dev/null +++ b/core/java/android/net/NetworkQuotaInfo.java @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 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.net; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Information about quota status on a specific network. + */ +public class NetworkQuotaInfo implements Parcelable { + private final long mEstimatedBytes; + private final long mSoftLimitBytes; + private final long mHardLimitBytes; + + public static final long NO_LIMIT = -1; + + /** {@hide} */ + public NetworkQuotaInfo(long estimatedBytes, long softLimitBytes, long hardLimitBytes) { + mEstimatedBytes = estimatedBytes; + mSoftLimitBytes = softLimitBytes; + mHardLimitBytes = hardLimitBytes; + } + + /** {@hide} */ + public NetworkQuotaInfo(Parcel in) { + mEstimatedBytes = in.readLong(); + mSoftLimitBytes = in.readLong(); + mHardLimitBytes = in.readLong(); + } + + public long getEstimatedBytes() { + return mEstimatedBytes; + } + + public long getSoftLimitBytes() { + return mSoftLimitBytes; + } + + public long getHardLimitBytes() { + return mHardLimitBytes; + } + + /** {@inheritDoc} */ + public int describeContents() { + return 0; + } + + /** {@inheritDoc} */ + public void writeToParcel(Parcel out, int flags) { + out.writeLong(mEstimatedBytes); + out.writeLong(mSoftLimitBytes); + out.writeLong(mHardLimitBytes); + } + + public static final Creator<NetworkQuotaInfo> CREATOR = new Creator<NetworkQuotaInfo>() { + public NetworkQuotaInfo createFromParcel(Parcel in) { + return new NetworkQuotaInfo(in); + } + + public NetworkQuotaInfo[] newArray(int size) { + return new NetworkQuotaInfo[size]; + } + }; +} diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java index 4ffabb1..7a4b811 100644 --- a/core/java/android/net/NetworkStatsHistory.java +++ b/core/java/android/net/NetworkStatsHistory.java @@ -405,11 +405,10 @@ public class NetworkStatsHistory implements Parcelable { final long curEnd = randomLong(r, curStart, end); entry.rxBytes = randomLong(r, 0, rx); entry.txBytes = randomLong(r, 0, tx); - - recordData(curStart, curEnd, entry); - rx -= entry.rxBytes; tx -= entry.txBytes; + + recordData(curStart, curEnd, entry); } } diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java index cb18ade..031375e 100644 --- a/core/java/android/server/BluetoothAdapterStateMachine.java +++ b/core/java/android/server/BluetoothAdapterStateMachine.java @@ -39,7 +39,7 @@ import java.io.PrintWriter; * (BluetootOn)<----------------------<- * | ^ -------------------->- | * | | | | - * TURN_OFF | | BECAME_PAIRABLE m1 | | USER_TURN_ON + * TURN_OFF | | BECAME_PAIRABLE m1 | | USER_TURN_ON * AIRPLANE_MODE_ON | | | | * V | | | * (Switching) (PerProcessState) @@ -47,7 +47,7 @@ import java.io.PrintWriter; * BECAME_NON_PAIRABLE& | | TURN_ON(_CONTINUE) | | * ALL_DEVICES_DISCONNECTED | | m2 | | * V |------------------------< | BECAME_PAIRABLE - * (HotOff)---------------------------- PER_PROCESS_TURN_ON + * (HotOff)-------------------------->- PER_PROCESS_TURN_ON * / ^ * / | SERVICE_RECORD_LOADED * | | @@ -59,7 +59,7 @@ import java.io.PrintWriter; * (PowerOff) <----- initial state * * Legend: - * m1 = USER_TURN_OFF + * m1 = TURN_HOT * m2 = Transition to HotOff when number of process wanting BT on is 0. * BECAME_NON_PAIRABLE will make the transition. */ @@ -73,6 +73,9 @@ final class BluetoothAdapterStateMachine extends StateMachine { static final int USER_TURN_ON = 1; // We get this message when user tries to turn off BT static final int USER_TURN_OFF = 2; + // Per process enable / disable messages + static final int PER_PROCESS_TURN_ON = 3; + static final int PER_PROCESS_TURN_OFF = 4; // Message(what) to report a event that the state machine need to respond to // @@ -102,9 +105,8 @@ final class BluetoothAdapterStateMachine extends StateMachine { private static final int TURN_ON_CONTINUE = 102; // Unload firmware, turning off Bluetooth module power private static final int TURN_COLD = 103; - // Per process enable / disable messages - static final int PER_PROCESS_TURN_ON = 104; - static final int PER_PROCESS_TURN_OFF = 105; + // Device disconnecting timeout happens + private static final int DEVICES_DISCONNECT_TIMEOUT = 104; private Context mContext; private BluetoothService mBluetoothService; @@ -120,6 +122,9 @@ final class BluetoothAdapterStateMachine extends StateMachine { // this is the BluetoothAdapter state that reported externally private int mPublicState; + // timeout value waiting for all the devices to be disconnected + private static final int DEVICES_DISCONNECT_TIMEOUT_TIME = 3000; + BluetoothAdapterStateMachine(Context context, BluetoothService bluetoothService, BluetoothAdapter bluetoothAdapter) { super(TAG); @@ -214,8 +219,9 @@ final class BluetoothAdapterStateMachine extends StateMachine { case PER_PROCESS_TURN_OFF: perProcessCallback(false, (IBluetoothStateChangeCallback) message.obj); break; - case AIRPLANE_MODE_ON: - case USER_TURN_OFF: // ignore + case USER_TURN_OFF: + Log.w(TAG, "PowerOff received: " + message.what); + case AIRPLANE_MODE_ON: // ignore break; default: return NOT_HANDLED; @@ -301,7 +307,8 @@ final class BluetoothAdapterStateMachine extends StateMachine { case PER_PROCESS_TURN_OFF: deferMessage(message); break; - case USER_TURN_OFF: // ignore + case USER_TURN_OFF: + Log.w(TAG, "WarmUp received: " + message.what); break; default: return NOT_HANDLED; @@ -344,7 +351,6 @@ final class BluetoothAdapterStateMachine extends StateMachine { mBluetoothService.shutoffBluetooth(); mEventLoop.stop(); transitionTo(mPowerOff); - // ASSERT no support of config_bluetooth_adapter_quick_switch broadcastState(BluetoothAdapter.STATE_OFF); break; case AIRPLANE_MODE_OFF: @@ -354,8 +360,6 @@ final class BluetoothAdapterStateMachine extends StateMachine { broadcastState(BluetoothAdapter.STATE_TURNING_ON); } break; - case USER_TURN_OFF: // ignore - break; case PER_PROCESS_TURN_ON: transitionTo(mPerProcessState); @@ -368,6 +372,8 @@ final class BluetoothAdapterStateMachine extends StateMachine { case PER_PROCESS_TURN_OFF: perProcessCallback(false, (IBluetoothStateChangeCallback)message.obj); break; + case USER_TURN_OFF: // ignore + break; default: return NOT_HANDLED; } @@ -399,16 +405,28 @@ final class BluetoothAdapterStateMachine extends StateMachine { case BECAME_NON_PAIRABLE: if (mBluetoothService.getAdapterConnectionState() == BluetoothAdapter.STATE_DISCONNECTED) { + removeMessages(DEVICES_DISCONNECT_TIMEOUT); transitionTo(mHotOff); finishSwitchingOff(); } break; case ALL_DEVICES_DISCONNECTED: + removeMessages(DEVICES_DISCONNECT_TIMEOUT); if (mBluetoothService.getScanMode() == BluetoothAdapter.SCAN_MODE_NONE) { transitionTo(mHotOff); finishSwitchingOff(); } break; + case DEVICES_DISCONNECT_TIMEOUT: + sendMessage(ALL_DEVICES_DISCONNECTED); + // reset the hardware for error recovery + Log.e(TAG, "Devices failed to disconnect, reseting..."); + deferMessage(obtainMessage(TURN_COLD)); + if (mContext.getResources().getBoolean + (com.android.internal.R.bool.config_bluetooth_adapter_quick_switch)) { + deferMessage(obtainMessage(TURN_HOT)); + } + break; case USER_TURN_ON: case AIRPLANE_MODE_OFF: case AIRPLANE_MODE_ON: @@ -457,7 +475,7 @@ final class BluetoothAdapterStateMachine extends StateMachine { } if (!mBluetoothService.isApplicationStateChangeTrackerEmpty()) { transitionTo(mPerProcessState); - deferMessage(obtainMessage(USER_TURN_OFF)); + deferMessage(obtainMessage(TURN_HOT)); break; } //$FALL-THROUGH$ to AIRPLANE_MODE_ON @@ -466,6 +484,7 @@ final class BluetoothAdapterStateMachine extends StateMachine { broadcastState(BluetoothAdapter.STATE_TURNING_OFF); mBluetoothService.switchConnectable(false); mBluetoothService.disconnectDevices(); + sendMessageDelayed(DEVICES_DISCONNECT_TIMEOUT, DEVICES_DISCONNECT_TIMEOUT_TIME); // we turn all the way to PowerOff with AIRPLANE_MODE_ON if (message.what == AIRPLANE_MODE_ON) { @@ -474,8 +493,9 @@ final class BluetoothAdapterStateMachine extends StateMachine { deferMessage(obtainMessage(AIRPLANE_MODE_ON)); } break; - case AIRPLANE_MODE_OFF: // ignore - case USER_TURN_ON: // ignore + case AIRPLANE_MODE_OFF: + case USER_TURN_ON: + Log.w(TAG, "BluetoothOn received: " + message.what); break; case PER_PROCESS_TURN_ON: perProcessCallback(true, (IBluetoothStateChangeCallback)message.obj); @@ -526,19 +546,34 @@ final class BluetoothAdapterStateMachine extends StateMachine { // run bluetooth now that it's turned on mBluetoothService.runBluetooth(); break; - case USER_TURN_OFF: + case TURN_HOT: broadcastState(BluetoothAdapter.STATE_TURNING_OFF); if (mBluetoothService.getAdapterConnectionState() != BluetoothAdapter.STATE_DISCONNECTED) { mBluetoothService.disconnectDevices(); + sendMessageDelayed(DEVICES_DISCONNECT_TIMEOUT, + DEVICES_DISCONNECT_TIMEOUT_TIME); break; } //$FALL-THROUGH$ all devices are already disconnected case ALL_DEVICES_DISCONNECTED: + removeMessages(DEVICES_DISCONNECT_TIMEOUT); mBluetoothService.finishDisable(); broadcastState(BluetoothAdapter.STATE_OFF); break; - case PER_PROCESS_TURN_OFF: + case DEVICES_DISCONNECT_TIMEOUT: + mBluetoothService.finishDisable(); + broadcastState(BluetoothAdapter.STATE_OFF); + Log.e(TAG, "Devices fail to disconnect, reseting..."); + transitionTo(mHotOff); + deferMessage(obtainMessage(TURN_COLD)); + for (IBluetoothStateChangeCallback c: + mBluetoothService.getApplicationStateChangeCallbacks()) { + perProcessCallback(false, c); + deferMessage(obtainMessage(PER_PROCESS_TURN_ON, c)); + } + break; + case PER_PROCESS_TURN_OFF: perProcessCallback(false, (IBluetoothStateChangeCallback)message.obj); if (mBluetoothService.isApplicationStateChangeTrackerEmpty()) { mBluetoothService.switchConnectable(false); @@ -557,6 +592,9 @@ final class BluetoothAdapterStateMachine extends StateMachine { // we turn all the way to PowerOff with AIRPLANE_MODE_ON deferMessage(obtainMessage(AIRPLANE_MODE_ON)); break; + case USER_TURN_OFF: + Log.w(TAG, "PerProcessState received: " + message.what); + break; default: return NOT_HANDLED; } diff --git a/core/java/android/server/BluetoothPanProfileHandler.java b/core/java/android/server/BluetoothPanProfileHandler.java index ff22a45..37cfdc4 100644 --- a/core/java/android/server/BluetoothPanProfileHandler.java +++ b/core/java/android/server/BluetoothPanProfileHandler.java @@ -145,13 +145,14 @@ final class BluetoothPanProfileHandler { return false; } - handlePanDeviceStateChange(device, BluetoothPan.STATE_CONNECTING, + // Send interface as null as it is not known + handlePanDeviceStateChange(device, null, BluetoothPan.STATE_CONNECTING, BluetoothPan.LOCAL_PANU_ROLE); if (mBluetoothService.connectPanDeviceNative(objectPath, "nap")) { debugLog("connecting to PAN"); return true; } else { - handlePanDeviceStateChange(device, BluetoothPan.STATE_DISCONNECTED, + handlePanDeviceStateChange(device, null, BluetoothPan.STATE_DISCONNECTED, BluetoothPan.LOCAL_PANU_ROLE); errorLog("could not connect to PAN"); return false; @@ -168,8 +169,8 @@ final class BluetoothPanProfileHandler { panDevice.mLocalRole == BluetoothPan.LOCAL_NAP_ROLE) { String objectPath = mBluetoothService.getObjectPathFromAddress(device.getAddress()); - handlePanDeviceStateChange(device, BluetoothPan.STATE_DISCONNECTING, - panDevice.mLocalRole); + handlePanDeviceStateChange(device, panDevice.mIface, + BluetoothPan.STATE_DISCONNECTING, panDevice.mLocalRole); if (!mBluetoothService.disconnectPanServerDeviceNative(objectPath, device.getAddress(), @@ -177,7 +178,7 @@ final class BluetoothPanProfileHandler { errorLog("could not disconnect Pan Server Device "+device.getAddress()); // Restore prev state - handlePanDeviceStateChange(device, state, + handlePanDeviceStateChange(device, panDevice.mIface, state, panDevice.mLocalRole); return false; @@ -230,19 +231,19 @@ final class BluetoothPanProfileHandler { return false; } - handlePanDeviceStateChange(device, BluetoothPan.STATE_DISCONNECTING, + handlePanDeviceStateChange(device, panDevice.mIface, BluetoothPan.STATE_DISCONNECTING, panDevice.mLocalRole); if (panDevice.mLocalRole == BluetoothPan.LOCAL_NAP_ROLE) { if (!mBluetoothService.disconnectPanServerDeviceNative(objectPath, device.getAddress(), panDevice.mIface)) { // Restore prev state, this shouldn't happen - handlePanDeviceStateChange(device, state, panDevice.mLocalRole); + handlePanDeviceStateChange(device, panDevice.mIface, state, panDevice.mLocalRole); return false; } } else { if (!mBluetoothService.disconnectPanDeviceNative(objectPath)) { // Restore prev state, this shouldn't happen - handlePanDeviceStateChange(device, state, panDevice.mLocalRole); + handlePanDeviceStateChange(device, panDevice.mIface, state, panDevice.mLocalRole); return false; } } @@ -305,11 +306,6 @@ final class BluetoothPanProfileHandler { mBluetoothService.sendConnectionStateChange(device, state, prevState); } - void handlePanDeviceStateChange(BluetoothDevice device, - int state, int role) { - handlePanDeviceStateChange(device, null, state, role); - } - private class BluetoothPanDevice { private int mState; private String mIfaceAddr; diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 28546dc..3029c9d 100755 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -1565,6 +1565,8 @@ public class BluetoothService extends IBluetooth.Stub { @Override public boolean changeApplicationBluetoothState(boolean on, IBluetoothStateChangeCallback callback, IBinder binder) { + mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); + int pid = Binder.getCallingPid(); //mStateChangeTracker is a synchronized map if (!mStateChangeTracker.containsKey(pid)) { diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java index 744d564..f2b6b1f 100644 --- a/core/java/android/view/HardwareRenderer.java +++ b/core/java/android/view/HardwareRenderer.java @@ -635,16 +635,8 @@ public abstract class HardwareRenderer { destroySurface(); // Create an EGL surface we can render into. - mEglSurface = sEgl.eglCreateWindowSurface(sEglDisplay, sEglConfig, holder, null); - - if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { - int error = sEgl.eglGetError(); - if (error == EGL_BAD_NATIVE_WINDOW) { - Log.e(LOG_TAG, "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); - return null; - } - throw new RuntimeException("createWindowSurface failed " - + getEGLErrorString(error)); + if (!createSurface(holder)) { + return null; } /* @@ -713,24 +705,34 @@ public abstract class HardwareRenderer { // Cancels any existing buffer to ensure we'll get a buffer // of the right size before we call eglSwapBuffers sEgl.eglMakeCurrent(sEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - + if (mEglSurface != null && mEglSurface != EGL_NO_SURFACE) { sEgl.eglDestroySurface(sEglDisplay, mEglSurface); + mEglSurface = null; + setEnabled(false); } if (holder.getSurface().isValid()) { - mEglSurface = sEgl.eglCreateWindowSurface(sEglDisplay, sEglConfig, holder, null); - - if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { - int error = sEgl.eglGetError(); - if (error == EGL_BAD_NATIVE_WINDOW) { - Log.e(LOG_TAG, "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); - return; - } - throw new RuntimeException("createWindowSurface failed " - + getEGLErrorString(error)); + if (!createSurface(holder)) { + return; } + setEnabled(true); + } + } + + private boolean createSurface(SurfaceHolder holder) { + mEglSurface = sEgl.eglCreateWindowSurface(sEglDisplay, sEglConfig, holder, null); + + if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { + int error = sEgl.eglGetError(); + if (error == EGL_BAD_NATIVE_WINDOW) { + Log.e(LOG_TAG, "createWindowSurface returned EGL_BAD_NATIVE_WINDOW."); + return false; + } + throw new RuntimeException("createWindowSurface failed " + + getEGLErrorString(error)); } + return true; } @Override diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index 836867b..7a96a50 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -29,30 +29,84 @@ public class Surface implements Parcelable { private static final String LOG_TAG = "Surface"; private static final boolean DEBUG_RELEASE = false; - /* flags used in constructor (keep in sync with ISurfaceComposer.h) */ + /* orientations for setOrientation() */ + public static final int ROTATION_0 = 0; + public static final int ROTATION_90 = 1; + public static final int ROTATION_180 = 2; + public static final int ROTATION_270 = 3; - /** Surface is created hidden */ - public static final int HIDDEN = 0x00000004; + /** + * Does this object hold a valid surface? Returns true if it holds + * a physical surface, so lockCanvas() will succeed. Otherwise + * returns false. + */ + public native boolean isValid(); - /** The surface is to be used by hardware accelerators or DMA engines - * @deprecated this is ignored, this value is set automatically when needed. + /** Release the local reference to the server-side surface. + * Always call release() when you're done with a Surface. This will + * make the surface invalid. */ - @Deprecated - public static final int HARDWARE = 0x00000010; + public native void release(); + + /** draw into a surface */ + public Canvas lockCanvas(Rect dirty) throws OutOfResourcesException, IllegalArgumentException { + /* + * the dirty rectangle may be expanded to the surface's size, if for + * instance it has been resized or if the bits were lost, since the last + * call. + */ + return lockCanvasNative(dirty); + } + + /** unlock the surface and asks a page flip */ + public native void unlockCanvasAndPost(Canvas canvas); - /** Implies "HARDWARE", the surface is to be used by the GPU; - * additionally the backbuffer is never preserved for these - * surfaces. - * @deprecated this is ignored, this value is set automatically when needed. + /** + * unlock the surface. the screen won't be updated until + * post() or postAll() is called */ - @Deprecated - public static final int GPU = 0x00000028; + public native void unlockCanvas(Canvas canvas); + + @Override + public String toString() { + return "Surface(name=" + mName + ", identity=" + getIdentity() + ")"; + } + + public int describeContents() { + return 0; + } + + public native void readFromParcel(Parcel source); + public native void writeToParcel(Parcel dest, int flags); + + /** + * Exception thrown when a surface couldn't be created or resized + */ + public static class OutOfResourcesException extends Exception { + public OutOfResourcesException() { + } + public OutOfResourcesException(String name) { + super(name); + } + } + + /* + * ----------------------------------------------------------------------- + * No user serviceable parts beyond this point + * ----------------------------------------------------------------------- + */ + + /* flags used in constructor (keep in sync with ISurfaceComposer.h) */ + + /** Surface is created hidden @hide */ + public static final int HIDDEN = 0x00000004; /** The surface contains secure content, special measures will * be taken to disallow the surface's content to be copied from * another process. In particular, screenshots and VNC servers will * be disabled, but other measures can take place, for instance the - * surface might not be hardware accelerated. */ + * surface might not be hardware accelerated. + * @hide*/ public static final int SECURE = 0x00000080; /** Creates a surface where color components are interpreted as @@ -75,20 +129,11 @@ public class Surface implements Parcelable { * * In some rare situations, a non pre-multiplied surface is preferable. * + * @hide */ public static final int NON_PREMULTIPLIED = 0x00000100; /** - * Creates a surface without a rendering buffer. Instead, the content - * of the surface must be pushed by an external entity. This type - * of surface can be used for efficient camera preview or movie - * playback. - * - * @deprecated not support by the system anymore - */ - @Deprecated - public static final int PUSH_BUFFERS = 0x00000200; - /** * Indicates that the surface must be considered opaque, even if its * pixel format is set to translucent. This can be useful if an * application needs full RGBA 8888 support for instance but will @@ -109,7 +154,7 @@ public class Surface implements Parcelable { // 0x1000 is reserved for an independent DRM protected flag in framework - /** Creates a normal surface. This is the default. */ + /** Creates a normal surface. This is the default. @hide */ public static final int FX_SURFACE_NORMAL = 0x00000000; /** Creates a Blur surface. Everything behind this surface is blurred @@ -117,6 +162,7 @@ public class Surface implements Parcelable { * is not settable or guaranteed. * It is an error to lock a Blur surface, since it doesn't have * a backing store. + * @hide */ public static final int FX_SURFACE_BLUR = 0x00010000; @@ -124,55 +170,35 @@ public class Surface implements Parcelable { * by the amount specified in {@link #setAlpha}. * It is an error to lock a Dim surface, since it doesn't have * a backing store. + * @hide */ public static final int FX_SURFACE_DIM = 0x00020000; - /** Mask used for FX values above */ + /** Mask used for FX values above @hide */ public static final int FX_SURFACE_MASK = 0x000F0000; /* flags used with setFlags() (keep in sync with ISurfaceComposer.h) */ - /** Hide the surface. Equivalent to calling hide(). */ + /** Hide the surface. Equivalent to calling hide(). @hide */ public static final int SURFACE_HIDDEN = 0x01; - /** Freeze the surface. Equivalent to calling freeze(). */ + /** Freeze the surface. Equivalent to calling freeze(). @hide */ public static final int SURFACE_FROZEN = 0x02; - /** - * @deprecated Use {@link #SURFACE_FROZEN} instead. - */ - @Deprecated - public static final int SURACE_FROZEN = 0x02; - - /** Enable dithering when compositing this surface */ + /** Enable dithering when compositing this surface @hide */ public static final int SURFACE_DITHER = 0x04; - - public static final int SURFACE_BLUR_FREEZE= 0x10; - - /* orientations for setOrientation() */ - public static final int ROTATION_0 = 0; - public static final int ROTATION_90 = 1; - public static final int ROTATION_180 = 2; - public static final int ROTATION_270 = 3; - /** - * Disable the orientation animation - * {@hide} - */ + /** Disable the orientation animation @hide */ public static final int FLAGS_ORIENTATION_ANIMATION_DISABLE = 0x000000001; // The mSurfaceControl will only be present for Surfaces used by the window // server or system processes. When this class is parceled we defer to the - // mSurfaceControl to do the parceling. Otherwise we parcel the mNativeSurface. - @SuppressWarnings("unused") + // mSurfaceControl to do the parceling. Otherwise we parcel the + // mNativeSurface. private int mSurfaceControl; - @SuppressWarnings("unused") private int mSaveCount; - @SuppressWarnings("unused") private Canvas mCanvas; - @SuppressWarnings("unused") private int mNativeSurface; - @SuppressWarnings("unused") private int mSurfaceGenerationId; private String mName; @@ -184,19 +210,8 @@ public class Surface implements Parcelable { // non compatibility mode. private Matrix mCompatibleMatrix; - @SuppressWarnings("unused") private Exception mCreationStack; - /** - * Exception thrown when a surface couldn't be created or resized - */ - public static class OutOfResourcesException extends Exception { - public OutOfResourcesException() { - } - public OutOfResourcesException(String name) { - super(name); - } - } /* * We use a class initializer to allow the native code to cache some @@ -219,10 +234,7 @@ public class Surface implements Parcelable { initFromSurfaceTexture(surfaceTexture); } - /** - * create a surface - * {@hide} - */ + /** create a surface @hide */ public Surface(SurfaceSession s, int pid, int display, int w, int h, int format, int flags) throws OutOfResourcesException { @@ -233,10 +245,7 @@ public class Surface implements Parcelable { init(s,pid,null,display,w,h,format,flags); } - /** - * create a surface with a name - * {@hide} - */ + /** create a surface with a name @hide */ public Surface(SurfaceSession s, int pid, String name, int display, int w, int h, int format, int flags) throws OutOfResourcesException { @@ -251,7 +260,7 @@ public class Surface implements Parcelable { /** * Create an empty surface, which will later be filled in by * readFromParcel(). - * {@hide} + * @hide */ public Surface() { if (DEBUG_RELEASE) { @@ -260,16 +269,35 @@ public class Surface implements Parcelable { mCanvas = new CompatibleCanvas(); } + private Surface(Parcel source) throws OutOfResourcesException { + init(source); + } + /** - * A Canvas class that can handle the compatibility mode. This does two things differently. + * Copy another surface to this one. This surface now holds a reference + * to the same data as the original surface, and is -not- the owner. + * @hide + */ + public native void copyFrom(Surface o); + + /** @hide */ + public int getGenerationId() { + return mSurfaceGenerationId; + } + + /** + * A Canvas class that can handle the compatibility mode. This does two + * things differently. * <ul> - * <li> Returns the width and height of the target metrics, rather than native. - * For example, the canvas returns 320x480 even if an app is running in WVGA high density. - * <li> Scales the matrix in setMatrix by the application scale, except if the matrix looks - * like obtained from getMatrix. This is a hack to handle the case that an application - * uses getMatrix to keep the original matrix, set matrix of its own, then set the original - * matrix back. There is no perfect solution that works for all cases, and there are a lot of - * cases that this model does not work, but we hope this works for many apps. + * <li>Returns the width and height of the target metrics, rather than + * native. For example, the canvas returns 320x480 even if an app is running + * in WVGA high density. + * <li>Scales the matrix in setMatrix by the application scale, except if + * the matrix looks like obtained from getMatrix. This is a hack to handle + * the case that an application uses getMatrix to keep the original matrix, + * set matrix of its own, then set the original matrix back. There is no + * perfect solution that works for all cases, and there are a lot of cases + * that this model does not work, but we hope this works for many apps. * </ul> */ private class CompatibleCanvas extends Canvas { @@ -318,7 +346,8 @@ public class Surface implements Parcelable { } /** - * Sets the translator used to scale canvas's width/height in compatibility mode. + * Sets the translator used to scale canvas's width/height in compatibility + * mode. */ void setCompatibilityTranslator(Translator translator) { if (translator != null) { @@ -328,73 +357,29 @@ public class Surface implements Parcelable { } } - /** - * Copy another surface to this one. This surface now holds a reference - * to the same data as the original surface, and is -not- the owner. - * {@hide} - */ - public native void copyFrom(Surface o); - - /** - * Does this object hold a valid surface? Returns true if it holds - * a physical surface, so lockCanvas() will succeed. Otherwise - * returns false. - */ - public native boolean isValid(); - - /** - * @hide - */ - public int getGenerationId() { - return mSurfaceGenerationId; - } - /** Free all server-side state associated with this surface and - * release this object's reference. {@hide} */ + * release this object's reference. @hide */ public native void destroy(); - /** Release the local reference to the server-side surface. @hide */ - public native void release(); + private native Canvas lockCanvasNative(Rect dirty); - /** draw into a surface */ - public Canvas lockCanvas(Rect dirty) throws OutOfResourcesException, IllegalArgumentException - { - /* the dirty rectangle may be expanded to the surface's size, if - * for instance it has been resized or if the bits were lost, since - * the last call. - */ - return lockCanvasNative(dirty); - } - - private native Canvas lockCanvasNative(Rect dirty); - - /** unlock the surface and asks a page flip */ - public native void unlockCanvasAndPost(Canvas canvas); - - /** - * unlock the surface. the screen won't be updated until - * post() or postAll() is called + /* + * set display parameters & screenshots */ - public native void unlockCanvas(Canvas canvas); - /** start/end a transaction {@hide} */ - public static native void openTransaction(); - /** {@hide} */ - public static native void closeTransaction(); - /** * Freezes the specified display, No updating of the screen will occur * until unfreezeDisplay() is called. Everything else works as usual though, * in particular transactions. * @param display - * {@hide} + * @hide */ public static native void freezeDisplay(int display); /** * resume updating the specified display. * @param display - * {@hide} + * @hide */ public static native void unfreezeDisplay(int display); @@ -403,7 +388,7 @@ public class Surface implements Parcelable { * @param display * @param orientation * @param flags - * {@hide} + * @hide */ public static native void setOrientation(int display, int orientation, int flags); @@ -411,6 +396,7 @@ public class Surface implements Parcelable { * set the orientation of the given display. * @param display * @param orientation + * @hide */ public static void setOrientation(int display, int orientation) { setOrientation(display, orientation, 0); @@ -441,44 +427,43 @@ public class Surface implements Parcelable { */ public static native Bitmap screenshot(int width, int height, int minLayer, int maxLayer); - /** + + /* * set surface parameters. * needs to be inside open/closeTransaction block */ + + /** start a transaction @hide */ + public static native void openTransaction(); + /** end a transaction @hide */ + public static native void closeTransaction(); + /** @hide */ public native void setLayer(int zorder); + /** @hide */ public native void setPosition(int x, int y); + /** @hide */ public native void setSize(int w, int h); - + /** @hide */ public native void hide(); + /** @hide */ public native void show(); + /** @hide */ public native void setTransparentRegionHint(Region region); + /** @hide */ public native void setAlpha(float alpha); - public native void setMatrix(float dsdx, float dtdx, - float dsdy, float dtdy); - + /** @hide */ + public native void setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); + /** @hide */ public native void freeze(); + /** @hide */ public native void unfreeze(); - + /** @hide */ public native void setFreezeTint(int tint); - + /** @hide */ public native void setFlags(int flags, int mask); - @Override - public String toString() { - return "Surface(name=" + mName + ", identity=" + getIdentity() + ")"; - } - private Surface(Parcel source) throws OutOfResourcesException { - init(source); - } - - public int describeContents() { - return 0; - } - - public native void readFromParcel(Parcel source); - public native void writeToParcel(Parcel dest, int flags); - + public static final Parcelable.Creator<Surface> CREATOR = new Parcelable.Creator<Surface>() { @@ -496,7 +481,6 @@ public class Surface implements Parcelable { } }; - /* no user serviceable parts here ... */ @Override protected void finalize() throws Throwable { try { diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java index 96d6f09..76aa21f 100644 --- a/core/java/android/view/TextureView.java +++ b/core/java/android/view/TextureView.java @@ -204,6 +204,7 @@ public class TextureView extends View { } mLayer.destroy(); + mSurface.release(); mSurface = null; mLayer = null; } diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 911bf2f..ec4c5a2 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1253,6 +1253,11 @@ public final class ViewRootImpl extends Handler implements ViewParent, mScroller.abortAnimation(); } disposeResizeBuffer(); + // Our surface is gone + if (mAttachInfo.mHardwareRenderer != null && + mAttachInfo.mHardwareRenderer.isEnabled()) { + mAttachInfo.mHardwareRenderer.destroy(true); + } } else if (surfaceGenerationId != mSurface.getGenerationId() && mSurfaceHolder == null && mAttachInfo.mHardwareRenderer != null) { fullRedrawNeeded = true; @@ -1273,7 +1278,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, } } catch (RemoteException e) { } - + if (DEBUG_ORIENTATION) Log.v( TAG, "Relayout returned: frame=" + frame + ", surface=" + mSurface); diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java index 08ccd94..662137a 100644 --- a/core/java/android/view/VolumePanel.java +++ b/core/java/android/view/VolumePanel.java @@ -26,7 +26,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; -import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.media.AudioService; import android.media.AudioSystem; @@ -36,13 +35,9 @@ import android.net.Uri; import android.os.Handler; import android.os.Message; import android.os.Vibrator; -import android.telephony.TelephonyManager; import android.util.Log; import android.widget.ImageView; -import android.widget.ProgressBar; import android.widget.SeekBar; -import android.widget.TextView; -import android.widget.Toast; import android.widget.SeekBar.OnSeekBarChangeListener; import java.util.HashMap; @@ -52,6 +47,10 @@ import java.util.HashMap; * * This code really should be moved elsewhere. * + * Seriously, it really really should be moved elsewhere. This is used by + * android.media.AudioService, which actually runs in the system process, to + * show the volume dialog when the user changes the volume. What a mess. + * * @hide */ public class VolumePanel extends Handler implements OnSeekBarChangeListener, View.OnClickListener @@ -194,7 +193,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie window.setGravity(Gravity.TOP); WindowManager.LayoutParams lp = window.getAttributes(); lp.token = null; - lp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; + lp.type = WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; window.setAttributes(lp); window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index d1ad113..ff378a6 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -394,6 +394,13 @@ public interface WindowManager extends ViewManager { public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19; /** + * Window type: The volume level overlay/dialog shown when the user + * changes the system volume. + * @hide + */ + public static final int TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20; + + /** * End of types of system windows. */ public static final int LAST_SYSTEM_WINDOW = 2999; diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index cadf2ab..9737a5a 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -628,6 +628,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private int mGlowPaddingLeft; private int mGlowPaddingRight; + private int mLastAccessibilityScrollEventFromIndex; + private int mLastAccessibilityScrollEventToIndex; + /** * Interface definition for a callback to be invoked when the list or grid * has been scrolled. @@ -1265,6 +1268,24 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } @Override + public void sendAccessibilityEvent(int eventType) { + // Since this class calls onScrollChanged even if the mFirstPosition and the + // child count have not changed we will avoid sending duplicate accessibility + // events. + if (eventType == AccessibilityEvent.TYPE_VIEW_SCROLLED) { + final int lastPosition = mFirstPosition + getChildCount(); + if (mLastAccessibilityScrollEventFromIndex == mFirstPosition + && mLastAccessibilityScrollEventToIndex == lastPosition) { + return; + } else { + mLastAccessibilityScrollEventFromIndex = mFirstPosition; + mLastAccessibilityScrollEventToIndex = lastPosition; + } + } + super.sendAccessibilityEvent(eventType); + } + + @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); event.setScrollable(true); diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java index 00c75a9..9f5737e 100644 --- a/core/java/android/widget/AdapterView.java +++ b/core/java/android/widget/AdapterView.java @@ -277,6 +277,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { * called, false otherwise is returned. */ public boolean performItemClick(View view, int position, long id) { + view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); if (mOnItemClickListener != null) { playSoundEffect(SoundEffectConstants.CLICK); mOnItemClickListener.onItemClick(this, view, position, id); diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 968d612..04cf69b 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8449,6 +8449,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener info.setPassword(isPassword); } + @Override + public void sendAccessibilityEvent(int eventType) { + // Do not send scroll events since first they are not interesting for + // accessibility and second such events a generated too frequently. + // For details see the implementation of bringTextIntoView(). + if (eventType == AccessibilityEvent.TYPE_VIEW_SCROLLED) { + return; + } + super.sendAccessibilityEvent(eventType); + } + void sendAccessibilityEventTypeViewTextChanged(CharSequence beforeText, int fromIndex, int removedCount, int addedCount) { AccessibilityEvent event = diff --git a/core/java/com/android/internal/content/NativeLibraryHelper.java b/core/java/com/android/internal/content/NativeLibraryHelper.java index 1531946..6d65782 100644 --- a/core/java/com/android/internal/content/NativeLibraryHelper.java +++ b/core/java/com/android/internal/content/NativeLibraryHelper.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 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.content; import android.os.Build; @@ -17,6 +33,12 @@ public class NativeLibraryHelper { private static native long nativeSumNativeBinaries(String file, String cpuAbi, String cpuAbi2); + /** + * Sums the size of native binaries in an APK. + * + * @param apkFile APK file to scan for native libraries + * @return size of all native binary files in bytes + */ public static long sumNativeBinariesLI(File apkFile) { final String cpuAbi = Build.CPU_ABI; final String cpuAbi2 = Build.CPU_ABI2; @@ -26,6 +48,14 @@ public class NativeLibraryHelper { private native static int nativeCopyNativeBinaries(String filePath, String sharedLibraryPath, String cpuAbi, String cpuAbi2); + /** + * Copies native binaries to a shared library directory. + * + * @param apkFile APK file to scan for native libraries + * @param sharedLibraryDir directory for libraries to be copied to + * @return {@link PackageManager#INSTALL_SUCCEEDED} if successful or another + * error code from that class if not + */ public static int copyNativeBinariesIfNeededLI(File apkFile, File sharedLibraryDir) { final String cpuAbi = Build.CPU_ABI; final String cpuAbi2 = Build.CPU_ABI2; diff --git a/core/java/com/android/internal/content/PackageHelper.java b/core/java/com/android/internal/content/PackageHelper.java index ec64552..266728b 100644 --- a/core/java/com/android/internal/content/PackageHelper.java +++ b/core/java/com/android/internal/content/PackageHelper.java @@ -39,6 +39,8 @@ public class PackageHelper { public static final int RECOMMEND_FAILED_INVALID_LOCATION = -3; public static final int RECOMMEND_FAILED_ALREADY_EXISTS = -4; public static final int RECOMMEND_MEDIA_UNAVAILABLE = -5; + public static final int RECOMMEND_FAILED_INVALID_URI = -6; + private static final boolean localLOGV = true; private static final String TAG = "PackageHelper"; // App installation location settings values diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java index fb33748..366b983 100644 --- a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java +++ b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java @@ -29,6 +29,7 @@ import android.util.Log; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.View; +import android.view.ViewGroup; import android.view.ViewRootImpl; import com.android.internal.R; @@ -62,7 +63,8 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener { mContext = context; mTargetView = targetView; mKeyboardView = keyboardView; - if (useFullScreenWidth || mKeyboardView.getLayoutParams().width == -1) { + if (useFullScreenWidth + || mKeyboardView.getLayoutParams().width == ViewGroup.LayoutParams.MATCH_PARENT) { createKeyboards(); } else { createKeyboardsWithSpecificSize(mKeyboardView.getLayoutParams().width, diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index 2de0932..ffcd1a0 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -233,6 +233,12 @@ static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz) return surfaceTexture->getTimestamp(); } +static void SurfaceTexture_release(JNIEnv* env, jobject thiz) +{ + sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); + surfaceTexture->abandon(); +} + // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { @@ -243,6 +249,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeUpdateTexImage", "()V", (void*)SurfaceTexture_updateTexImage }, {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, + {"nativeRelease", "()V", (void*)SurfaceTexture_release }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index 830f70e..5118351 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -51,15 +51,17 @@ namespace android { -typedef void (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*); - // These match PackageManager.java install codes typedef enum { - INSTALL_SUCCEEDED = 0, + INSTALL_SUCCEEDED = 1, INSTALL_FAILED_INVALID_APK = -2, INSTALL_FAILED_INSUFFICIENT_STORAGE = -4, + INSTALL_FAILED_CONTAINER_ERROR = -18, + INSTALL_FAILED_INTERNAL_ERROR = -110, } install_status_t; +typedef install_status_t (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*); + // Equivalent to isFilenameSafe static bool isFilenameSafe(const char* filename) @@ -140,17 +142,19 @@ isFileDifferent(const char* filePath, size_t fileSize, time_t modifiedTime, return false; } -static void +static install_status_t sumFiles(JNIEnv* env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char* fileName) { size_t* total = (size_t*) arg; size_t uncompLen; if (!zipFile->getEntryInfo(zipEntry, NULL, &uncompLen, NULL, NULL, NULL, NULL)) { - return; + return INSTALL_FAILED_INVALID_APK; } *total += uncompLen; + + return INSTALL_SUCCEEDED; } /* @@ -158,7 +162,7 @@ sumFiles(JNIEnv* env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const * * This function assumes the library and path names passed in are considered safe. */ -static void +static install_status_t copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char* fileName) { jstring* javaNativeLibPath = (jstring*) arg; @@ -170,7 +174,8 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr time_t modTime; if (!zipFile->getEntryInfo(zipEntry, NULL, &uncompLen, NULL, NULL, &when, &crc)) { - return; + LOGD("Couldn't read zip entry info\n"); + return INSTALL_FAILED_INVALID_APK; } else { struct tm t; ZipFileRO::zipTimeToTimespec(when, &t); @@ -182,50 +187,50 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr char localFileName[nativeLibPath.size() + fileNameLen + 2]; if (strlcpy(localFileName, nativeLibPath.c_str(), sizeof(localFileName)) != nativeLibPath.size()) { - LOGD("Couldn't allocate local file name for library: %s", strerror(errno)); - return; + LOGD("Couldn't allocate local file name for library"); + return INSTALL_FAILED_INTERNAL_ERROR; } *(localFileName + nativeLibPath.size()) = '/'; if (strlcpy(localFileName + nativeLibPath.size() + 1, fileName, sizeof(localFileName) - nativeLibPath.size() - 1) != fileNameLen) { - LOGD("Couldn't allocate local file name for library: %s", strerror(errno)); - return; + LOGD("Couldn't allocate local file name for library"); + return INSTALL_FAILED_INTERNAL_ERROR; } // Only copy out the native file if it's different. struct stat st; if (!isFileDifferent(localFileName, uncompLen, modTime, crc, &st)) { - return; + return INSTALL_SUCCEEDED; } char localTmpFileName[nativeLibPath.size() + TMP_FILE_PATTERN_LEN + 2]; if (strlcpy(localTmpFileName, nativeLibPath.c_str(), sizeof(localTmpFileName)) != nativeLibPath.size()) { - LOGD("Couldn't allocate local file name for library: %s", strerror(errno)); - return; + LOGD("Couldn't allocate local file name for library"); + return INSTALL_FAILED_INTERNAL_ERROR; } *(localFileName + nativeLibPath.size()) = '/'; if (strlcpy(localTmpFileName + nativeLibPath.size(), TMP_FILE_PATTERN, TMP_FILE_PATTERN_LEN - nativeLibPath.size()) != TMP_FILE_PATTERN_LEN) { - LOGI("Couldn't allocate temporary file name for library: %s", strerror(errno)); - return; + LOGI("Couldn't allocate temporary file name for library"); + return INSTALL_FAILED_INTERNAL_ERROR; } int fd = mkstemp(localTmpFileName); if (fd < 0) { LOGI("Couldn't open temporary file name: %s: %s\n", localTmpFileName, strerror(errno)); - return; + return INSTALL_FAILED_CONTAINER_ERROR; } if (!zipFile->uncompressEntry(zipEntry, fd)) { - LOGI("Failed uncompressing %s to %s: %s", fileName, localTmpFileName, strerror(errno)); + LOGI("Failed uncompressing %s to %s\n", fileName, localTmpFileName); close(fd); unlink(localTmpFileName); - return; + return INSTALL_FAILED_CONTAINER_ERROR; } close(fd); @@ -238,7 +243,7 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr if (utimes(localTmpFileName, times) < 0) { LOGI("Couldn't change modification time on %s: %s\n", localTmpFileName, strerror(errno)); unlink(localTmpFileName); - return; + return INSTALL_FAILED_CONTAINER_ERROR; } // Set the mode to 755 @@ -246,17 +251,19 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr if (chmod(localTmpFileName, mode) < 0) { LOGI("Couldn't change permissions on %s: %s\n", localTmpFileName, strerror(errno)); unlink(localTmpFileName); - return; + return INSTALL_FAILED_CONTAINER_ERROR; } // Finally, rename it to the final name. if (rename(localTmpFileName, localFileName) < 0) { LOGI("Couldn't rename %s to %s: %s\n", localTmpFileName, localFileName, strerror(errno)); unlink(localTmpFileName); - return; + return INSTALL_FAILED_CONTAINER_ERROR; } LOGV("Successfully moved %s to %s\n", localTmpFileName, localFileName); + + return INSTALL_SUCCEEDED; } static install_status_t @@ -301,10 +308,7 @@ iterateOverNativeFiles(JNIEnv *env, jstring javaFilePath, jstring javaCpuAbi, js } const char* lastSlash = strrchr(fileName, '/'); - if (lastSlash == NULL) { - LOG_ASSERT("last slash was null somehow for %s\n", fileName); - continue; - } + LOG_ASSERT(lastSlash != NULL, "last slash was null somehow for %s\n", fileName); // Check to make sure the CPU ABI of this file is one we support. const char* cpuAbiOffset = fileName + APK_LIB_LEN; @@ -325,12 +329,17 @@ iterateOverNativeFiles(JNIEnv *env, jstring javaFilePath, jstring javaCpuAbi, js } // If this is a .so file, check to see if we need to copy it. - if (!strncmp(fileName + fileNameLen - LIB_SUFFIX_LEN, LIB_SUFFIX, LIB_SUFFIX_LEN) - && !strncmp(lastSlash, LIB_PREFIX, LIB_PREFIX_LEN) - && isFilenameSafe(lastSlash + 1)) { - callFunc(env, callArg, &zipFile, entry, lastSlash + 1); - } else if (!strncmp(lastSlash + 1, GDBSERVER, GDBSERVER_LEN)) { - callFunc(env, callArg, &zipFile, entry, lastSlash + 1); + if ((!strncmp(fileName + fileNameLen - LIB_SUFFIX_LEN, LIB_SUFFIX, LIB_SUFFIX_LEN) + && !strncmp(lastSlash, LIB_PREFIX, LIB_PREFIX_LEN) + && isFilenameSafe(lastSlash + 1)) + || !strncmp(lastSlash + 1, GDBSERVER, GDBSERVER_LEN)) { + + install_status_t ret = callFunc(env, callArg, &zipFile, entry, lastSlash + 1); + + if (ret != INSTALL_SUCCEEDED) { + LOGV("Failure for entry %s", lastSlash + 1); + return ret; + } } } @@ -341,7 +350,7 @@ static jint com_android_internal_content_NativeLibraryHelper_copyNativeBinaries(JNIEnv *env, jclass clazz, jstring javaFilePath, jstring javaNativeLibPath, jstring javaCpuAbi, jstring javaCpuAbi2) { - return iterateOverNativeFiles(env, javaFilePath, javaCpuAbi, javaCpuAbi2, + return (jint) iterateOverNativeFiles(env, javaFilePath, javaCpuAbi, javaCpuAbi2, copyFileIfChanged, &javaNativeLibPath); } diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..5e6a9d6 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differnew file mode 100644 index 0000000..eb9d740 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differnew file mode 100644 index 0000000..869a330 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..7ec33dd --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differnew file mode 100644 index 0000000..72d63da --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differnew file mode 100644 index 0000000..fcc5cac --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..baff858 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png diff --git a/core/res/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png b/core/res/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..5612c51 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..d449d76 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differnew file mode 100644 index 0000000..80fe863 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differnew file mode 100644 index 0000000..196d6d9 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..8f340d3 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differnew file mode 100644 index 0000000..b34b957 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differnew file mode 100644 index 0000000..02f4b3d --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..976083f --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png diff --git a/core/res/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png b/core/res/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..c39dd4a --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..d2cd029 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_off_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differnew file mode 100644 index 0000000..0f709eb --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_off_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differnew file mode 100644 index 0000000..2f4de8e --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..3871689 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differnew file mode 100644 index 0000000..836ea6e --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differnew file mode 100644 index 0000000..279db1f --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_light_normal_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differnew file mode 100644 index 0000000..b26f1d2 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_light_normal_holo.9.png diff --git a/core/res/res/drawable-xhdpi/btn_keyboard_key_light_pressed_holo.9.png b/core/res/res/drawable-xhdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differnew file mode 100644 index 0000000..c23a4b2 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_keyboard_key_light_pressed_holo.9.png diff --git a/core/res/res/drawable/btn_keyboard_key_ics.xml b/core/res/res/drawable/btn_keyboard_key_ics.xml new file mode 100644 index 0000000..7335cc2 --- /dev/null +++ b/core/res/res/drawable/btn_keyboard_key_ics.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <!-- Functional keys. --> + + <item android:state_single="true" android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_dark_pressed_holo" /> + <item android:state_single="true" + android:drawable="@drawable/btn_keyboard_key_dark_normal_holo" /> + + <!-- Toggle keys. Use checkable/checked state. --> + + <item android:state_checkable="true" android:state_checked="true" android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_dark_pressed_on_holo" /> + <item android:state_checkable="true" android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_dark_pressed_off_holo" /> + <item android:state_checkable="true" android:state_checked="true" + android:drawable="@drawable/btn_keyboard_key_dark_normal_on_holo" /> + <item android:state_checkable="true" + android:drawable="@drawable/btn_keyboard_key_dark_normal_off_holo" /> + + <!-- Normal keys --> + + <item android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" /> + <item android:drawable="@drawable/btn_keyboard_key_light_normal_holo" /> +</selector> diff --git a/core/res/res/layout/keyguard_screen_password_landscape.xml b/core/res/res/layout/keyguard_screen_password_landscape.xml index 960907d..c2536b7 100644 --- a/core/res/res/layout/keyguard_screen_password_landscape.xml +++ b/core/res/res/layout/keyguard_screen_password_landscape.xml @@ -118,41 +118,36 @@ /> <!-- Column 1 --> - <Space android:layout_width="32dip" android:layout_rowSpan="7" /> + <Space android:layout_width="16dip" android:layout_rowSpan="7" /> <!-- Column 2 - password entry field and PIN keyboard --> - <LinearLayout - android:orientation="vertical" - android:layout_gravity="center|fill" - android:layout_rowSpan="7"> - - <EditText android:id="@+id/passwordEntry" - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:singleLine="true" - android:textStyle="normal" - android:inputType="textPassword" - android:layout_gravity="center" - android:textSize="24sp" - android:minEms="8" - android:textAppearance="?android:attr/textAppearanceMedium" - android:background="@drawable/lockscreen_password_field_dark" - android:textColor="?android:attr/textColorPrimary" - android:imeOptions="flagNoFullscreen" - /> - - <!-- Numeric keyboard --> - <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" - android:layout_width="250dip" - android:layout_height="100dip" - android:layout_gravity="center" - android:background="#40000000" - android:layout_marginTop="5dip" - android:keyBackground="@drawable/btn_keyboard_key_fulltrans" - android:visibility="gone" + <EditText android:id="@+id/passwordEntry" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_gravity="fill" + android:gravity="center" + android:singleLine="true" + android:textStyle="normal" + android:inputType="textPassword" + android:textSize="24sp" + android:minEms="8" + android:textAppearance="?android:attr/textAppearanceMedium" + android:background="@drawable/lockscreen_password_field_dark" + android:textColor="?android:attr/textColorPrimary" + android:imeOptions="flagNoFullscreen|actionDone" /> - </LinearLayout> + <!-- Numeric keyboard --> + <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" + android:layout_width="270dip" + android:layout_height="wrap_content" + android:layout_marginRight="4dip" + android:background="#40000000" + android:layout_marginTop="5dip" + android:keyBackground="@*android:drawable/btn_keyboard_key_ics" + android:visibility="gone" + android:layout_rowSpan="6" + /> <!-- Music transport control --> <include android:id="@+id/transport" diff --git a/core/res/res/layout/keyguard_screen_password_portrait.xml b/core/res/res/layout/keyguard_screen_password_portrait.xml index 7a51035..cd33275 100644 --- a/core/res/res/layout/keyguard_screen_password_portrait.xml +++ b/core/res/res/layout/keyguard_screen_password_portrait.xml @@ -94,31 +94,32 @@ android:drawablePadding="4dip" /> - <Space android:layout_height="100dip"/> - <!-- Password entry field --> <EditText android:id="@+id/passwordEntry" android:layout_height="wrap_content" android:layout_width="match_parent" + android:layout_gravity="center_vertical|fill_horizontal" + android:gravity="center_horizontal" android:singleLine="true" android:textStyle="normal" android:inputType="textPassword" - android:gravity="center" - android:textSize="22sp" + android:textSize="36sp" android:layout_marginLeft="16dip" android:layout_marginRight="16dip" android:background="@drawable/lockscreen_password_field_dark" android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="#ffffffff"/> - - <Space android:layout_gravity="fill" /> + android:textColor="#ffffffff" + android:imeOptions="actionDone"/> <!-- Numeric keyboard --> <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" android:layout_width="match_parent" - android:layout_height="260dip" + android:layout_height="wrap_content" + android:layout_marginRight="4dip" + android:paddingTop="4dip" + android:paddingBottom="4dip" android:background="#40000000" - android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans" + android:keyBackground="@*android:drawable/btn_keyboard_key_ics" android:visibility="gone" /> @@ -139,7 +140,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dip" - android:layout_marginRight="16dip" android:layout_gravity="center_horizontal" android:drawableLeft="@*android:drawable/lockscreen_emergency_button" style="?android:attr/buttonBarButtonStyle" @@ -153,7 +153,7 @@ layout="@layout/keyguard_transport_control" android:layout_row="0" android:layout_column="0" - android:layout_rowSpan="4" + android:layout_rowSpan="3" android:layout_columnSpan="1" android:layout_gravity="fill" /> diff --git a/core/res/res/values-land/dimens.xml b/core/res/res/values-land/dimens.xml index 388eb38..02bb3c8 100644 --- a/core/res/res/values-land/dimens.xml +++ b/core/res/res/values-land/dimens.xml @@ -22,7 +22,7 @@ <!-- Default height of a key in the password keyboard for alpha --> <dimen name="password_keyboard_key_height_alpha">47dip</dimen> <!-- Default height of a key in the password keyboard for numeric --> - <dimen name="password_keyboard_key_height_numeric">60dip</dimen> + <dimen name="password_keyboard_key_height_numeric">50dip</dimen> <!-- Default correction for the space key in the password keyboard --> <dimen name="password_keyboard_spacebar_vertical_correction">2dip</dimen> <dimen name="preference_widget_width">72dp</dimen> diff --git a/core/res/res/values-large/themes.xml b/core/res/res/values-large/themes.xml index 9e3e0bb..871a131 100644 --- a/core/res/res/values-large/themes.xml +++ b/core/res/res/values-large/themes.xml @@ -16,6 +16,21 @@ ** limitations under the License. */ --> + +<!-- +=============================================================== + PLEASE READ +=============================================================== + +The Holo themes must not be modified in order to pass CTS. +Many related themes and styles depend on other values defined in this file. +If you would like to provide custom themes and styles for your device, +please see themes_device_defaults.xml. + +=============================================================== + PLEASE READ +=============================================================== + --> <resources> <style name="Theme.Holo.DialogWhenLarge" parent="@android:style/Theme.Holo.Dialog.MinWidth"> diff --git a/core/res/res/values-large/themes_device_defaults.xml b/core/res/res/values-large/themes_device_defaults.xml new file mode 100644 index 0000000..52fff5c --- /dev/null +++ b/core/res/res/values-large/themes_device_defaults.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2011 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. +--> + +<!-- +=============================================================== + PLEASE READ +=============================================================== +This file contains the themes that are the Device Defaults. +If you want to edit themes to skin your device, do it here. +We recommend that you do not edit themes.xml and instead edit +this file. + +Editing this file instead of themes.xml will greatly simplify +merges for future platform versions and CTS compliance will be +easier. +=============================================================== + PLEASE READ +=============================================================== + --> +<resources> + <style name="Theme.DeviceDefault.DialogWhenLarge" + parent="@android:style/Theme.DeviceDefault.Dialog.MinWidth"> + <item name="preferencePanelStyle">@style/PreferencePanel.Dialog</item> + </style> + <style name="Theme.DeviceDefault.DialogWhenLarge.NoActionBar" + parent="@android:style/Theme.DeviceDefault.Dialog.NoActionBar.MinWidth"> + <item name="preferencePanelStyle">@style/PreferencePanel.Dialog</item> + </style> + <style name="Theme.DeviceDefault.Light.DialogWhenLarge" + parent="@android:style/Theme.DeviceDefault.Light.Dialog.MinWidth"> + </style> + <style name="Theme.DeviceDefault.Light.DialogWhenLarge.NoActionBar" + parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth"> + </style> +</resources> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index b3e50ea..e534e9b 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -50,12 +50,17 @@ <dimen name="fastscroll_thumb_height">52dp</dimen> <!-- Min width for a tablet device --> <dimen name="min_xlarge_screen_width">800dp</dimen> - <!-- Default height of a key in the password keyboard for alpha --> + + <!-- Default height of a key in the password keyboard for alpha (used by keyguard) --> <dimen name="password_keyboard_key_height_alpha">56dip</dimen> - <!-- Default height of a key in the password keyboard for numeric --> + <!-- Default height of a key in the password keyboard for numeric (used by keyguard) --> <dimen name="password_keyboard_key_height_numeric">56dip</dimen> - <!-- Default correction for the space key in the password keyboard --> + <!-- Default correction for the space key in the password keyboard (used by keyguard) --> <dimen name="password_keyboard_spacebar_vertical_correction">4dip</dimen> + <!-- Default horizontal gap between keys in the password keyboard (used by keyguard) --> + <dimen name="password_keyboard_horizontalGap">3dip</dimen> + <!-- Default vertical gap between keys in the password keyboard (used by keyguard) --> + <dimen name="password_keyboard_verticalGap">9dip</dimen> <!-- Default target placement radius for MultiWaveView --> <dimen name="multiwaveview_target_placement_radius">135dip</dimen> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 2dfe453..f85dd85 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1803,6 +1803,183 @@ <public type="style" name="Widget.Holo.Light.ActionBar.TabText.Inverse" /> <public type="style" name="Widget.Holo.Light.ActionMode.Inverse" /> + <public type="style" name="Theme.DeviceDefault" /> + <public type="style" name="Theme.DeviceDefault.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.NoActionBar.Fullscreen" /> + <public type="style" name="Theme.DeviceDefault.Light" /> + <public type="style" name="Theme.DeviceDefault.Light.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.Light.NoActionBar.Fullscreen" /> + <public type="style" name="Theme.DeviceDefault.Dialog" /> + <public type="style" name="Theme.DeviceDefault.Dialog.MinWidth" /> + <public type="style" name="Theme.DeviceDefault.Dialog.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.Dialog.NoActionBar.MinWidth" /> + <public type="style" name="Theme.DeviceDefault.Light.Dialog" /> + <public type="style" name="Theme.DeviceDefault.Light.Dialog.MinWidth" /> + <public type="style" name="Theme.DeviceDefault.Light.Dialog.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth" /> + <public type="style" name="Theme.DeviceDefault.DialogWhenLarge" /> + <public type="style" name="Theme.DeviceDefault.DialogWhenLarge.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.Light.DialogWhenLarge" /> + <public type="style" name="Theme.DeviceDefault.Light.DialogWhenLarge.NoActionBar" /> + <public type="style" name="Theme.DeviceDefault.Panel" /> + <public type="style" name="Theme.DeviceDefault.Light.Panel" /> + <public type="style" name="Theme.DeviceDefault.Wallpaper" /> + <public type="style" name="Theme.DeviceDefault.Wallpaper.NoTitleBar" /> + <public type="style" name="Theme.DeviceDefault.InputMethod" /> + <public type="style" name="Theme.DeviceDefault.Light.DarkActionBar" /> + + <public type="style" name="Widget.DeviceDefault" /> + <public type="style" name="Widget.DeviceDefault.Button" /> + <public type="style" name="Widget.DeviceDefault.Button.Small" /> + <public type="style" name="Widget.DeviceDefault.Button.Inset" /> + <public type="style" name="Widget.DeviceDefault.Button.Toggle" /> + <public type="style" name="Widget.DeviceDefault.Button.Borderless.Small" /> + <public type="style" name="Widget.DeviceDefault.TextView" /> + <public type="style" name="Widget.DeviceDefault.AutoCompleteTextView" /> + <public type="style" name="Widget.DeviceDefault.CompoundButton.CheckBox" /> + <public type="style" name="Widget.DeviceDefault.ListView.DropDown" /> + <public type="style" name="Widget.DeviceDefault.EditText" /> + <public type="style" name="Widget.DeviceDefault.ExpandableListView" /> + <public type="style" name="Widget.DeviceDefault.GridView" /> + <public type="style" name="Widget.DeviceDefault.ImageButton" /> + <public type="style" name="Widget.DeviceDefault.ListView" /> + <public type="style" name="Widget.DeviceDefault.PopupWindow" /> + <public type="style" name="Widget.DeviceDefault.ProgressBar" /> + <public type="style" name="Widget.DeviceDefault.ProgressBar.Horizontal" /> + <public type="style" name="Widget.DeviceDefault.ProgressBar.Small" /> + <public type="style" name="Widget.DeviceDefault.ProgressBar.Small.Title" /> + <public type="style" name="Widget.DeviceDefault.ProgressBar.Large" /> + <public type="style" name="Widget.DeviceDefault.SeekBar" /> + <public type="style" name="Widget.DeviceDefault.RatingBar" /> + <public type="style" name="Widget.DeviceDefault.RatingBar.Indicator" /> + <public type="style" name="Widget.DeviceDefault.RatingBar.Small" /> + <public type="style" name="Widget.DeviceDefault.CompoundButton.RadioButton" /> + <public type="style" name="Widget.DeviceDefault.ScrollView" /> + <public type="style" name="Widget.DeviceDefault.HorizontalScrollView" /> + <public type="style" name="Widget.DeviceDefault.Spinner" /> + <public type="style" name="Widget.DeviceDefault.CompoundButton.Star" /> + <public type="style" name="Widget.DeviceDefault.TabWidget" /> + <public type="style" name="Widget.DeviceDefault.WebTextView" /> + <public type="style" name="Widget.DeviceDefault.WebView" /> + <public type="style" name="Widget.DeviceDefault.DropDownItem" /> + <public type="style" name="Widget.DeviceDefault.DropDownItem.Spinner" /> + <public type="style" name="Widget.DeviceDefault.TextView.SpinnerItem" /> + <public type="style" name="Widget.DeviceDefault.ListPopupWindow" /> + <public type="style" name="Widget.DeviceDefault.PopupMenu" /> + <public type="style" name="Widget.DeviceDefault.ActionButton" /> + <public type="style" name="Widget.DeviceDefault.ActionButton.Overflow" /> + <public type="style" name="Widget.DeviceDefault.ActionButton.TextButton" /> + <public type="style" name="Widget.DeviceDefault.ActionMode" /> + <public type="style" name="Widget.DeviceDefault.ActionButton.CloseMode" /> + <public type="style" name="Widget.DeviceDefault.ActionBar" /> + <public type="style" name="Widget.DeviceDefault.Button.Borderless" /> + <public type="style" name="Widget.DeviceDefault.Tab" /> + <public type="style" name="Widget.DeviceDefault.CalendarView" /> + <public type="style" name="Widget.DeviceDefault.DatePicker" /> + <public type="style" name="Widget.DeviceDefault.ActionBar.TabView" /> + <public type="style" name="Widget.DeviceDefault.ActionBar.TabText" /> + <public type="style" name="Widget.DeviceDefault.ActionBar.TabBar" /> + <public type="style" name="Widget.DeviceDefault.ActionBar.Solid" /> + <public type="style" name="Widget.DeviceDefault.Light" /> + <public type="style" name="Widget.DeviceDefault.Light.Button" /> + <public type="style" name="Widget.DeviceDefault.Light.Button.Small" /> + <public type="style" name="Widget.DeviceDefault.Light.Button.Inset" /> + <public type="style" name="Widget.DeviceDefault.Light.Button.Toggle" /> + <public type="style" name="Widget.DeviceDefault.Light.Button.Borderless.Small" /> + <public type="style" name="Widget.DeviceDefault.Light.TextView" /> + <public type="style" name="Widget.DeviceDefault.Light.AutoCompleteTextView" /> + <public type="style" name="Widget.DeviceDefault.Light.CompoundButton.CheckBox" /> + <public type="style" name="Widget.DeviceDefault.Light.ListView.DropDown" /> + <public type="style" name="Widget.DeviceDefault.Light.EditText" /> + <public type="style" name="Widget.DeviceDefault.Light.ExpandableListView" /> + <public type="style" name="Widget.DeviceDefault.Light.GridView" /> + <public type="style" name="Widget.DeviceDefault.Light.ImageButton" /> + <public type="style" name="Widget.DeviceDefault.Light.ListView" /> + <public type="style" name="Widget.DeviceDefault.Light.PopupWindow" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Horizontal" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Small" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Small.Title" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Large" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Small.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ProgressBar.Large.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.SeekBar" /> + <public type="style" name="Widget.DeviceDefault.Light.RatingBar" /> + <public type="style" name="Widget.DeviceDefault.Light.RatingBar.Indicator" /> + <public type="style" name="Widget.DeviceDefault.Light.RatingBar.Small" /> + <public type="style" name="Widget.DeviceDefault.Light.CompoundButton.RadioButton" /> + <public type="style" name="Widget.DeviceDefault.Light.ScrollView" /> + <public type="style" name="Widget.DeviceDefault.Light.HorizontalScrollView" /> + <public type="style" name="Widget.DeviceDefault.Light.Spinner" /> + <public type="style" name="Widget.DeviceDefault.Light.CompoundButton.Star" /> + <public type="style" name="Widget.DeviceDefault.Light.TabWidget" /> + <public type="style" name="Widget.DeviceDefault.Light.WebTextView" /> + <public type="style" name="Widget.DeviceDefault.Light.WebView" /> + <public type="style" name="Widget.DeviceDefault.Light.DropDownItem" /> + <public type="style" name="Widget.DeviceDefault.Light.DropDownItem.Spinner" /> + <public type="style" name="Widget.DeviceDefault.Light.TextView.SpinnerItem" /> + <public type="style" name="Widget.DeviceDefault.Light.ListPopupWindow" /> + <public type="style" name="Widget.DeviceDefault.Light.PopupMenu" /> + <public type="style" name="Widget.DeviceDefault.Light.Tab" /> + <public type="style" name="Widget.DeviceDefault.Light.CalendarView" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionButton" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionButton.Overflow" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionMode" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionButton.CloseMode" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabView" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabText" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabBar" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.Solid" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.Solid.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabBar.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabView.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionBar.TabText.Inverse" /> + <public type="style" name="Widget.DeviceDefault.Light.ActionMode.Inverse" /> + + <public type="style" name="TextAppearance.DeviceDefault" /> + <public type="style" name="TextAppearance.DeviceDefault.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Large" /> + <public type="style" name="TextAppearance.DeviceDefault.Large.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Medium" /> + <public type="style" name="TextAppearance.DeviceDefault.Medium.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Small" /> + <public type="style" name="TextAppearance.DeviceDefault.Small.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.SearchResult.Title" /> + <public type="style" name="TextAppearance.DeviceDefault.SearchResult.Subtitle" /> + <public type="style" name="TextAppearance.DeviceDefault.WindowTitle" /> + <public type="style" name="TextAppearance.DeviceDefault.DialogWindowTitle" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.Button" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.IconMenu.Item" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.TabWidget" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.TextView" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.TextView.PopupMenu" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.DropDownHint" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.DropDownItem" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.TextView.SpinnerItem" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.EditText" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.PopupMenu" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.PopupMenu.Large" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.PopupMenu.Small" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionBar.Title" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionMode.Title" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionBar.Title.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionMode.Title.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle.Inverse" /> + <public type="style" name="TextAppearance.DeviceDefault.Widget.ActionBar.Menu" /> + + <public type="style" name="DeviceDefault.ButtonBar" /> + <public type="style" name="DeviceDefault.ButtonBar.AlertDialog" /> + <public type="style" name="DeviceDefault.SegmentedButton" /> + <public type="style" name="DeviceDefault.Light.ButtonBar" /> + <public type="style" name="DeviceDefault.Light.ButtonBar.AlertDialog" /> + <public type="style" name="DeviceDefault.Light.SegmentedButton" /> + <public type="integer" name="status_bar_notification_info_maxnum" /> <public type="string" name="status_bar_notification_info_overflow" /> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index ed2d3b0..21f1cef 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -14,6 +14,20 @@ limitations under the License. --> +<!-- +=============================================================== + PLEASE READ +=============================================================== + +The Holo themes must not be modified in order to pass CTS. +Many related themes and styles depend on other values defined in this file. +If you would like to provide custom themes and styles for your device, +please see styles_device_defaults.xml. + +=============================================================== + PLEASE READ +=============================================================== + --> <resources> <!-- Global Theme Styles --> <eat-comment /> diff --git a/core/res/res/values/styles_device_defaults.xml b/core/res/res/values/styles_device_defaults.xml new file mode 100644 index 0000000..7f1891e --- /dev/null +++ b/core/res/res/values/styles_device_defaults.xml @@ -0,0 +1,741 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2011 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. +--> + +<!-- +=============================================================== + PLEASE READ +=============================================================== +This file contains the themes that are the Device Defaults. +If you want to edit styles to skin your device, do it here. +We recommend that you do not edit styles.xml and instead edit +this file. + +Editing this file instead of styles.xml will greatly simplify +merges for future platform versions and CTS compliance will be +easier. +=============================================================== + PLEASE READ +=============================================================== + --> +<resources> + <!-- Widget Styles --> + <style name="Widget.DeviceDefault" parent="Widget.Holo" > + + </style> + <style name="Widget.DeviceDefault.Button" parent="Widget.Holo.Button" > + + </style> + <style name="Widget.DeviceDefault.Button.Small" parent="Widget.Holo.Button.Small" > + + </style> + <style name="Widget.DeviceDefault.Button.Inset" parent="Widget.Holo.Button.Inset" > + + </style> + <style name="Widget.DeviceDefault.Button.Toggle" parent="Widget.Holo.Button.Toggle" > + + </style> + <style name="Widget.DeviceDefault.TextView" parent="Widget.Holo.TextView" > + + </style> + <style name="Widget.DeviceDefault.AutoCompleteTextView" parent="Widget.Holo.AutoCompleteTextView" > + + </style> + <style name="Widget.DeviceDefault.CompoundButton.CheckBox" parent="Widget.Holo.CompoundButton.CheckBox" > + + </style> + <style name="Widget.DeviceDefault.ListView.DropDown" parent="Widget.Holo.ListView.DropDown" > + + </style> + <style name="Widget.DeviceDefault.EditText" parent="Widget.Holo.EditText" > + + </style> + <style name="Widget.DeviceDefault.ExpandableListView" parent="Widget.Holo.ExpandableListView" > + + </style> + <style name="Widget.DeviceDefault.GridView" parent="Widget.Holo.GridView" > + + </style> + <style name="Widget.DeviceDefault.ImageButton" parent="Widget.Holo.ImageButton" > + + </style> + <style name="Widget.DeviceDefault.ListView" parent="Widget.Holo.ListView" > + + </style> + <style name="Widget.DeviceDefault.PopupWindow" parent="Widget.Holo.PopupWindow" > + + </style> + <style name="Widget.DeviceDefault.ProgressBar" parent="Widget.Holo.ProgressBar" > + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Horizontal" parent="Widget.Holo.ProgressBar.Horizontal" > + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Small" parent="Widget.Holo.ProgressBar.Small" > + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Small.Title" parent="Widget.Holo.ProgressBar.Small.Title" > + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Large" parent="Widget.Holo.ProgressBar.Large" > + + </style> + <style name="Widget.DeviceDefault.SeekBar" parent="Widget.Holo.SeekBar" > + + </style> + <style name="Widget.DeviceDefault.RatingBar" parent="Widget.Holo.RatingBar" > + + </style> + <style name="Widget.DeviceDefault.RatingBar.Indicator" parent="Widget.Holo.RatingBar.Indicator" > + + </style> + <style name="Widget.DeviceDefault.RatingBar.Small" parent="Widget.Holo.RatingBar.Small" > + + </style> + <style name="Widget.DeviceDefault.CompoundButton.RadioButton" parent="Widget.Holo.CompoundButton.RadioButton" > + + </style> + <style name="Widget.DeviceDefault.ScrollView" parent="Widget.Holo.ScrollView" > + + </style> + <style name="Widget.DeviceDefault.HorizontalScrollView" parent="Widget.Holo.HorizontalScrollView" > + + </style> + <style name="Widget.DeviceDefault.Spinner" parent="Widget.Holo.Spinner" > + + </style> + <style name="Widget.DeviceDefault.CompoundButton.Star" parent="Widget.Holo.CompoundButton.Star" > + + </style> + <style name="Widget.DeviceDefault.TabWidget" parent="Widget.Holo.TabWidget" > + + </style> + <style name="Widget.DeviceDefault.WebTextView" parent="Widget.Holo.WebTextView" > + + </style> + <style name="Widget.DeviceDefault.WebView" parent="Widget.Holo.WebView" > + + </style> + <style name="Widget.DeviceDefault.DropDownItem" parent="Widget.Holo.DropDownItem" > + + </style> + <style name="Widget.DeviceDefault.DropDownItem.Spinner" parent="Widget.Holo.DropDownItem.Spinner" > + + </style> + <style name="Widget.DeviceDefault.TextView.SpinnerItem" parent="Widget.Holo.TextView.SpinnerItem" > + + </style> + <style name="Widget.DeviceDefault.ListPopupWindow" parent="Widget.Holo.ListPopupWindow" > + + </style> + <style name="Widget.DeviceDefault.PopupMenu" parent="Widget.Holo.PopupMenu" > + + </style> + <style name="Widget.DeviceDefault.ActionButton" parent="Widget.Holo.ActionButton" > + + </style> + <style name="Widget.DeviceDefault.ActionButton.Overflow" parent="Widget.Holo.ActionButton.Overflow" > + + </style> + <style name="Widget.DeviceDefault.ActionButton.TextButton" parent="Widget.Holo.ActionButton.TextButton" > + + </style> + <style name="Widget.DeviceDefault.ActionMode" parent="Widget.Holo.ActionMode" > + + </style> + <style name="Widget.DeviceDefault.ActionButton.CloseMode" parent="Widget.Holo.ActionButton.CloseMode" > + + </style> + <style name="Widget.DeviceDefault.ActionBar" parent="Widget.Holo.ActionBar" > + + </style> + <style name="Widget.DeviceDefault.Button.Borderless" parent="Widget.Holo.Button.Borderless" > + + </style> + <style name="Widget.DeviceDefault.Tab" parent="Widget.Holo.Tab" > + + </style> + <style name="Widget.DeviceDefault.CalendarView" parent="Widget.Holo.CalendarView" > + + </style> + <style name="Widget.DeviceDefault.DatePicker" parent="Widget.Holo.DatePicker" > + + </style> + <style name="Widget.DeviceDefault.ActionBar.TabView" parent="Widget.Holo.ActionBar.TabView" > + + </style> + <style name="Widget.DeviceDefault.ActionBar.TabText" parent="Widget.Holo.ActionBar.TabText" > + + </style> + <style name="Widget.DeviceDefault.ActionBar.TabBar" parent="Widget.Holo.ActionBar.TabBar" > + + </style> + <style name="Widget.DeviceDefault.ActionBar.Solid" parent="Widget.Holo.ActionBar.Solid" > + + </style> + <style name="Widget.DeviceDefault.Button.Borderless.Small" parent="Widget.Holo.Button.Borderless.Small" > + + </style> + <style name="Widget.DeviceDefault.AbsListView" parent="Widget.Holo.AbsListView" > + + </style> + <style name="Widget.DeviceDefault.Spinner.DropDown.ActionBar" parent="Widget.Holo.Spinner.DropDown.ActionBar" > + + </style> + <style name="Widget.DeviceDefault.PopupWindow.ActionMode" parent="Widget.Holo.PopupWindow.ActionMode" > + + </style> + <style name="Widget.DeviceDefault.CompoundButton.Switch" parent="Widget.Holo.CompoundButton.Switch"> + + </style> + <style name="Widget.DeviceDefault.EditText.NumberPickerInputText" parent="Widget.Holo.EditText.NumberPickerInputText"> + + </style> + <style name="Widget.DeviceDefault.ExpandableListView.White" parent="Widget.Holo.ExpandableListView.White"> + + </style> + <style name="Widget.DeviceDefault.Gallery" parent="Widget.Holo.Gallery"> + + </style> + <style name="Widget.DeviceDefault.GestureOverlayView" parent="Widget.Holo.GestureOverlayView"> + + </style> + <style name="Widget.DeviceDefault.ImageButton.NumberPickerDownButton" parent="Widget.Holo.ImageButton.NumberPickerDownButton"> + + </style> + <style name="Widget.DeviceDefault.ImageButton.NumberPickerUpButton" parent="Widget.Holo.ImageButton.NumberPickerUpButton"> + + </style> + <style name="Widget.DeviceDefault.ImageWell" parent="Widget.Holo.ImageWell"> + + </style> + <style name="Widget.DeviceDefault.KeyboardView" parent="Widget.Holo.KeyboardView"> + + </style> + <style name="Widget.DeviceDefault.ListView.White" parent="Widget.Holo.ListView.White"> + + </style> + <style name="Widget.DeviceDefault.NumberPicker" parent="Widget.Holo.NumberPicker"> + + </style> + <style name="Widget.DeviceDefault.PreferenceFrameLayout" parent="Widget.Holo.PreferenceFrameLayout"> + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Inverse" parent="Widget.Holo.ProgressBar.Inverse"> + + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Large.Inverse" parent="Widget.Holo.ProgressBar.Large.Inverse"> + + </style> + <style name="Widget.DeviceDefault.ProgressBar.Small.Inverse" parent="Widget.Holo.ProgressBar.Small.Inverse"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadge.WindowLarge" parent="Widget.Holo.QuickContactBadge.WindowLarge"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadge.WindowMedium" parent="Widget.Holo.QuickContactBadge.WindowMedium"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadge.WindowSmall" parent="Widget.Holo.QuickContactBadge.WindowSmall"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadgeSmall.WindowLarge" parent="Widget.Holo.QuickContactBadgeSmall.WindowLarge"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadgeSmall.WindowMedium" parent="Widget.Holo.QuickContactBadgeSmall.WindowMedium"> + + </style> + <style name="Widget.DeviceDefault.QuickContactBadgeSmall.WindowSmall" parent="Widget.Holo.QuickContactBadgeSmall.WindowSmall"> + + </style> + <style name="Widget.DeviceDefault.Spinner.DropDown" parent="Widget.Holo.Spinner.DropDown"> + + </style> + <style name="Widget.DeviceDefault.StackView" parent="Widget.Holo.StackView"> + + </style> + <style name="Widget.DeviceDefault.TextSelectHandle" parent="Widget.Holo.TextSelectHandle"> + + </style> + <style name="Widget.DeviceDefault.TextSuggestionsPopupWindow" parent="Widget.Holo.TextSuggestionsPopupWindow"> + + </style> + <style name="Widget.DeviceDefault.TextView.ListSeparator" parent="Widget.Holo.TextView.ListSeparator"> + + </style> + <style name="Widget.DeviceDefault.TimePicker" parent="Widget.Holo.TimePicker"> + + </style> + <style name="Widget.DeviceDefault.Light" parent="Widget.Holo.Light" > + + </style> + <style name="Widget.DeviceDefault.Light.Button" parent="Widget.Holo.Light.Button" > + + </style> + <style name="Widget.DeviceDefault.Light.Button.Small" parent="Widget.Holo.Light.Button.Small" > + + </style> + <style name="Widget.DeviceDefault.Light.Button.Inset" parent="Widget.Holo.Light.Button.Inset" > + + </style> + <style name="Widget.DeviceDefault.Light.Button.Toggle" parent="Widget.Holo.Light.Button.Toggle" > + + </style> + <style name="Widget.DeviceDefault.Light.TextView" parent="Widget.Holo.Light.TextView" > + + </style> + <style name="Widget.DeviceDefault.Light.AutoCompleteTextView" parent="Widget.Holo.Light.AutoCompleteTextView" > + + </style> + <style name="Widget.DeviceDefault.Light.CompoundButton.CheckBox" parent="Widget.Holo.Light.CompoundButton.CheckBox" > + + </style> + <style name="Widget.DeviceDefault.Light.ListView.DropDown" parent="Widget.Holo.Light.ListView.DropDown" > + + </style> + <style name="Widget.DeviceDefault.Light.EditText" parent="Widget.Holo.Light.EditText" > + + </style> + <style name="Widget.DeviceDefault.Light.ExpandableListView" parent="Widget.Holo.Light.ExpandableListView" > + + </style> + <style name="Widget.DeviceDefault.Light.GridView" parent="Widget.Holo.Light.GridView" > + + </style> + <style name="Widget.DeviceDefault.Light.ImageButton" parent="Widget.Holo.Light.ImageButton" > + + </style> + <style name="Widget.DeviceDefault.Light.ListView" parent="Widget.Holo.Light.ListView" > + + </style> + <style name="Widget.DeviceDefault.Light.PopupWindow" parent="Widget.Holo.Light.PopupWindow" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar" parent="Widget.Holo.Light.ProgressBar" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Horizontal" parent="Widget.Holo.Light.ProgressBar.Horizontal" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Small" parent="Widget.Holo.Light.ProgressBar.Small" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Small.Title" parent="Widget.Holo.Light.ProgressBar.Small.Title" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Large" parent="Widget.Holo.Light.ProgressBar.Large" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Inverse" parent="Widget.Holo.Light.ProgressBar.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Small.Inverse" parent="Widget.Holo.Light.ProgressBar.Small.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ProgressBar.Large.Inverse" parent="Widget.Holo.Light.ProgressBar.Large.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.SeekBar" parent="Widget.Holo.Light.SeekBar" > + + </style> + <style name="Widget.DeviceDefault.Light.RatingBar" parent="Widget.Holo.Light.RatingBar" > + + </style> + <style name="Widget.DeviceDefault.Light.RatingBar.Indicator" parent="Widget.Holo.Light.RatingBar.Indicator" > + + </style> + <style name="Widget.DeviceDefault.Light.RatingBar.Small" parent="Widget.Holo.Light.RatingBar.Small" > + + </style> + <style name="Widget.DeviceDefault.Light.CompoundButton.RadioButton" parent="Widget.Holo.Light.CompoundButton.RadioButton" > + + </style> + <style name="Widget.DeviceDefault.Light.ScrollView" parent="Widget.Holo.Light.ScrollView" > + + </style> + <style name="Widget.DeviceDefault.Light.HorizontalScrollView" parent="Widget.Holo.Light.HorizontalScrollView" > + + </style> + <style name="Widget.DeviceDefault.Light.Spinner" parent="Widget.Holo.Light.Spinner" > + + </style> + <style name="Widget.DeviceDefault.Light.CompoundButton.Star" parent="Widget.Holo.Light.CompoundButton.Star" > + + </style> + <style name="Widget.DeviceDefault.Light.TabWidget" parent="Widget.Holo.Light.TabWidget" > + + </style> + <style name="Widget.DeviceDefault.Light.WebTextView" parent="Widget.Holo.Light.WebTextView" > + + </style> + <style name="Widget.DeviceDefault.Light.WebView" parent="Widget.Holo.Light.WebView" > + + </style> + <style name="Widget.DeviceDefault.Light.DropDownItem" parent="Widget.Holo.Light.DropDownItem" > + + </style> + <style name="Widget.DeviceDefault.Light.DropDownItem.Spinner" parent="Widget.Holo.Light.DropDownItem.Spinner" > + + </style> + <style name="Widget.DeviceDefault.Light.TextView.SpinnerItem" parent="Widget.Holo.Light.TextView.SpinnerItem" > + + </style> + <style name="Widget.DeviceDefault.Light.ListPopupWindow" parent="Widget.Holo.Light.ListPopupWindow" > + + </style> + <style name="Widget.DeviceDefault.Light.PopupMenu" parent="Widget.Holo.Light.PopupMenu" > + + </style> + <style name="Widget.DeviceDefault.Light.Tab" parent="Widget.Holo.Light.Tab" > + + </style> + <style name="Widget.DeviceDefault.Light.CalendarView" parent="Widget.Holo.Light.CalendarView" > + + </style> + <style name="Widget.DeviceDefault.Light.Button.Borderless.Small" parent="Widget.Holo.Light.Button.Borderless.Small" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionButton" parent="Widget.Holo.Light.ActionButton" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionButton.Overflow" parent="Widget.Holo.Light.ActionButton.Overflow" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionMode" parent="Widget.Holo.Light.ActionMode" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionButton.CloseMode" parent="Widget.Holo.Light.ActionButton.CloseMode" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar" parent="Widget.Holo.Light.ActionBar" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabView" parent="Widget.Holo.Light.ActionBar.TabView" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabText" parent="Widget.Holo.Light.ActionBar.TabText" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabBar" parent="Widget.Holo.Light.ActionBar.TabBar" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.Solid" parent="Widget.Holo.Light.ActionBar.Solid" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.Solid.Inverse" parent="Widget.Holo.Light.ActionBar.Solid.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabBar.Inverse" parent="Widget.Holo.Light.ActionBar.TabBar.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabView.Inverse" parent="Widget.Holo.Light.ActionBar.TabView.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionBar.TabText.Inverse" parent="Widget.Holo.Light.ActionBar.TabText.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.ActionMode.Inverse" parent="Widget.Holo.Light.ActionMode.Inverse" > + + </style> + <style name="Widget.DeviceDefault.Light.AbsListView" parent="Widget.Holo.Light.AbsListView" > + + </style> + <style name="Widget.DeviceDefault.Light.Spinner.DropDown.ActionBar" parent="Widget.Holo.Light.Spinner.DropDown.ActionBar" > + + </style> + <style name="Widget.DeviceDefault.Light.PopupWindow.ActionMode" parent="Widget.Holo.Light.PopupWindow.ActionMode" > + + </style> + <style name="Widget.DeviceDefault.Light.Button.Borderless" parent="Widget.Holo.Light.Button.Borderless"> + + </style> + <style name="Widget.DeviceDefault.Light.DatePicker" parent="Widget.Holo.Light.DatePicker"> + + </style> + <style name="Widget.DeviceDefault.Light.EditText.NumberPickerInputText" parent="Widget.Holo.Light.EditText.NumberPickerInputText"> + + </style> + <style name="Widget.DeviceDefault.Light.ExpandableListView.White" parent="Widget.Holo.Light.ExpandableListView.White"> + + </style> + <style name="Widget.DeviceDefault.Light.Gallery" parent="Widget.Holo.Light.Gallery"> + + </style> + <style name="Widget.DeviceDefault.Light.GestureOverlayView" parent="Widget.Holo.Light.GestureOverlayView"> + + </style> + <style name="Widget.DeviceDefault.Light.ImageButton.NumberPickerDownButton" parent="Widget.Holo.Light.ImageButton.NumberPickerDownButton"> + + </style> + <style name="Widget.DeviceDefault.Light.ImageButton.NumberPickerUpButton" parent="Widget.Holo.Light.ImageButton.NumberPickerUpButton"> + + </style> + <style name="Widget.DeviceDefault.Light.ImageWell" parent="Widget.Holo.Light.ImageWell"> + + </style> + <style name="Widget.DeviceDefault.Light.ListView.White" parent="Widget.Holo.Light.ListView.White"> + + </style> + <style name="Widget.DeviceDefault.Light.NumberPicker" parent="Widget.Holo.Light.NumberPicker"> + + </style> + <style name="Widget.DeviceDefault.Light.Spinner.DropDown" parent="Widget.Holo.Light.Spinner.DropDown"> + + </style> + <style name="Widget.DeviceDefault.Light.TextView.ListSeparator" parent="Widget.Holo.Light.TextView.ListSeparator"> + + </style> + <style name="Widget.DeviceDefault.Light.TimePicker" parent="Widget.Holo.Light.TimePicker"> + + </style> + <style name="Widget.DeviceDefault.Light.TextSuggestionsPopupWindow" parent="Widget.Holo.Light.TextSuggestionsPopupWindow"> + + </style> + + + <!-- Text Appearance Styles --> + <style name="TextAppearance.DeviceDefault" parent="TextAppearance.Holo" > + + </style> + <style name="TextAppearance.DeviceDefault.Inverse" parent="TextAppearance.Holo.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Large" parent="TextAppearance.Holo.Large" > + + </style> + <style name="TextAppearance.DeviceDefault.Large.Inverse" parent="TextAppearance.Holo.Large.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Medium" parent="TextAppearance.Holo.Medium" > + + </style> + <style name="TextAppearance.DeviceDefault.Medium.Inverse" parent="TextAppearance.Holo.Medium.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Small" parent="TextAppearance.Holo.Small" > + + </style> + <style name="TextAppearance.DeviceDefault.Small.Inverse" parent="TextAppearance.Holo.Small.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.SearchResult.Title" parent="TextAppearance.Holo.SearchResult.Title" > + + </style> + <style name="TextAppearance.DeviceDefault.SearchResult.Subtitle" parent="TextAppearance.Holo.SearchResult.Subtitle" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget" parent="TextAppearance.Holo.Widget" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.Button" parent="TextAppearance.Holo.Widget.Button" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.IconMenu.Item" parent="TextAppearance.Holo.Widget.IconMenu.Item" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.TabWidget" parent="TextAppearance.Holo.Widget.TabWidget" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.TextView" parent="TextAppearance.Holo.Widget.TextView" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.TextView.PopupMenu" parent="TextAppearance.Holo.Widget.TextView.PopupMenu" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.DropDownHint" parent="TextAppearance.Holo.Widget.DropDownHint" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.DropDownItem" parent="TextAppearance.Holo.Widget.DropDownItem" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.TextView.SpinnerItem" parent="TextAppearance.Holo.Widget.TextView.SpinnerItem" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.EditText" parent="TextAppearance.Holo.Widget.EditText" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.PopupMenu" parent="TextAppearance.Holo.Widget.PopupMenu" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.PopupMenu.Large" parent="TextAppearance.Holo.Widget.PopupMenu.Large" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.PopupMenu.Small" parent="TextAppearance.Holo.Widget.PopupMenu.Small" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionBar.Title" parent="TextAppearance.Holo.Widget.ActionBar.Title" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle" parent="TextAppearance.Holo.Widget.ActionBar.Subtitle" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionMode.Title" parent="TextAppearance.Holo.Widget.ActionMode.Title" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle" parent="TextAppearance.Holo.Widget.ActionMode.Subtitle" > + + </style> + <style name="TextAppearance.DeviceDefault.WindowTitle" parent="TextAppearance.Holo.WindowTitle" > + + </style> + <style name="TextAppearance.DeviceDefault.DialogWindowTitle" parent="TextAppearance.Holo.DialogWindowTitle" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionBar.Title.Inverse" parent="TextAppearance.Holo.Widget.ActionBar.Title.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle.Inverse" parent="TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionMode.Title.Inverse" parent="TextAppearance.Holo.Widget.ActionMode.Title.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionMode.Subtitle.Inverse" parent="TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse" > + + </style> + <style name="TextAppearance.DeviceDefault.Widget.ActionBar.Menu" parent="TextAppearance.Holo.Widget.ActionBar.Menu" > + + </style> + <style name="TextAppearance.DeviceDefault.Light" parent="TextAppearance.Holo.Light"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Inverse" parent="TextAppearance.Holo.Light.Inverse"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Large" parent="TextAppearance.Holo.Light.Large"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Large.Inverse" parent="TextAppearance.Holo.Light.Large.Inverse"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Medium" parent="TextAppearance.Holo.Light.Medium"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Medium.Inverse" parent="TextAppearance.Holo.Light.Medium.Inverse"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.SearchResult.Subtitle" parent="TextAppearance.Holo.Light.SearchResult.Subtitle"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.SearchResult.Title" parent="TextAppearance.Holo.Light.SearchResult.Title"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Small" parent="TextAppearance.Holo.Light.Small"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Small.Inverse" parent="TextAppearance.Holo.Light.Small.Inverse"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Widget.Button" parent="TextAppearance.Holo.Light.Widget.Button"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Widget.PopupMenu.Large" parent="TextAppearance.Holo.Light.Widget.PopupMenu.Large"> + + </style> + <style name="TextAppearance.DeviceDefault.Light.Widget.PopupMenu.Small" parent="TextAppearance.Holo.Light.Widget.PopupMenu.Small"> + + </style> + + + <!-- Preference Styles --> + <style name="Preference.DeviceDefault" parent="Preference.Holo"> + + </style> + <style name="Preference.DeviceDefault.Category" parent="Preference.Holo.Category"> + + </style> + <style name="Preference.DeviceDefault.CheckBoxPreference" parent="Preference.Holo.CheckBoxPreference"> + + </style> + <style name="Preference.DeviceDefault.DialogPreference" parent="Preference.Holo.DialogPreference"> + + </style> + <style name="Preference.DeviceDefault.DialogPreference.EditTextPreference" parent="Preference.Holo.DialogPreference.EditTextPreference"> + + </style> + <style name="Preference.DeviceDefault.DialogPreference.YesNoPreference" parent="Preference.Holo.DialogPreference.YesNoPreference"> + + </style> + <style name="Preference.DeviceDefault.Information" parent="Preference.Holo.Information"> + + </style> + <style name="Preference.DeviceDefault.PreferenceScreen" parent="Preference.Holo.PreferenceScreen"> + + </style> + <style name="Preference.DeviceDefault.RingtonePreference" parent="Preference.Holo.RingtonePreference"> + + </style> + <style name="Preference.DeviceDefault.SwitchPreference" parent="Preference.Holo.SwitchPreference"> + + </style> + + + <!-- AlertDialog Styles --> + <style name="AlertDialog.DeviceDefault" parent="AlertDialog.Holo"> + + </style> + <style name="AlertDialog.DeviceDefault.Light" parent="AlertDialog.DeviceDefault.Light" > + + </style> + + + <!-- Animation Styles --> + <style name="Animation.DeviceDefault.Activity" parent="Animation.Holo.Activity"> + + </style> + <style name="Animation.DeviceDefault.Dialog" parent="Animation.Holo.Dialog"> + + </style> + + + <!-- DialogWindowTitle Styles --> + <style name="DialogWindowTitle.DeviceDefault" parent="DialogWindowTitle.Holo"> + + </style> + <style name="DialogWindowTitle.DeviceDefault.Light" parent="DialogWindowTitle.Holo.Light"> + + </style> + + + <!-- WindowTitle Styles --> + <style name="WindowTitle.DeviceDefault" parent="WindowTitle.Holo"> + + </style> + <style name="WindowTitleBackground.DeviceDefault" parent="WindowTitleBackground.Holo"> + + </style> + + + <!-- Other Styles --> + <style name="DeviceDefault.ButtonBar" parent="Holo.ButtonBar" > + + </style> + <style name="DeviceDefault.ButtonBar.AlertDialog" parent="Holo.ButtonBar.AlertDialog" > + + </style> + <style name="DeviceDefault.SegmentedButton" parent="Holo.SegmentedButton" > + + </style> + <style name="DeviceDefault.Light.ButtonBar" parent="Holo.Light.ButtonBar" > + + </style> + <style name="DeviceDefault.Light.ButtonBar.AlertDialog" parent="Holo.Light.ButtonBar.AlertDialog" > + + </style> + <style name="DeviceDefault.Light.SegmentedButton" parent="Holo.Light.SegmentedButton" > + + </style> +</resources> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 2b1b693..615a37d 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -14,6 +14,20 @@ limitations under the License. --> +<!-- +=============================================================== + PLEASE READ +=============================================================== + +The Holo themes must not be modified in order to pass CTS. +Many related themes and styles depend on other values defined in this file. +If you would like to provide custom themes and styles for your device, +please see themes_device_defaults.xml. + +=============================================================== + PLEASE READ +=============================================================== + --> <resources> <!-- The default system theme. This is the theme used for activities that have not explicitly set their own theme. diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml new file mode 100644 index 0000000..bf6329d --- /dev/null +++ b/core/res/res/values/themes_device_defaults.xml @@ -0,0 +1,423 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2011 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. +--> + +<!-- +=============================================================== + PLEASE READ +=============================================================== +This file contains the themes that are the Device Defaults. +If you want to edit themes to skin your device, do it here. +We recommend that you do not edit themes.xml and instead edit +this file. + +Editing this file instead of themes.xml will greatly simplify +merges for future platform versions and CTS compliance will be +easier. +=============================================================== + PLEASE READ +=============================================================== + --> +<resources> + <style name="Theme.DeviceDefault" parent="Theme.Holo" > + <!-- Text styles --> + <item name="textAppearance">@android:style/TextAppearance.DeviceDefault</item> + <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Inverse</item> + + <item name="textAppearanceLarge">@android:style/TextAppearance.DeviceDefault.Large</item> + <item name="textAppearanceMedium">@android:style/TextAppearance.DeviceDefault.Medium</item> + <item name="textAppearanceSmall">@android:style/TextAppearance.DeviceDefault.Small</item> + <item name="textAppearanceLargeInverse">@android:style/TextAppearance.DeviceDefault.Large.Inverse</item> + <item name="textAppearanceMediumInverse">@android:style/TextAppearance.DeviceDefault.Medium.Inverse</item> + <item name="textAppearanceSmallInverse">@android:style/TextAppearance.DeviceDefault.Small.Inverse</item> + <item name="textAppearanceSearchResultTitle">@android:style/TextAppearance.DeviceDefault.SearchResult.Title</item> + <item name="textAppearanceSearchResultSubtitle">@android:style/TextAppearance.DeviceDefault.SearchResult.Subtitle</item> + + <item name="textAppearanceButton">@android:style/TextAppearance.DeviceDefault.Widget.Button</item> + + <item name="textAppearanceLargePopupMenu">@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Large</item> + <item name="textAppearanceSmallPopupMenu">@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Small</item> + + <!-- Button styles --> + <item name="buttonStyle">@android:style/Widget.DeviceDefault.Button</item> + + <item name="buttonStyleSmall">@android:style/Widget.DeviceDefault.Button.Small</item> + <item name="buttonStyleInset">@android:style/Widget.DeviceDefault.Button.Inset</item> + + <item name="buttonStyleToggle">@android:style/Widget.DeviceDefault.Button.Toggle</item> + <item name="switchStyle">@android:style/Widget.DeviceDefault.CompoundButton.Switch</item> + + <item name="borderlessButtonStyle">@android:style/Widget.DeviceDefault.Button.Borderless</item> + + <item name="listSeparatorTextViewStyle">@android:style/Widget.DeviceDefault.TextView.ListSeparator</item> + + <!-- Window attributes --> + <item name="windowTitleStyle">@android:style/WindowTitle.DeviceDefault</item> + <item name="windowTitleBackgroundStyle">@android:style/WindowTitleBackground.DeviceDefault</item> + <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Activity</item> + + <!-- Dialog attributes --> + <item name="alertDialogStyle">@android:style/AlertDialog.DeviceDefault</item> + <item name="dialogTheme">@android:style/Theme.DeviceDefault.Dialog</item> + <item name="alertDialogTheme">@android:style/Theme.DeviceDefault.Dialog.Alert</item> + + <!-- Text selection handle attributes --> + <item name="textSelectHandleWindowStyle">@android:style/Widget.DeviceDefault.TextSelectHandle</item> + <item name="textSuggestionsWindowStyle">@android:style/Widget.DeviceDefault.TextSuggestionsPopupWindow</item> + + <!-- Widget styles --> + <item name="absListViewStyle">@android:style/Widget.DeviceDefault.AbsListView</item> + <item name="autoCompleteTextViewStyle">@android:style/Widget.DeviceDefault.AutoCompleteTextView</item> + <item name="checkboxStyle">@android:style/Widget.DeviceDefault.CompoundButton.CheckBox</item> + <item name="dropDownListViewStyle">@android:style/Widget.DeviceDefault.ListView.DropDown</item> + <item name="editTextStyle">@android:style/Widget.DeviceDefault.EditText</item> + <item name="expandableListViewStyle">@android:style/Widget.DeviceDefault.ExpandableListView</item> + <item name="expandableListViewWhiteStyle">@android:style/Widget.DeviceDefault.ExpandableListView.White</item> + <item name="galleryStyle">@android:style/Widget.DeviceDefault.Gallery</item> + <item name="gestureOverlayViewStyle">@android:style/Widget.DeviceDefault.GestureOverlayView</item> + <item name="gridViewStyle">@android:style/Widget.DeviceDefault.GridView</item> + <item name="imageButtonStyle">@android:style/Widget.DeviceDefault.ImageButton</item> + <item name="imageWellStyle">@android:style/Widget.DeviceDefault.ImageWell</item> + <item name="listViewStyle">@android:style/Widget.DeviceDefault.ListView</item> + <item name="listViewWhiteStyle">@android:style/Widget.DeviceDefault.ListView.White</item> + <item name="popupWindowStyle">@android:style/Widget.DeviceDefault.PopupWindow</item> + <item name="progressBarStyle">@android:style/Widget.DeviceDefault.ProgressBar</item> + <item name="progressBarStyleHorizontal">@android:style/Widget.DeviceDefault.ProgressBar.Horizontal</item> + <item name="progressBarStyleSmall">@android:style/Widget.DeviceDefault.ProgressBar.Small</item> + <item name="progressBarStyleSmallTitle">@android:style/Widget.DeviceDefault.ProgressBar.Small.Title</item> + <item name="progressBarStyleLarge">@android:style/Widget.DeviceDefault.ProgressBar.Large</item> + <item name="progressBarStyleInverse">@android:style/Widget.DeviceDefault.ProgressBar.Inverse</item> + <item name="progressBarStyleSmallInverse">@android:style/Widget.DeviceDefault.ProgressBar.Small.Inverse</item> + <item name="progressBarStyleLargeInverse">@android:style/Widget.DeviceDefault.ProgressBar.Large.Inverse</item> + <item name="seekBarStyle">@android:style/Widget.DeviceDefault.SeekBar</item> + <item name="ratingBarStyle">@android:style/Widget.DeviceDefault.RatingBar</item> + <item name="ratingBarStyleIndicator">@android:style/Widget.DeviceDefault.RatingBar.Indicator</item> + <item name="ratingBarStyleSmall">@android:style/Widget.DeviceDefault.RatingBar.Small</item> + <item name="radioButtonStyle">@android:style/Widget.DeviceDefault.CompoundButton.RadioButton</item> + <item name="scrollViewStyle">@android:style/Widget.DeviceDefault.ScrollView</item> + <item name="horizontalScrollViewStyle">@android:style/Widget.DeviceDefault.HorizontalScrollView</item> + <item name="dropDownSpinnerStyle">@android:style/Widget.DeviceDefault.Spinner.DropDown</item> + <item name="starStyle">@android:style/Widget.DeviceDefault.CompoundButton.Star</item> + <item name="tabWidgetStyle">@android:style/Widget.DeviceDefault.TabWidget</item> + <item name="textViewStyle">@android:style/Widget.DeviceDefault.TextView</item> + <item name="webTextViewStyle">@android:style/Widget.DeviceDefault.WebTextView</item> + <item name="webViewStyle">@android:style/Widget.DeviceDefault.WebView</item> + <item name="dropDownItemStyle">@android:style/Widget.DeviceDefault.DropDownItem</item> + <item name="spinnerDropDownItemStyle">@android:style/Widget.DeviceDefault.DropDownItem.Spinner</item> + <item name="spinnerItemStyle">@android:style/Widget.DeviceDefault.TextView.SpinnerItem</item> + <item name="dropDownHintAppearance">@android:style/TextAppearance.DeviceDefault.Widget.DropDownHint</item> + <item name="keyboardViewStyle">@android:style/Widget.DeviceDefault.KeyboardView</item> + <item name="quickContactBadgeStyleWindowSmall">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowSmall</item> + <item name="quickContactBadgeStyleWindowMedium">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowMedium</item> + <item name="quickContactBadgeStyleWindowLarge">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowLarge</item> + <item name="quickContactBadgeStyleSmallWindowSmall">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowSmall</item> + <item name="quickContactBadgeStyleSmallWindowMedium">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowMedium</item> + <item name="quickContactBadgeStyleSmallWindowLarge">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowLarge</item> + <item name="listPopupWindowStyle">@android:style/Widget.DeviceDefault.ListPopupWindow</item> + <item name="popupMenuStyle">@android:style/Widget.DeviceDefault.PopupMenu</item> + <item name="stackViewStyle">@android:style/Widget.DeviceDefault.StackView</item> + + <!-- Preference styles --> + <item name="preferenceScreenStyle">@android:style/Preference.DeviceDefault.PreferenceScreen</item> + <item name="preferenceCategoryStyle">@android:style/Preference.DeviceDefault.Category</item> + <item name="preferenceStyle">@android:style/Preference.DeviceDefault</item> + <item name="preferenceInformationStyle">@android:style/Preference.DeviceDefault.Information</item> + <item name="checkBoxPreferenceStyle">@android:style/Preference.DeviceDefault.CheckBoxPreference</item> + <item name="switchPreferenceStyle">@android:style/Preference.DeviceDefault.SwitchPreference</item> + <item name="yesNoPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference.YesNoPreference</item> + <item name="dialogPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference</item> + <item name="editTextPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference.EditTextPreference</item> + <item name="ringtonePreferenceStyle">@android:style/Preference.DeviceDefault.RingtonePreference</item> + + <!-- Action bar styles --> + <item name="actionDropDownStyle">@android:style/Widget.DeviceDefault.Spinner.DropDown.ActionBar</item> + <item name="actionButtonStyle">@android:style/Widget.DeviceDefault.ActionButton</item> + <item name="actionOverflowButtonStyle">@android:style/Widget.DeviceDefault.ActionButton.Overflow</item> + <item name="actionBarTabStyle">@style/Widget.DeviceDefault.ActionBar.TabView</item> + <item name="actionBarTabBarStyle">@style/Widget.DeviceDefault.ActionBar.TabBar</item> + <item name="actionBarTabTextStyle">@style/Widget.DeviceDefault.ActionBar.TabText</item> + <item name="actionModeStyle">@style/Widget.DeviceDefault.ActionMode</item> + <item name="actionModeCloseButtonStyle">@style/Widget.DeviceDefault.ActionButton.CloseMode</item> + <item name="actionBarStyle">@android:style/Widget.DeviceDefault.ActionBar</item> + <item name="actionModePopupWindowStyle">@android:style/Widget.DeviceDefault.PopupWindow.ActionMode</item> + + <item name="buttonBarStyle">@android:style/DeviceDefault.ButtonBar</item> + <item name="segmentedButtonStyle">@android:style/DeviceDefault.SegmentedButton</item> + + <item name="searchDialogTheme">@style/Theme.DeviceDefault.SearchBar</item> + + <!-- PreferenceFrameLayout attributes --> + <item name="preferenceFrameLayoutStyle">@android:style/Widget.DeviceDefault.PreferenceFrameLayout</item> + + <!-- NumberPicker styles--> + <item name="numberPickerUpButtonStyle">@style/Widget.DeviceDefault.ImageButton.NumberPickerUpButton</item> + <item name="numberPickerDownButtonStyle">@style/Widget.DeviceDefault.ImageButton.NumberPickerDownButton</item> + <item name="numberPickerInputTextStyle">@style/Widget.DeviceDefault.EditText.NumberPickerInputText</item> + <item name="numberPickerStyle">@style/Widget.DeviceDefault.NumberPicker</item> + + <!-- CalendarView style--> + <item name="calendarViewStyle">@style/Widget.DeviceDefault.CalendarView</item> + + <!-- TimePicker style --> + <item name="timePickerStyle">@style/Widget.DeviceDefault.TimePicker</item> + + <!-- DatePicker style --> + <item name="datePickerStyle">@style/Widget.DeviceDefault.DatePicker</item> + </style> + <style name="Theme.DeviceDefault.NoActionBar" parent="Theme.Holo.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.NoActionBar.Fullscreen" parent="Theme.Holo.NoActionBar.Fullscreen" > + + </style> + <style name="Theme.DeviceDefault.Light" parent="Theme.Holo.Light" > + <!-- Text styles --> + <item name="textAppearance">@android:style/TextAppearance.DeviceDefault.Light</item> + <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Light.Inverse</item> + + <item name="textAppearanceLarge">@android:style/TextAppearance.DeviceDefault.Light.Large</item> + <item name="textAppearanceMedium">@android:style/TextAppearance.DeviceDefault.Light.Medium</item> + <item name="textAppearanceSmall">@android:style/TextAppearance.DeviceDefault.Light.Small</item> + <item name="textAppearanceLargeInverse">@android:style/TextAppearance.DeviceDefault.Light.Large.Inverse</item> + <item name="textAppearanceMediumInverse">@android:style/TextAppearance.DeviceDefault.Light.Medium.Inverse</item> + <item name="textAppearanceSmallInverse">@android:style/TextAppearance.DeviceDefault.Light.Small.Inverse</item> + <item name="textAppearanceSearchResultTitle">@android:style/TextAppearance.DeviceDefault.Light.SearchResult.Title</item> + <item name="textAppearanceSearchResultSubtitle">@android:style/TextAppearance.DeviceDefault.Light.SearchResult.Subtitle</item> + + <item name="textAppearanceButton">@android:style/TextAppearance.DeviceDefault.Light.Widget.Button</item> + + <item name="textAppearanceLargePopupMenu">@android:style/TextAppearance.DeviceDefault.Light.Widget.PopupMenu.Large</item> + <item name="textAppearanceSmallPopupMenu">@android:style/TextAppearance.DeviceDefault.Light.Widget.PopupMenu.Small</item> + + <!-- Button styles --> + <item name="buttonStyle">@android:style/Widget.DeviceDefault.Light.Button</item> + + <item name="buttonStyleSmall">@android:style/Widget.DeviceDefault.Light.Button.Small</item> + <item name="buttonStyleInset">@android:style/Widget.DeviceDefault.Light.Button.Inset</item> + + <item name="buttonStyleToggle">@android:style/Widget.DeviceDefault.Light.Button.Toggle</item> + + <item name="borderlessButtonStyle">@android:style/Widget.DeviceDefault.Light.Button.Borderless</item> + + <item name="listSeparatorTextViewStyle">@android:style/Widget.DeviceDefault.Light.TextView.ListSeparator</item> + + <item name="windowTitleStyle">@android:style/WindowTitle.DeviceDefault</item> + <item name="windowTitleBackgroundStyle">@android:style/WindowTitleBackground.DeviceDefault</item> + <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Activity</item> + + <!-- Dialog attributes --> + <item name="alertDialogStyle">@android:style/AlertDialog.DeviceDefault.Light</item> + <item name="dialogTheme">@android:style/Theme.DeviceDefault.Light.Dialog</item> + <item name="alertDialogTheme">@android:style/Theme.DeviceDefault.Light.Dialog.Alert</item> + + <!-- Text selection handle attributes --> + <item name="textSelectHandleWindowStyle">@android:style/Widget.DeviceDefault.TextSelectHandle</item> + <item name="textSuggestionsWindowStyle">@android:style/Widget.DeviceDefault.Light.TextSuggestionsPopupWindow</item> + + <!-- Widget styles --> + <item name="absListViewStyle">@android:style/Widget.DeviceDefault.Light.AbsListView</item> + <item name="autoCompleteTextViewStyle">@android:style/Widget.DeviceDefault.Light.AutoCompleteTextView</item> + <item name="checkboxStyle">@android:style/Widget.DeviceDefault.Light.CompoundButton.CheckBox</item> + <item name="dropDownListViewStyle">@android:style/Widget.DeviceDefault.ListView.DropDown</item> + <item name="editTextStyle">@android:style/Widget.DeviceDefault.Light.EditText</item> + <item name="expandableListViewStyle">@android:style/Widget.DeviceDefault.Light.ExpandableListView</item> + <item name="expandableListViewWhiteStyle">@android:style/Widget.DeviceDefault.Light.ExpandableListView.White</item> + <item name="galleryStyle">@android:style/Widget.DeviceDefault.Light.Gallery</item> + <item name="gestureOverlayViewStyle">@android:style/Widget.DeviceDefault.Light.GestureOverlayView</item> + <item name="gridViewStyle">@android:style/Widget.DeviceDefault.Light.GridView</item> + <item name="imageButtonStyle">@android:style/Widget.DeviceDefault.Light.ImageButton</item> + <item name="imageWellStyle">@android:style/Widget.DeviceDefault.Light.ImageWell</item> + <item name="listViewStyle">@android:style/Widget.DeviceDefault.Light.ListView</item> + <item name="listViewWhiteStyle">@android:style/Widget.DeviceDefault.Light.ListView.White</item> + <item name="popupWindowStyle">@android:style/Widget.DeviceDefault.Light.PopupWindow</item> + <item name="progressBarStyle">@android:style/Widget.DeviceDefault.Light.ProgressBar</item> + <item name="progressBarStyleHorizontal">@android:style/Widget.DeviceDefault.Light.ProgressBar.Horizontal</item> + <item name="progressBarStyleSmall">@android:style/Widget.DeviceDefault.Light.ProgressBar.Small</item> + <item name="progressBarStyleSmallTitle">@android:style/Widget.DeviceDefault.Light.ProgressBar.Small.Title</item> + <item name="progressBarStyleLarge">@android:style/Widget.DeviceDefault.Light.ProgressBar.Large</item> + <item name="progressBarStyleInverse">@android:style/Widget.DeviceDefault.Light.ProgressBar.Inverse</item> + <item name="progressBarStyleSmallInverse">@android:style/Widget.DeviceDefault.Light.ProgressBar.Small.Inverse</item> + <item name="progressBarStyleLargeInverse">@android:style/Widget.DeviceDefault.Light.ProgressBar.Large.Inverse</item> + <item name="seekBarStyle">@android:style/Widget.DeviceDefault.Light.SeekBar</item> + <item name="ratingBarStyle">@android:style/Widget.DeviceDefault.Light.RatingBar</item> + <item name="ratingBarStyleIndicator">@android:style/Widget.DeviceDefault.Light.RatingBar.Indicator</item> + <item name="ratingBarStyleSmall">@android:style/Widget.DeviceDefault.Light.RatingBar.Small</item> + <item name="radioButtonStyle">@android:style/Widget.DeviceDefault.Light.CompoundButton.RadioButton</item> + <item name="scrollViewStyle">@android:style/Widget.DeviceDefault.Light.ScrollView</item> + <item name="horizontalScrollViewStyle">@android:style/Widget.DeviceDefault.Light.HorizontalScrollView</item> + <item name="dropDownSpinnerStyle">@android:style/Widget.DeviceDefault.Light.Spinner.DropDown</item> + <item name="starStyle">@android:style/Widget.DeviceDefault.Light.CompoundButton.Star</item> + <item name="tabWidgetStyle">@android:style/Widget.DeviceDefault.Light.TabWidget</item> + <item name="textViewStyle">@android:style/Widget.DeviceDefault.Light.TextView</item> + <item name="webTextViewStyle">@android:style/Widget.DeviceDefault.Light.WebTextView</item> + <item name="webViewStyle">@android:style/Widget.DeviceDefault.Light.WebView</item> + <item name="dropDownItemStyle">@android:style/Widget.DeviceDefault.Light.DropDownItem</item> + <item name="spinnerDropDownItemStyle">@android:style/Widget.DeviceDefault.Light.DropDownItem.Spinner</item> + <item name="spinnerItemStyle">@android:style/Widget.DeviceDefault.TextView.SpinnerItem</item> + <item name="dropDownHintAppearance">@android:style/TextAppearance.DeviceDefault.Widget.DropDownHint</item> + <item name="keyboardViewStyle">@android:style/Widget.DeviceDefault.KeyboardView</item> + <item name="quickContactBadgeStyleWindowSmall">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowSmall</item> + <item name="quickContactBadgeStyleWindowMedium">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowMedium</item> + <item name="quickContactBadgeStyleWindowLarge">@android:style/Widget.DeviceDefault.QuickContactBadge.WindowLarge</item> + <item name="quickContactBadgeStyleSmallWindowSmall">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowSmall</item> + <item name="quickContactBadgeStyleSmallWindowMedium">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowMedium</item> + <item name="quickContactBadgeStyleSmallWindowLarge">@android:style/Widget.DeviceDefault.QuickContactBadgeSmall.WindowLarge</item> + <item name="listPopupWindowStyle">@android:style/Widget.DeviceDefault.Light.ListPopupWindow</item> + <item name="popupMenuStyle">@android:style/Widget.DeviceDefault.Light.PopupMenu</item> + <item name="stackViewStyle">@android:style/Widget.DeviceDefault.StackView</item> + + <!-- Preference styles --> + <item name="preferenceScreenStyle">@android:style/Preference.DeviceDefault.PreferenceScreen</item> + <item name="preferenceCategoryStyle">@android:style/Preference.DeviceDefault.Category</item> + <item name="preferenceStyle">@android:style/Preference.DeviceDefault</item> + <item name="preferenceInformationStyle">@android:style/Preference.DeviceDefault.Information</item> + <item name="checkBoxPreferenceStyle">@android:style/Preference.DeviceDefault.CheckBoxPreference</item> + <item name="switchPreferenceStyle">@android:style/Preference.DeviceDefault.SwitchPreference</item> + <item name="yesNoPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference.YesNoPreference</item> + <item name="dialogPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference</item> + <item name="editTextPreferenceStyle">@android:style/Preference.DeviceDefault.DialogPreference.EditTextPreference</item> + <item name="ringtonePreferenceStyle">@android:style/Preference.DeviceDefault.RingtonePreference</item> + + <!-- Action bar styles --> + <item name="actionDropDownStyle">@android:style/Widget.DeviceDefault.Light.Spinner.DropDown.ActionBar</item> + <item name="actionButtonStyle">@android:style/Widget.DeviceDefault.Light.ActionButton</item> + <item name="actionOverflowButtonStyle">@android:style/Widget.DeviceDefault.Light.ActionButton.Overflow</item> + <item name="actionBarTabStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabView</item> + <item name="actionBarTabBarStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabBar</item> + <item name="actionBarTabTextStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabText</item> + <item name="actionModeStyle">@style/Widget.DeviceDefault.Light.ActionMode</item> + <item name="actionModeCloseButtonStyle">@style/Widget.DeviceDefault.Light.ActionButton.CloseMode</item> + <item name="actionBarStyle">@android:style/Widget.DeviceDefault.Light.ActionBar</item> + <item name="actionModePopupWindowStyle">@android:style/Widget.DeviceDefault.Light.PopupWindow.ActionMode</item> + + <item name="buttonBarStyle">@android:style/DeviceDefault.Light.ButtonBar</item> + <item name="segmentedButtonStyle">@android:style/DeviceDefault.Light.SegmentedButton</item> + + <item name="searchDialogTheme">@style/Theme.DeviceDefault.Light.SearchBar</item> + + <!-- NumberPicker attributes and styles--> + <item name="numberPickerUpButtonStyle">@style/Widget.DeviceDefault.Light.ImageButton.NumberPickerUpButton</item> + <item name="numberPickerDownButtonStyle">@style/Widget.DeviceDefault.Light.ImageButton.NumberPickerDownButton</item> + <item name="numberPickerInputTextStyle">@style/Widget.DeviceDefault.Light.EditText.NumberPickerInputText</item> + <item name="numberPickerStyle">@style/Widget.DeviceDefault.Light.NumberPicker</item> + + <!-- CalendarView style--> + <item name="calendarViewStyle">@style/Widget.DeviceDefault.Light.CalendarView</item> + + <!-- TimePicker style --> + <item name="timePickerStyle">@style/Widget.DeviceDefault.Light.TimePicker</item> + + <!-- DatePicker style --> + <item name="datePickerStyle">@style/Widget.DeviceDefault.Light.DatePicker</item> + </style> + <style name="Theme.DeviceDefault.Light.NoActionBar" parent="Theme.Holo.Light.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.Light.NoActionBar.Fullscreen" parent="Theme.Holo.Light.NoActionBar.Fullscreen" > + + </style> + <style name="Theme.DeviceDefault.Dialog" parent="Theme.Holo.Dialog" > + <item name="android:windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault</item> + <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Dialog</item> + + <item name="android:buttonBarStyle">@android:style/DeviceDefault.ButtonBar.AlertDialog</item> + <item name="borderlessButtonStyle">@android:style/Widget.DeviceDefault.Button.Borderless.Small</item> + + <item name="textAppearance">@android:style/TextAppearance.DeviceDefault</item> + <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Inverse</item> + </style> + <style name="Theme.DeviceDefault.Dialog.MinWidth" parent="Theme.Holo.Dialog.MinWidth" > + + </style> + <style name="Theme.DeviceDefault.Dialog.NoActionBar" parent="Theme.Holo.Dialog.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.Dialog.NoActionBar.MinWidth" parent="Theme.Holo.Dialog.NoActionBar.MinWidth" > + + </style> + <style name="Theme.DeviceDefault.Light.Dialog" parent="Theme.Holo.Light.Dialog" > + <item name="android:windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault.Light</item> + <item name="android:windowAnimationStyle">@android:style/Animation.DeviceDefault.Dialog</item> + + <item name="android:buttonBarStyle">@android:style/DeviceDefault.Light.ButtonBar.AlertDialog</item> + <item name="borderlessButtonStyle">@android:style/Widget.DeviceDefault.Light.Button.Borderless.Small</item> + + <item name="textAppearance">@android:style/TextAppearance.DeviceDefault.Light</item> + <item name="textAppearanceInverse">@android:style/TextAppearance.DeviceDefault.Light.Inverse</item> + </style> + <style name="Theme.DeviceDefault.Light.Dialog.MinWidth" parent="Theme.Holo.Light.Dialog.MinWidth" > + + </style> + <style name="Theme.DeviceDefault.Light.Dialog.NoActionBar" parent="Theme.Holo.Light.Dialog.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.Light.Dialog.NoActionBar.MinWidth" parent="Theme.Holo.Light.Dialog.NoActionBar.MinWidth" > + + </style> + <style name="Theme.DeviceDefault.DialogWhenLarge" parent="Theme.Holo.DialogWhenLarge" > + + </style> + <style name="Theme.DeviceDefault.DialogWhenLarge.NoActionBar" parent="Theme.Holo.DialogWhenLarge.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.Light.DialogWhenLarge" parent="Theme.Holo.Light.DialogWhenLarge" > + + </style> + <style name="Theme.DeviceDefault.Light.DialogWhenLarge.NoActionBar" parent="Theme.Holo.Light.DialogWhenLarge.NoActionBar" > + + </style> + <style name="Theme.DeviceDefault.Panel" parent="Theme.Holo.Panel" > + + </style> + <style name="Theme.DeviceDefault.Light.Panel" parent="Theme.Holo.Light.Panel" > + + </style> + <style name="Theme.DeviceDefault.Wallpaper" parent="Theme.Holo.Wallpaper" > + + </style> + <style name="Theme.DeviceDefault.Wallpaper.NoTitleBar" parent="Theme.Holo.Wallpaper.NoTitleBar" > + + </style> + <style name="Theme.DeviceDefault.InputMethod" parent="Theme.Holo.InputMethod" > + + </style> + <style name="Theme.DeviceDefault.Light.DarkActionBar" parent="Theme.Holo.Light.DarkActionBar" > + <item name="android:actionBarStyle">@android:style/Widget.DeviceDefault.Light.ActionBar.Solid.Inverse</item> + + <item name="actionDropDownStyle">@android:style/Widget.DeviceDefault.Spinner.DropDown.ActionBar</item> + <item name="actionButtonStyle">@android:style/Widget.DeviceDefault.ActionButton</item> + <item name="actionOverflowButtonStyle">@android:style/Widget.DeviceDefault.ActionButton.Overflow</item> + <item name="actionBarTabStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabView.Inverse</item> + <item name="actionBarTabBarStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabBar.Inverse</item> + <item name="actionBarTabTextStyle">@style/Widget.DeviceDefault.Light.ActionBar.TabText.Inverse</item> + <item name="actionModeStyle">@style/Widget.DeviceDefault.Light.ActionMode.Inverse</item> + <item name="actionModeCloseButtonStyle">@style/Widget.DeviceDefault.ActionButton.CloseMode</item> + <item name="actionModePopupWindowStyle">@android:style/Widget.DeviceDefault.PopupWindow.ActionMode</item> + + </style> + + <style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Holo.Dialog.Alert"> + <item name="windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault</item> + </style> + <style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.DeviceDefault.Light.Dialog.Alert"> + <item name="windowTitleStyle">@android:style/DialogWindowTitle.DeviceDefault.Light</item> + </style> + <style name="Theme.DeviceDefault.SearchBar" parent="Theme.DeviceDefault.SearchBar"> + + </style> + <style name="Theme.DeviceDefault.Light.SearchBar" parent="Theme.DeviceDefault.Light.SearchBar"> + + </style> +</resources> diff --git a/core/res/res/xml-land/password_kbd_qwerty.xml b/core/res/res/xml-land/password_kbd_qwerty.xml index fd8bd49..988f9ff 100755 --- a/core/res/res/xml-land/password_kbd_qwerty.xml +++ b/core/res/res/xml-land/password_kbd_qwerty.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml-land/password_kbd_qwerty_shifted.xml b/core/res/res/xml-land/password_kbd_qwerty_shifted.xml index 9ff6fd7..4941946 100755 --- a/core/res/res/xml-land/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-land/password_kbd_qwerty_shifted.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml-mdpi/password_kbd_qwerty.xml b/core/res/res/xml-mdpi/password_kbd_qwerty.xml index 82a7c75..265d7dc 100755 --- a/core/res/res/xml-mdpi/password_kbd_qwerty.xml +++ b/core/res/res/xml-mdpi/password_kbd_qwerty.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml b/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml index 9fff3cc..7379f69 100755 --- a/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-mdpi/password_kbd_qwerty_shifted.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml-xlarge/password_kbd_numeric.xml b/core/res/res/xml-xlarge/password_kbd_numeric.xml index 0253122..3745672 100755 --- a/core/res/res/xml-xlarge/password_kbd_numeric.xml +++ b/core/res/res/xml-xlarge/password_kbd_numeric.xml @@ -19,7 +19,8 @@ --> <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="33.33%p" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_numeric" > diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty.xml b/core/res/res/xml-xlarge/password_kbd_qwerty.xml index 1009c9a..76b6019 100755 --- a/core/res/res/xml-xlarge/password_kbd_qwerty.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty.xml @@ -22,8 +22,8 @@ android:keyWidth="8.272%p" keyboardHeight="@dimen/password_keyboard_height" android:keyHeight="@dimen/password_keyboard_key_height_alpha" - android:horizontalGap="0px" - android:verticalGap="0px"> + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap"> <Row android:keyWidth="8.272%p"> <Key android:keyLabel="Tab" diff --git a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml index cbf17c3..35c3142 100755 --- a/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml-xlarge/password_kbd_qwerty_shifted.xml @@ -22,8 +22,8 @@ android:keyWidth="8.272%p" keyboardHeight="@dimen/password_keyboard_height" android:keyHeight="@dimen/password_keyboard_key_height_alpha" - android:horizontalGap="0px" - android:verticalGap="0px"> + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap"> <Row android:keyWidth="8.272%p"> <Key android:keyLabel="Tab" diff --git a/core/res/res/xml-xlarge/password_kbd_symbols.xml b/core/res/res/xml-xlarge/password_kbd_symbols.xml index a58a023..106dd6e 100755 --- a/core/res/res/xml-xlarge/password_kbd_symbols.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols.xml @@ -22,8 +22,8 @@ android:keyWidth="8.272%p" keyboardHeight="@dimen/password_keyboard_height" android:keyHeight="@dimen/password_keyboard_key_height_alpha" - android:horizontalGap="0px" - android:verticalGap="0px"> + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap"> <Row android:keyWidth="8.272%p"> <Key android:keyLabel="Tab" diff --git a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml index 9d9acf5..1233f78 100755 --- a/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml +++ b/core/res/res/xml-xlarge/password_kbd_symbols_shift.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha"> <Row android:keyWidth="8.272%p" diff --git a/core/res/res/xml/password_kbd_extension.xml b/core/res/res/xml/password_kbd_extension.xml index f3fa57b..e8d61fe 100755 --- a/core/res/res/xml/password_kbd_extension.xml +++ b/core/res/res/xml/password_kbd_extension.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml/password_kbd_numeric.xml b/core/res/res/xml/password_kbd_numeric.xml index 2270b8a..2fd5aa0 100755 --- a/core/res/res/xml/password_kbd_numeric.xml +++ b/core/res/res/xml/password_kbd_numeric.xml @@ -19,7 +19,8 @@ --> <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="33.33%p" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_numeric" > diff --git a/core/res/res/xml/password_kbd_popup_template.xml b/core/res/res/xml/password_kbd_popup_template.xml index 9b853e2..9fcac2c 100644 --- a/core/res/res/xml/password_kbd_popup_template.xml +++ b/core/res/res/xml/password_kbd_popup_template.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > </Keyboard> diff --git a/core/res/res/xml/password_kbd_qwerty.xml b/core/res/res/xml/password_kbd_qwerty.xml index 0a35040..dfe581e 100755 --- a/core/res/res/xml/password_kbd_qwerty.xml +++ b/core/res/res/xml/password_kbd_qwerty.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml/password_kbd_qwerty_shifted.xml b/core/res/res/xml/password_kbd_qwerty_shifted.xml index 9e9db81..1366c58 100755 --- a/core/res/res/xml/password_kbd_qwerty_shifted.xml +++ b/core/res/res/xml/password_kbd_qwerty_shifted.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml/password_kbd_symbols.xml b/core/res/res/xml/password_kbd_symbols.xml index 9a94930..5876b0d 100755 --- a/core/res/res/xml/password_kbd_symbols.xml +++ b/core/res/res/xml/password_kbd_symbols.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/res/res/xml/password_kbd_symbols_shift.xml b/core/res/res/xml/password_kbd_symbols_shift.xml index a972eb2..ee83544 100755 --- a/core/res/res/xml/password_kbd_symbols_shift.xml +++ b/core/res/res/xml/password_kbd_symbols_shift.xml @@ -20,8 +20,8 @@ <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" - android:horizontalGap="0px" - android:verticalGap="0px" + android:horizontalGap="@dimen/password_keyboard_horizontalGap" + android:verticalGap="@dimen/password_keyboard_verticalGap" android:keyHeight="@dimen/password_keyboard_key_height_alpha" > diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index 5d28ef7..6c87c3b 100755 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -3114,6 +3114,13 @@ public class PackageManagerTests extends AndroidTestCase { PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } + @LargeTest + public void testInstallNonexistentFile() { + int retCode = PackageManager.INSTALL_FAILED_INVALID_URI; + File invalidFile = new File("/nonexistent-file.apk"); + invokeInstallPackageFail(Uri.fromFile(invalidFile), 0, retCode); + } + /*---------- Recommended install location tests ----*/ /* * TODO's diff --git a/graphics/java/android/graphics/ImageFormat.java b/graphics/java/android/graphics/ImageFormat.java index b8e9384..7269a71 100644 --- a/graphics/java/android/graphics/ImageFormat.java +++ b/graphics/java/android/graphics/ImageFormat.java @@ -84,9 +84,19 @@ public class ImageFormat { public static final int JPEG = 0x100; /** + * Raw bayer format used for images, which is 10 bit precision samples + * stored in 16 bit words. The filter pattern is RGGB. Whether this format + * is supported by the camera hardware can be determined by + * {@link android.hardware.Camera.Parameters#getSupportedPreviewFormats()}. + * + * @hide + */ + public static final int BAYER_RGGB = 0x200; + + /** * Use this function to retrieve the number of bits per pixel of an * ImageFormat. - * + * * @param format * @return the number of bits per pixel of the given format or -1 if the * format doesn't exist or is not supported. @@ -103,6 +113,8 @@ public class ImageFormat { return 12; case NV21: return 12; + case BAYER_RGGB: + return 16; } return -1; } diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 1647ff34..d62fd67 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -187,6 +187,25 @@ public class SurfaceTexture { return nativeGetTimestamp(); } + /** + * release() frees all the buffers and puts the SurfaceTexture into the + * 'abandoned' state. Once put in this state the SurfaceTexture can never + * leave it. When in the 'abandoned' state, all methods of the + * ISurfaceTexture interface will fail with the NO_INIT error. + * + * Note that while calling this method causes all the buffers to be freed + * from the perspective of the the SurfaceTexture, if there are additional + * references on the buffers (e.g. if a buffer is referenced by a client or + * by OpenGL ES as a texture) then those buffer will remain allocated. + * + * Always call this method when you are done with SurfaceTexture. Failing + * to do so may delay resource deallocation for a significant amount of + * time. + */ + public void release() { + nativeRelease(); + } + protected void finalize() throws Throwable { try { nativeFinalize(); @@ -232,6 +251,7 @@ public class SurfaceTexture { private native void nativeSetDefaultBufferSize(int width, int height); private native void nativeUpdateTexImage(); private native int nativeGetQueuedCount(); + private native void nativeRelease(); /* * We use a class initializer to allow the native code to cache some diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 48483fd..b661496 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -573,6 +573,9 @@ public: static const char PIXEL_FORMAT_RGB565[]; static const char PIXEL_FORMAT_RGBA8888[]; static const char PIXEL_FORMAT_JPEG[]; + // Raw bayer format used for images, which is 10 bit precision samples + // stored in 16 bit words. The filter pattern is RGGB. + static const char PIXEL_FORMAT_BAYER_RGGB[]; // Values for focus mode settings. // Auto-focus mode. Applications should call diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp index 251615d..51b96c1 100644 --- a/libs/camera/CameraParameters.cpp +++ b/libs/camera/CameraParameters.cpp @@ -151,6 +151,7 @@ const char CameraParameters::PIXEL_FORMAT_YUV420P[] = "yuv420p"; const char CameraParameters::PIXEL_FORMAT_RGB565[] = "rgb565"; const char CameraParameters::PIXEL_FORMAT_RGBA8888[] = "rgba8888"; const char CameraParameters::PIXEL_FORMAT_JPEG[] = "jpeg"; +const char CameraParameters::PIXEL_FORMAT_BAYER_RGGB[] = "bayer-rggb"; // Values for focus mode settings. const char CameraParameters::FOCUS_MODE_AUTO[] = "auto"; diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 4f51f03..1a036ee 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -910,6 +910,7 @@ void SurfaceTexture::abandon() { Mutex::Autolock lock(mMutex); freeAllBuffers(); mAbandoned = true; + mCurrentTextureBuf.clear(); mDequeueCondition.signal(); } diff --git a/packages/BackupRestoreConfirmation/res/layout/confirm_backup.xml b/packages/BackupRestoreConfirmation/res/layout/confirm_backup.xml index 3668b8c..7dfa53e 100644 --- a/packages/BackupRestoreConfirmation/res/layout/confirm_backup.xml +++ b/packages/BackupRestoreConfirmation/res/layout/confirm_backup.xml @@ -18,10 +18,20 @@ */ --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="16dp" > + + <ScrollView + android:layout_height="0dp" + android:layout_weight="1" + android:layout_width="match_parent"> + <LinearLayout + android:orientation="vertical" android:layout_height="wrap_content" - android:padding="16dp" > + android:layout_width="match_parent"> <TextView android:id="@+id/confirm_text" android:layout_width="match_parent" @@ -63,13 +73,21 @@ android:layout_marginLeft="30dp" android:layout_below="@id/enc_password" android:layout_marginBottom="30dp" /> + </LinearLayout> + </ScrollView> + + <LinearLayout android:orientation="horizontal" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_gravity="bottom"> <Button android:id="@+id/button_allow" android:filterTouchesWhenObscured="true" android:text="@string/allow_backup_button_label" android:layout_below="@id/package_name" android:layout_height="wrap_content" - android:layout_width="wrap_content" /> + android:layout_width="0dp" + android:layout_weight="1" /> <Button android:id="@+id/button_deny" android:text="@string/deny_backup_button_label" @@ -77,6 +95,9 @@ android:layout_toRightOf="@id/button_allow" android:layout_alignTop="@id/button_allow" android:layout_height="wrap_content" - android:layout_width="wrap_content" /> + android:layout_width="0dp" + android:layout_weight="1" /> + + </LinearLayout> -</RelativeLayout> +</LinearLayout> diff --git a/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml b/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml index 38fcc49..4927cbb 100644 --- a/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml +++ b/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml @@ -18,65 +18,86 @@ */ --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="16dp" > + + <ScrollView + android:layout_height="0dp" + android:layout_weight="1" + android:layout_width="match_parent"> + <LinearLayout + android:orientation="vertical" android:layout_height="wrap_content" - android:padding="16dp" > + android:layout_width="match_parent"> - <TextView android:id="@+id/confirm_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="30dp" - android:text="@string/restore_confirm_text" /> + <TextView android:id="@+id/confirm_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="30dp" + android:text="@string/restore_confirm_text" /> + + <TextView android:id="@+id/password_desc" + android:layout_below="@id/confirm_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:text="@string/current_password_text" /> - <TextView android:id="@+id/password_desc" - android:layout_below="@id/confirm_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="10dp" - android:text="@string/current_password_text" /> + <EditText android:id="@+id/password" + android:layout_below="@id/password_desc" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="30dp" + android:password="true" /> - <EditText android:id="@+id/password" - android:layout_below="@id/password_desc" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="30dp" - android:password="true" /> + <TextView android:id="@+id/enc_password_desc" + android:layout_below="@id/password" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="10dp" + android:text="@string/restore_enc_password_text" /> - <TextView android:id="@+id/enc_password_desc" - android:layout_below="@id/password" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="10dp" - android:text="@string/restore_enc_password_text" /> + <EditText android:id="@+id/enc_password" + android:layout_below="@id/enc_password_desc" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="30dp" + android:password="true" /> - <EditText android:id="@+id/enc_password" - android:layout_below="@id/enc_password_desc" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="30dp" - android:password="true" /> + <TextView android:id="@+id/package_name" + android:layout_width="match_parent" + android:layout_height="20dp" + android:layout_marginLeft="30dp" + android:layout_below="@id/enc_password" + android:layout_marginBottom="10dp" /> + </LinearLayout> + </ScrollView> - <TextView android:id="@+id/package_name" - android:layout_width="match_parent" - android:layout_height="20dp" - android:layout_marginLeft="30dp" - android:layout_below="@id/enc_password" - android:layout_marginBottom="30dp" /> + <LinearLayout android:orientation="horizontal" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_gravity="bottom"> - <Button android:id="@+id/button_allow" - android:filterTouchesWhenObscured="true" - android:text="@string/allow_restore_button_label" - android:layout_below="@id/package_name" - android:layout_height="wrap_content" - android:layout_width="wrap_content" /> + <Button android:id="@+id/button_allow" + android:filterTouchesWhenObscured="true" + android:text="@string/allow_restore_button_label" + android:layout_below="@id/package_name" + android:layout_height="wrap_content" + android:layout_width="0dp" + android:layout_weight="1" /> + + <Button android:id="@+id/button_deny" + android:text="@string/deny_restore_button_label" + android:layout_below="@id/package_name" + android:layout_toRightOf="@id/button_allow" + android:layout_alignTop="@id/button_allow" + android:layout_height="wrap_content" + android:layout_width="0dp" + android:layout_weight="1" /> - <Button android:id="@+id/button_deny" - android:text="@string/deny_restore_button_label" - android:layout_below="@id/package_name" - android:layout_toRightOf="@id/button_allow" - android:layout_alignTop="@id/button_allow" - android:layout_height="wrap_content" - android:layout_width="wrap_content" /> + </LinearLayout> -</RelativeLayout> +</LinearLayout> diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java index 626cc86..eae6112 100644 --- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java +++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java @@ -38,8 +38,7 @@ import android.os.ServiceManager; import android.os.StatFs; import android.app.IntentService; import android.util.DisplayMetrics; -import android.util.Log; -import android.util.Pair; +import android.util.Slog; import java.io.File; import java.io.FileInputStream; @@ -47,11 +46,6 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; import android.os.FileUtils; import android.provider.Settings; @@ -120,29 +114,39 @@ public class DefaultContainerService extends IntentService { public PackageInfoLite getMinimalPackageInfo(final Uri fileUri, int flags, long threshold) { PackageInfoLite ret = new PackageInfoLite(); if (fileUri == null) { - Log.i(TAG, "Invalid package uri " + fileUri); + Slog.i(TAG, "Invalid package uri " + fileUri); ret.recommendedInstallLocation = PackageHelper.RECOMMEND_FAILED_INVALID_APK; return ret; } String scheme = fileUri.getScheme(); if (scheme != null && !scheme.equals("file")) { - Log.w(TAG, "Falling back to installing on internal storage only"); + Slog.w(TAG, "Falling back to installing on internal storage only"); ret.recommendedInstallLocation = PackageHelper.RECOMMEND_INSTALL_INTERNAL; return ret; } String archiveFilePath = fileUri.getPath(); DisplayMetrics metrics = new DisplayMetrics(); metrics.setToDefaults(); + PackageParser.PackageLite pkg = PackageParser.parsePackageLite(archiveFilePath, 0); if (pkg == null) { - Log.w(TAG, "Failed to parse package"); - ret.recommendedInstallLocation = PackageHelper.RECOMMEND_FAILED_INVALID_APK; + Slog.w(TAG, "Failed to parse package"); + + final File apkFile = new File(archiveFilePath); + if (!apkFile.exists()) { + ret.recommendedInstallLocation = PackageHelper.RECOMMEND_FAILED_INVALID_URI; + } else { + ret.recommendedInstallLocation = PackageHelper.RECOMMEND_FAILED_INVALID_APK; + } + return ret; } ret.packageName = pkg.packageName; ret.installLocation = pkg.installLocation; + ret.recommendedInstallLocation = recommendAppInstallLocation(pkg.installLocation, archiveFilePath, flags, threshold); + return ret; } @@ -150,20 +154,28 @@ public class DefaultContainerService extends IntentService { public boolean checkInternalFreeStorage(Uri packageUri, long threshold) throws RemoteException { final File apkFile = new File(packageUri.getPath()); - return isUnderInternalThreshold(apkFile, threshold); + try { + return isUnderInternalThreshold(apkFile, threshold); + } catch (FileNotFoundException e) { + return true; + } } @Override public boolean checkExternalFreeStorage(Uri packageUri) throws RemoteException { final File apkFile = new File(packageUri.getPath()); - return isUnderExternalThreshold(apkFile); + try { + return isUnderExternalThreshold(apkFile); + } catch (FileNotFoundException e) { + return true; + } } public ObbInfo getObbInfo(String filename) { try { return ObbScanner.getObbInfo(filename); } catch (IOException e) { - Log.d(TAG, "Couldn't get OBB info for " + filename); + Slog.d(TAG, "Couldn't get OBB info for " + filename); return null; } } @@ -221,7 +233,7 @@ public class DefaultContainerService extends IntentService { // Make sure the sdcard is mounted. String status = Environment.getExternalStorageState(); if (!status.equals(Environment.MEDIA_MOUNTED)) { - Log.w(TAG, "Make sure sdcard is mounted."); + Slog.w(TAG, "Make sure sdcard is mounted."); return null; } @@ -229,75 +241,81 @@ public class DefaultContainerService extends IntentService { String codePath = packageURI.getPath(); File codeFile = new File(codePath); - // Native files we need to copy to the container. - List<Pair<ZipEntry, String>> nativeFiles = new ArrayList<Pair<ZipEntry, String>>(); - // Calculate size of container needed to hold base APK. - final int sizeMb = calculateContainerSize(codeFile, nativeFiles); + int sizeMb; + try { + sizeMb = calculateContainerSize(codeFile); + } catch (FileNotFoundException e) { + Slog.w(TAG, "File does not exist when trying to copy " + codeFile.getPath()); + return null; + } // Create new container - String newCachePath = null; + final String newCachePath; if ((newCachePath = PackageHelper.createSdDir(sizeMb, newCid, key, Process.myUid())) == null) { - Log.e(TAG, "Failed to create container " + newCid); + Slog.e(TAG, "Failed to create container " + newCid); return null; } - if (localLOGV) - Log.i(TAG, "Created container for " + newCid + " at path : " + newCachePath); - File resFile = new File(newCachePath, resFileName); - if (!FileUtils.copyFile(new File(codePath), resFile)) { - Log.e(TAG, "Failed to copy " + codePath + " to " + resFile); + + if (localLOGV) { + Slog.i(TAG, "Created container for " + newCid + " at path : " + newCachePath); + } + + final File resFile = new File(newCachePath, resFileName); + if (FileUtils.copyFile(new File(codePath), resFile)) { + if (localLOGV) { + Slog.i(TAG, "Copied " + codePath + " to " + resFile); + } + } else { + Slog.e(TAG, "Failed to copy " + codePath + " to " + resFile); // Clean up container PackageHelper.destroySdDir(newCid); return null; } - try { - ZipFile zipFile = new ZipFile(codeFile); - - File sharedLibraryDir = new File(newCachePath, LIB_DIR_NAME); - sharedLibraryDir.mkdir(); - - final int N = nativeFiles.size(); - for (int i = 0; i < N; i++) { - final Pair<ZipEntry, String> entry = nativeFiles.get(i); - - InputStream is = zipFile.getInputStream(entry.first); - try { - File destFile = new File(sharedLibraryDir, entry.second); - if (!FileUtils.copyToFile(is, destFile)) { - throw new IOException("Couldn't copy native binary " - + entry.first.getName() + " to " + entry.second); - } - } finally { - is.close(); - } + final File sharedLibraryDir = new File(newCachePath, LIB_DIR_NAME); + if (sharedLibraryDir.mkdir()) { + int ret = NativeLibraryHelper.copyNativeBinariesIfNeededLI(codeFile, sharedLibraryDir); + if (ret != PackageManager.INSTALL_SUCCEEDED) { + Slog.e(TAG, "Could not copy native libraries to " + sharedLibraryDir.getPath()); + PackageHelper.destroySdDir(newCid); + return null; } - } catch (IOException e) { - Log.e(TAG, "Couldn't copy native file to container", e); + } else { + Slog.e(TAG, "Could not create native lib directory: " + sharedLibraryDir.getPath()); PackageHelper.destroySdDir(newCid); return null; } - if (localLOGV) Log.i(TAG, "Copied " + codePath + " to " + resFile); if (!PackageHelper.finalizeSdDir(newCid)) { - Log.e(TAG, "Failed to finalize " + newCid + " at path " + newCachePath); + Slog.e(TAG, "Failed to finalize " + newCid + " at path " + newCachePath); // Clean up container PackageHelper.destroySdDir(newCid); + return null; + } + + if (localLOGV) { + Slog.i(TAG, "Finalized container " + newCid); } - if (localLOGV) Log.i(TAG, "Finalized container " + newCid); + if (PackageHelper.isContainerMounted(newCid)) { - if (localLOGV) Log.i(TAG, "Unmounting " + newCid + - " at path " + newCachePath); + if (localLOGV) { + Slog.i(TAG, "Unmounting " + newCid + " at path " + newCachePath); + } + // Force a gc to avoid being killed. Runtime.getRuntime().gc(); PackageHelper.unMountSdDir(newCid); } else { - if (localLOGV) Log.i(TAG, "Container " + newCid + " not mounted"); + if (localLOGV) { + Slog.i(TAG, "Container " + newCid + " not mounted"); + } } + return newCachePath; } - public static boolean copyToFile(InputStream inputStream, FileOutputStream out) { + private static boolean copyToFile(InputStream inputStream, FileOutputStream out) { try { byte[] buffer = new byte[4096]; int bytesRead; @@ -306,12 +324,12 @@ public class DefaultContainerService extends IntentService { } return true; } catch (IOException e) { - Log.i(TAG, "Exception : " + e + " when copying file"); + Slog.i(TAG, "Exception : " + e + " when copying file"); return false; } } - public static boolean copyToFile(File srcFile, FileOutputStream out) { + private static boolean copyToFile(File srcFile, FileOutputStream out) { InputStream inputStream = null; try { inputStream = new FileInputStream(srcFile); @@ -323,7 +341,7 @@ public class DefaultContainerService extends IntentService { } } - private boolean copyFile(Uri pPackageURI, FileOutputStream outStream) { + private boolean copyFile(Uri pPackageURI, FileOutputStream outStream) { String scheme = pPackageURI.getScheme(); if (scheme == null || scheme.equals("file")) { final File srcPackageFile = new File(pPackageURI.getPath()); @@ -331,7 +349,7 @@ public class DefaultContainerService extends IntentService { // destination file in order to eliminate a window where the package directory // scanner notices the new package file but it's not completely copied yet. if (!copyToFile(srcPackageFile, outStream)) { - Log.e(TAG, "Couldn't copy file: " + srcPackageFile); + Slog.e(TAG, "Couldn't copy file: " + srcPackageFile); return false; } } else if (scheme.equals("content")) { @@ -339,28 +357,31 @@ public class DefaultContainerService extends IntentService { try { fd = getContentResolver().openFileDescriptor(pPackageURI, "r"); } catch (FileNotFoundException e) { - Log.e(TAG, "Couldn't open file descriptor from download service. Failed with exception " + e); + Slog.e(TAG, + "Couldn't open file descriptor from download service. Failed with exception " + + e); return false; } if (fd == null) { - Log.e(TAG, "Couldn't open file descriptor from download service (null)."); + Slog.e(TAG, "Couldn't open file descriptor from download service (null)."); return false; } else { if (localLOGV) { - Log.v(TAG, "Opened file descriptor from download service."); + Slog.i(TAG, "Opened file descriptor from download service."); } ParcelFileDescriptor.AutoCloseInputStream dlStream = new ParcelFileDescriptor.AutoCloseInputStream(fd); // We copy the source package file to a temp file and then rename it to the // destination file in order to eliminate a window where the package directory - // scanner notices the new package file but it's not completely copied yet. + // scanner notices the new package file but it's not completely + // cop if (!copyToFile(dlStream, outStream)) { - Log.e(TAG, "Couldn't copy " + pPackageURI + " to temp file."); + Slog.e(TAG, "Couldn't copy " + pPackageURI + " to temp file."); return false; } } } else { - Log.e(TAG, "Package URI is not 'file:' or 'content:' - " + pPackageURI); + Slog.e(TAG, "Package URI is not 'file:' or 'content:' - " + pPackageURI); return false; } return true; @@ -434,12 +455,20 @@ public class DefaultContainerService extends IntentService { boolean fitsOnInternal = false; if (checkBoth || prefer == PREFER_INTERNAL) { - fitsOnInternal = isUnderInternalThreshold(apkFile, threshold); + try { + fitsOnInternal = isUnderInternalThreshold(apkFile, threshold); + } catch (FileNotFoundException e) { + return PackageHelper.RECOMMEND_FAILED_INVALID_URI; + } } boolean fitsOnSd = false; if (!emulated && (checkBoth || prefer == PREFER_EXTERNAL)) { - fitsOnSd = isUnderExternalThreshold(apkFile); + try { + fitsOnSd = isUnderExternalThreshold(apkFile); + } catch (FileNotFoundException e) { + return PackageHelper.RECOMMEND_FAILED_INVALID_URI; + } } if (prefer == PREFER_INTERNAL) { @@ -473,8 +502,20 @@ public class DefaultContainerService extends IntentService { } } - private boolean isUnderInternalThreshold(File apkFile, long threshold) { + /** + * Measure a file to see if it fits within the free space threshold. + * + * @param apkFile file to check + * @param threshold byte threshold to compare against + * @return true if file fits under threshold + * @throws FileNotFoundException when APK does not exist + */ + private boolean isUnderInternalThreshold(File apkFile, long threshold) + throws FileNotFoundException { final long size = apkFile.length(); + if (size == 0 && !apkFile.exists()) { + throw new FileNotFoundException(); + } final StatFs internalStats = new StatFs(Environment.getDataDirectory().getPath()); final long availInternalSize = (long) internalStats.getAvailableBlocks() @@ -484,12 +525,19 @@ public class DefaultContainerService extends IntentService { } - private boolean isUnderExternalThreshold(File apkFile) { + /** + * Measure a file to see if it fits in the external free space. + * + * @param apkFile file to check + * @return true if file fits + * @throws IOException when file does not exist + */ + private boolean isUnderExternalThreshold(File apkFile) throws FileNotFoundException { if (Environment.isExternalStorageEmulated()) { return false; } - final int sizeMb = calculateContainerSize(apkFile, null); + final int sizeMb = calculateContainerSize(apkFile); final int availSdMb; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { @@ -508,10 +556,14 @@ public class DefaultContainerService extends IntentService { * * @param apkFile file from which to calculate size * @return size in megabytes (2^20 bytes) + * @throws FileNotFoundException when file does not exist */ - private int calculateContainerSize(File apkFile, List<Pair<ZipEntry, String>> outFiles) { + private int calculateContainerSize(File apkFile) throws FileNotFoundException { // Calculate size of container needed to hold base APK. long sizeBytes = apkFile.length(); + if (sizeBytes == 0 && !apkFile.exists()) { + throw new FileNotFoundException(); + } // Check all the native files that need to be copied and add that to the // container size. diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml index d97b90f..1446099 100644 --- a/packages/SystemUI/res/values-ja/strings.xml +++ b/packages/SystemUI/res/values-ja/strings.xml @@ -135,4 +135,8 @@ <skip /> <!-- no translation found for gps_notification_found_text (4619274244146446464) --> <skip /> + + <!-- in Japanese the day of week should follow the date --> + <string name="status_bar_date_formatter">%2$s\n%1$s</string> + </resources> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 2b3118d..03b82fd 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -41,8 +41,9 @@ <!-- Title shown in recents popup for inspecting an application's properties --> <string name="status_bar_recent_inspect_item_title">Inspect</string> - - + <!-- For formatting day of week and date in DateView. Day of week precedes date by default, + but this may be overridden on a per-locale basis if necessary. --> + <string name="status_bar_date_formatter">%1$s\n%2$s</string> <!-- The label in the bar at the top of the status bar when there are no notifications showing. [CHAR LIMIT=40]--> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java index 6ab03e1..a171514 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java @@ -28,6 +28,8 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewParent; +import com.android.systemui.R; + import java.util.Date; public final class DateView extends TextView { @@ -90,7 +92,7 @@ public final class DateView extends TextView { Date now = new Date(); CharSequence dow = DateFormat.format("EEEE", now); CharSequence date = DateFormat.getMediumDateFormat(getContext()).format(now); - setText(dow + "\n" + date); + setText(context.getString(R.string.status_bar_date_formatter, dow, date)); } private boolean isVisible() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index dc7e313..c7b6f20 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -1606,6 +1606,10 @@ public class TabletStatusBar extends StatusBar implements } return; + } else if (0 != (mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS)) { + // if icons are disabled but we're not in DND mode, this is probably Setup and we should + // just leave the area totally empty + return; } int N = mNotificationData.size(); diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 9c19da2..14f7c11 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -552,6 +552,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (!st.shownPanelView.hasFocus()) { st.shownPanelView.requestFocus(); } + } else if (!st.isInExpandedMode) { + width = MATCH_PARENT; } st.isOpen = true; diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index b7f6adf..bdc37ef 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -113,6 +113,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; +import static android.view.WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static android.view.WindowManager.LayoutParams.TYPE_POINTER; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; @@ -162,36 +163,39 @@ public class PhoneWindowManager implements WindowManagerPolicy { static final int APPLICATION_LAYER = 2; static final int PHONE_LAYER = 3; static final int SEARCH_BAR_LAYER = 4; - static final int STATUS_BAR_SUB_PANEL_LAYER = 5; - static final int SYSTEM_DIALOG_LAYER = 6; + static final int SYSTEM_DIALOG_LAYER = 5; // toasts and the plugged-in battery thing - static final int TOAST_LAYER = 7; + static final int TOAST_LAYER = 6; // SIM errors and unlock. Not sure if this really should be in a high layer. - static final int PRIORITY_PHONE_LAYER = 8; + static final int PRIORITY_PHONE_LAYER = 7; // like the ANR / app crashed dialogs - static final int SYSTEM_ALERT_LAYER = 9; + static final int SYSTEM_ALERT_LAYER = 8; // system-level error dialogs - static final int SYSTEM_ERROR_LAYER = 10; + static final int SYSTEM_ERROR_LAYER = 9; // on-screen keyboards and other such input method user interfaces go here. - static final int INPUT_METHOD_LAYER = 11; + static final int INPUT_METHOD_LAYER = 10; // on-screen keyboards and other such input method user interfaces go here. - static final int INPUT_METHOD_DIALOG_LAYER = 12; + static final int INPUT_METHOD_DIALOG_LAYER = 11; // the keyguard; nothing on top of these can take focus, since they are // responsible for power management when displayed. - static final int KEYGUARD_LAYER = 13; - static final int KEYGUARD_DIALOG_LAYER = 14; + static final int KEYGUARD_LAYER = 12; + static final int KEYGUARD_DIALOG_LAYER = 13; + static final int STATUS_BAR_SUB_PANEL_LAYER = 14; static final int STATUS_BAR_LAYER = 15; static final int STATUS_BAR_PANEL_LAYER = 16; // the navigation bar, if available, shows atop most things static final int NAVIGATION_BAR_LAYER = 17; + // the on-screen volume indicator and controller shown when the user + // changes the device volume + static final int VOLUME_OVERLAY_LAYER = 18; // the drag layer: input for drag-and-drop is associated with this window, // which sits above all other focusable windows - static final int DRAG_LAYER = 18; + static final int DRAG_LAYER = 19; // things in here CAN NOT take focus, but are shown on top of everything else. - static final int SYSTEM_OVERLAY_LAYER = 19; - static final int SECURE_SYSTEM_OVERLAY_LAYER = 20; + static final int SYSTEM_OVERLAY_LAYER = 20; + static final int SECURE_SYSTEM_OVERLAY_LAYER = 21; // the (mouse) pointer layer - static final int POINTER_LAYER = 21; + static final int POINTER_LAYER = 22; static final int APPLICATION_MEDIA_SUBLAYER = -2; static final int APPLICATION_MEDIA_OVERLAY_SUBLAYER = -1; @@ -1057,6 +1061,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { return INPUT_METHOD_LAYER; case TYPE_INPUT_METHOD_DIALOG: return INPUT_METHOD_DIALOG_LAYER; + case TYPE_VOLUME_OVERLAY: + return VOLUME_OVERLAY_LAYER; case TYPE_SYSTEM_OVERLAY: return SYSTEM_OVERLAY_LAYER; case TYPE_SECURE_SYSTEM_OVERLAY: diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 1bbe934..bf9e014 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -40,6 +40,7 @@ import android.net.MobileDataStateTracker; import android.net.NetworkConfig; import android.net.NetworkInfo; import android.net.NetworkInfo.DetailedState; +import android.net.NetworkQuotaInfo; import android.net.NetworkState; import android.net.NetworkStateTracker; import android.net.NetworkUtils; @@ -737,6 +738,30 @@ public class ConnectivityService extends IConnectivityManager.Stub { return result.toArray(new NetworkState[result.size()]); } + private NetworkState getNetworkStateUnchecked(int networkType) { + if (isNetworkTypeValid(networkType)) { + final NetworkStateTracker tracker = mNetTrackers[networkType]; + if (tracker != null) { + return new NetworkState(tracker.getNetworkInfo(), tracker.getLinkProperties(), + tracker.getLinkCapabilities()); + } + } + return null; + } + + @Override + public NetworkQuotaInfo getActiveNetworkQuotaInfo() { + enforceAccessPermission(); + final NetworkState state = getNetworkStateUnchecked(mActiveDefaultNetwork); + if (state != null) { + try { + return mPolicyManager.getNetworkQuotaInfo(state); + } catch (RemoteException e) { + } + } + return null; + } + public boolean setRadios(boolean turnOn) { boolean result = true; enforceChangePermission(); diff --git a/services/java/com/android/server/net/NetworkPolicyManagerService.java b/services/java/com/android/server/net/NetworkPolicyManagerService.java index 756cd00..a075255 100644 --- a/services/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/java/com/android/server/net/NetworkPolicyManagerService.java @@ -16,6 +16,7 @@ package com.android.server.net; +import static android.Manifest.permission.ACCESS_NETWORK_STATE; import static android.Manifest.permission.CONNECTIVITY_INTERNAL; import static android.Manifest.permission.DUMP; import static android.Manifest.permission.MANAGE_APP_TOKENS; @@ -75,9 +76,11 @@ import android.net.INetworkPolicyManager; import android.net.INetworkStatsService; import android.net.NetworkIdentity; import android.net.NetworkPolicy; +import android.net.NetworkQuotaInfo; import android.net.NetworkState; import android.net.NetworkStats; import android.net.NetworkTemplate; +import android.os.Binder; import android.os.Environment; import android.os.Handler; import android.os.HandlerThread; @@ -1054,6 +1057,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { synchronized (mRulesLock) { mRestrictBackground = restrictBackground; updateRulesForRestrictBackgroundLocked(); + writePolicyLocked(); } } @@ -1066,6 +1070,68 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } + private NetworkPolicy findPolicyForNetworkLocked(NetworkIdentity ident) { + for (NetworkPolicy policy : mNetworkPolicy.values()) { + if (policy.template.matches(ident)) { + return policy; + } + } + return null; + } + + @Override + public NetworkQuotaInfo getNetworkQuotaInfo(NetworkState state) { + mContext.enforceCallingOrSelfPermission(ACCESS_NETWORK_STATE, TAG); + + // only returns usage summary, so we don't require caller to have + // READ_NETWORK_USAGE_HISTORY. + final long token = Binder.clearCallingIdentity(); + try { + return getNetworkQuotaInfoUnchecked(state); + } finally { + Binder.restoreCallingIdentity(token); + } + } + + private NetworkQuotaInfo getNetworkQuotaInfoUnchecked(NetworkState state) { + final NetworkIdentity ident = NetworkIdentity.buildNetworkIdentity(mContext, state); + + final NetworkPolicy policy; + synchronized (mRulesLock) { + policy = findPolicyForNetworkLocked(ident); + } + + if (policy == null) { + // missing policy means we can't derive useful quota info + return null; + } + + final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis() + : System.currentTimeMillis(); + + final long start = computeLastCycleBoundary(currentTime, policy); + final long end = currentTime; + + // find total bytes used under policy + long totalBytes = 0; + try { + final NetworkStats stats = mNetworkStats.getSummaryForNetwork( + policy.template, start, end); + final NetworkStats.Entry entry = stats.getValues(0, null); + totalBytes = entry.rxBytes + entry.txBytes; + } catch (RemoteException e) { + Slog.w(TAG, "problem reading summary for template " + policy.template); + } + + // report soft and hard limits under policy + final long softLimitBytes = policy.warningBytes != WARNING_DISABLED ? policy.warningBytes + : NetworkQuotaInfo.NO_LIMIT; + final long hardLimitBytes = policy.limitBytes != LIMIT_DISABLED ? policy.limitBytes + : NetworkQuotaInfo.NO_LIMIT; + + return new NetworkQuotaInfo(totalBytes, softLimitBytes, hardLimitBytes); + } + @Override protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) { mContext.enforceCallingOrSelfPermission(DUMP, TAG); diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 3d977d0..36371a5 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -5025,16 +5025,18 @@ public class PackageManagerService extends IPackageManager.Stub { } int loc = pkgLite.recommendedInstallLocation; - if (loc == PackageHelper.RECOMMEND_FAILED_INVALID_LOCATION){ + if (loc == PackageHelper.RECOMMEND_FAILED_INVALID_LOCATION) { ret = PackageManager.INSTALL_FAILED_INVALID_INSTALL_LOCATION; - } else if (loc == PackageHelper.RECOMMEND_FAILED_ALREADY_EXISTS){ + } else if (loc == PackageHelper.RECOMMEND_FAILED_ALREADY_EXISTS) { ret = PackageManager.INSTALL_FAILED_ALREADY_EXISTS; - } else if (loc == PackageHelper.RECOMMEND_FAILED_INSUFFICIENT_STORAGE){ + } else if (loc == PackageHelper.RECOMMEND_FAILED_INSUFFICIENT_STORAGE) { ret = PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE; } else if (loc == PackageHelper.RECOMMEND_FAILED_INVALID_APK) { ret = PackageManager.INSTALL_FAILED_INVALID_APK; + } else if (loc == PackageHelper.RECOMMEND_FAILED_INVALID_URI) { + ret = PackageManager.INSTALL_FAILED_INVALID_URI; } else if (loc == PackageHelper.RECOMMEND_MEDIA_UNAVAILABLE) { - ret = PackageManager.INSTALL_FAILED_MEDIA_UNAVAILABLE; + ret = PackageManager.INSTALL_FAILED_MEDIA_UNAVAILABLE; } else { // Override with defaults if needed. loc = installLocationPolicy(pkgLite, flags); diff --git a/services/java/com/android/server/usb/UsbDeviceManager.java b/services/java/com/android/server/usb/UsbDeviceManager.java index 86de880..91c5e33 100644 --- a/services/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/java/com/android/server/usb/UsbDeviceManager.java @@ -382,7 +382,7 @@ public class UsbDeviceManager { mAdbEnabled = enable; // Due to the persist.sys.usb.config property trigger, changing adb state requires // switching to default function - setEnabledFunctions(mDefaultFunctions, false); + setEnabledFunctions(mDefaultFunctions, true); updateAdbNotification(); } } diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java index aad138c..9ea90f8 100644 --- a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java +++ b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java @@ -236,8 +236,10 @@ public class PlaybackGraphs { int yPos = LABELOFFSET; canvas.drawText(label, xPos, yPos, whiteLabels); for (int statIndex = 0; statIndex < Stats.length; statIndex++) { - label = resources.getString(R.string.format_stat, - mStats[metricIndex][statIndex]); + String statLabel = resources.getString( + Stats[statIndex].getLabelId()).substring(0,3); + label = statLabel + " " + resources.getString( + R.string.format_stat, mStats[metricIndex][statIndex]); yPos = LABELOFFSET + (1 + statIndex) * PlaybackView.TILE_SCALE / 2; canvas.drawText(label, xPos, yPos, whiteLabels); diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java index a63a2f0..82a7e82 100644 --- a/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java +++ b/tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java @@ -223,7 +223,7 @@ public class ProfileActivity extends Activity { mMovementSpinner = (Spinner) findViewById(R.id.movement); mUrl = (EditText) findViewById(R.id.url); mWeb = (ProfiledWebView) findViewById(R.id.web); - mCallback = new ProfileCallback() { + setCallback(new ProfileCallback() { @SuppressWarnings("unchecked") @Override public void profileCallback(RunData data) { @@ -232,7 +232,7 @@ public class ProfileActivity extends Activity { mCaptureButton.setChecked(false); setTestingState(TestingState.STOP_TESTING); } - }; + }); // Inspect button (opens PlaybackActivity) mInspectButton.setOnClickListener(new OnClickListener() { |