diff options
39 files changed, 558 insertions, 443 deletions
diff --git a/api/current.txt b/api/current.txt index 2058ac9..a19e3e9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -105,9 +105,7 @@ package android { field public static final deprecated java.lang.String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE"; field public static final java.lang.String READ_LOGS = "android.permission.READ_LOGS"; field public static final java.lang.String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE"; - field public static final deprecated java.lang.String READ_PROFILE = "android.permission.READ_PROFILE"; field public static final java.lang.String READ_SMS = "android.permission.READ_SMS"; - field public static final deprecated java.lang.String READ_SOCIAL_STREAM = "android.permission.READ_SOCIAL_STREAM"; field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS"; field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS"; field public static final java.lang.String READ_USER_DICTIONARY = "android.permission.READ_USER_DICTIONARY"; @@ -152,10 +150,8 @@ package android { field public static final java.lang.String WRITE_CONTACTS = "android.permission.WRITE_CONTACTS"; field public static final java.lang.String WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE"; field public static final java.lang.String WRITE_GSERVICES = "android.permission.WRITE_GSERVICES"; - field public static final deprecated java.lang.String WRITE_PROFILE = "android.permission.WRITE_PROFILE"; field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS"; field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS"; - field public static final deprecated java.lang.String WRITE_SOCIAL_STREAM = "android.permission.WRITE_SOCIAL_STREAM"; field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS"; field public static final java.lang.String WRITE_USER_DICTIONARY = "android.permission.WRITE_USER_DICTIONARY"; field public static final java.lang.String WRITE_VOICEMAIL = "com.android.voicemail.permission.WRITE_VOICEMAIL"; @@ -172,7 +168,6 @@ package android { field public static final java.lang.String PHONE = "android.permission-group.PHONE"; field public static final java.lang.String SENSORS = "android.permission-group.SENSORS"; field public static final java.lang.String SMS = "android.permission-group.SMS"; - field public static final java.lang.String SOCIAL_INFO = "android.permission-group.SOCIAL_INFO"; field public static final java.lang.String STORAGE = "android.permission-group.STORAGE"; field public static final java.lang.String USER_DICTIONARY = "android.permission-group.USER_DICTIONARY"; } @@ -12301,7 +12296,6 @@ package android.graphics.drawable { method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; method public void invalidateSelf(); method public boolean isAutoMirrored(); - method public boolean isDither(); method public boolean isFilterBitmap(); method public boolean isStateful(); method public final boolean isVisible(); @@ -12321,7 +12315,7 @@ package android.graphics.drawable { method public void setChangingConfigurations(int); method public abstract void setColorFilter(android.graphics.ColorFilter); method public void setColorFilter(int, android.graphics.PorterDuff.Mode); - method public void setDither(boolean); + method public deprecated void setDither(boolean); method public void setFilterBitmap(boolean); method public void setHotspot(float, float); method public void setHotspotBounds(int, int, int, int); @@ -25573,10 +25567,6 @@ package android.provider { field public static final java.lang.String PHOTO_FILE_ID = "data14"; } - public static final deprecated class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; - } - protected static abstract interface ContactsContract.ContactsColumns { field public static final java.lang.String CONTACT_LAST_UPDATED_TIMESTAMP = "contact_last_updated_timestamp"; field public static final java.lang.String DISPLAY_NAME = "display_name"; @@ -25892,10 +25882,6 @@ package android.provider { field public static final java.lang.String DATA_ID = "data_id"; } - public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; - } - protected static abstract interface ContactsContract.RawContactsColumns { field public static final java.lang.String ACCOUNT_TYPE_AND_DATA_SET = "account_type_and_data_set"; field public static final java.lang.String AGGREGATION_MODE = "aggregation_mode"; @@ -25966,56 +25952,6 @@ package android.provider { field public static final android.net.Uri PROFILE_CONTENT_URI; } - public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String PHOTO = "photo"; - } - - protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id"; - field public static final deprecated java.lang.String PHOTO_URI = "photo_uri"; - field public static final deprecated java.lang.String SORT_INDEX = "sort_index"; - field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id"; - field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1"; - field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2"; - field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3"; - field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4"; - } - - public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item"; - field public static final deprecated android.net.Uri CONTENT_LIMIT_URI; - field public static final deprecated android.net.Uri CONTENT_PHOTO_URI; - field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item"; - field public static final deprecated android.net.Uri CONTENT_URI; - field public static final deprecated java.lang.String MAX_ITEMS = "max_items"; - } - - public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo"; - field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo"; - field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo"; - } - - protected static abstract deprecated interface ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name"; - field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type"; - field public static final deprecated java.lang.String COMMENTS = "comments"; - field public static final deprecated java.lang.String CONTACT_ID = "contact_id"; - field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup"; - field public static final deprecated java.lang.String DATA_SET = "data_set"; - field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id"; - field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id"; - field public static final deprecated java.lang.String RES_ICON = "icon"; - field public static final deprecated java.lang.String RES_LABEL = "label"; - field public static final deprecated java.lang.String RES_PACKAGE = "res_package"; - field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1"; - field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2"; - field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3"; - field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4"; - field public static final deprecated java.lang.String TEXT = "text"; - field public static final deprecated java.lang.String TIMESTAMP = "timestamp"; - } - protected static abstract interface ContactsContract.SyncColumns implements android.provider.ContactsContract.BaseSyncColumns { field public static final java.lang.String ACCOUNT_NAME = "account_name"; field public static final java.lang.String ACCOUNT_TYPE = "account_type"; @@ -28600,8 +28536,7 @@ package android.service.carrier { method public final void notifyCarrierNetworkChange(boolean); method public android.os.IBinder onBind(android.content.Intent); method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier); - field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService"; - field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService"; + field public static final java.lang.String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService"; } public final class MessagePdu implements android.os.Parcelable { @@ -36630,10 +36565,6 @@ package android.view { method public static android.animation.Animator createCircularReveal(android.view.View, int, int, float, float); } - public abstract deprecated class ViewAssistStructure extends android.view.ViewStructure { - ctor public ViewAssistStructure(); - } - public class ViewConfiguration { ctor public deprecated ViewConfiguration(); method public static android.view.ViewConfiguration get(android.content.Context); @@ -37015,7 +36946,7 @@ package android.view { ctor public ViewStructure(); method public abstract int addChildCount(int); method public abstract void asyncCommit(); - method public abstract android.view.ViewAssistStructure asyncNewChild(int); + method public abstract android.view.ViewStructure asyncNewChild(int); method public abstract int getChildCount(); method public abstract android.os.Bundle getExtras(); method public abstract java.lang.CharSequence getHint(); @@ -37023,7 +36954,7 @@ package android.view { method public abstract int getTextSelectionEnd(); method public abstract int getTextSelectionStart(); method public abstract boolean hasExtras(); - method public abstract android.view.ViewAssistStructure newChild(int); + method public abstract android.view.ViewStructure newChild(int); method public abstract void setAccessibilityFocused(boolean); method public abstract void setActivated(boolean); method public abstract void setCheckable(boolean); diff --git a/api/removed.txt b/api/removed.txt index 2e6c685..7fc927b 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -117,6 +117,64 @@ package android.provider { field public static final deprecated java.lang.String URL = "url"; } + public static final deprecated class ContactsContract.Contacts.StreamItems { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; + } + + public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; + } + + public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns { + field public static final deprecated java.lang.String PHOTO = "photo"; + } + + protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns { + field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id"; + field public static final deprecated java.lang.String PHOTO_URI = "photo_uri"; + field public static final deprecated java.lang.String SORT_INDEX = "sort_index"; + field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id"; + field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1"; + field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2"; + field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3"; + field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4"; + } + + public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item"; + field public static final deprecated android.net.Uri CONTENT_LIMIT_URI; + field public static final deprecated android.net.Uri CONTENT_PHOTO_URI; + field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item"; + field public static final deprecated android.net.Uri CONTENT_URI; + field public static final deprecated java.lang.String MAX_ITEMS = "max_items"; + } + + public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo"; + field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo"; + field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo"; + } + + protected static abstract deprecated interface ContactsContract.StreamItemsColumns { + field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name"; + field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type"; + field public static final deprecated java.lang.String COMMENTS = "comments"; + field public static final deprecated java.lang.String CONTACT_ID = "contact_id"; + field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup"; + field public static final deprecated java.lang.String DATA_SET = "data_set"; + field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id"; + field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id"; + field public static final deprecated java.lang.String RES_ICON = "icon"; + field public static final deprecated java.lang.String RES_LABEL = "label"; + field public static final deprecated java.lang.String RES_PACKAGE = "res_package"; + field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1"; + field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2"; + field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3"; + field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4"; + field public static final deprecated java.lang.String TEXT = "text"; + field public static final deprecated java.lang.String TIMESTAMP = "timestamp"; + } + public static final class Settings.System extends android.provider.Settings.NameValueTable { field public static final java.lang.String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; field public static final java.lang.String VOLUME_ALARM = "volume_alarm"; diff --git a/api/system-current.txt b/api/system-current.txt index df18ce4..d1d4fe4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -156,10 +156,8 @@ package android { field public static final java.lang.String READ_NETWORK_USAGE_HISTORY = "android.permission.READ_NETWORK_USAGE_HISTORY"; field public static final java.lang.String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE"; field public static final java.lang.String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE"; - field public static final deprecated java.lang.String READ_PROFILE = "android.permission.READ_PROFILE"; field public static final java.lang.String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES"; field public static final java.lang.String READ_SMS = "android.permission.READ_SMS"; - field public static final deprecated java.lang.String READ_SOCIAL_STREAM = "android.permission.READ_SOCIAL_STREAM"; field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS"; field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS"; field public static final java.lang.String READ_USER_DICTIONARY = "android.permission.READ_USER_DICTIONARY"; @@ -227,10 +225,8 @@ package android { field public static final java.lang.String WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE"; field public static final java.lang.String WRITE_GSERVICES = "android.permission.WRITE_GSERVICES"; field public static final java.lang.String WRITE_MEDIA_STORAGE = "android.permission.WRITE_MEDIA_STORAGE"; - field public static final deprecated java.lang.String WRITE_PROFILE = "android.permission.WRITE_PROFILE"; field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS"; field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS"; - field public static final deprecated java.lang.String WRITE_SOCIAL_STREAM = "android.permission.WRITE_SOCIAL_STREAM"; field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS"; field public static final java.lang.String WRITE_USER_DICTIONARY = "android.permission.WRITE_USER_DICTIONARY"; field public static final java.lang.String WRITE_VOICEMAIL = "com.android.voicemail.permission.WRITE_VOICEMAIL"; @@ -247,7 +243,6 @@ package android { field public static final java.lang.String PHONE = "android.permission-group.PHONE"; field public static final java.lang.String SENSORS = "android.permission-group.SENSORS"; field public static final java.lang.String SMS = "android.permission-group.SMS"; - field public static final java.lang.String SOCIAL_INFO = "android.permission-group.SOCIAL_INFO"; field public static final java.lang.String STORAGE = "android.permission-group.STORAGE"; field public static final java.lang.String USER_DICTIONARY = "android.permission-group.USER_DICTIONARY"; } @@ -12627,7 +12622,6 @@ package android.graphics.drawable { method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; method public void invalidateSelf(); method public boolean isAutoMirrored(); - method public boolean isDither(); method public boolean isFilterBitmap(); method public boolean isStateful(); method public final boolean isVisible(); @@ -12647,7 +12641,7 @@ package android.graphics.drawable { method public void setChangingConfigurations(int); method public abstract void setColorFilter(android.graphics.ColorFilter); method public void setColorFilter(int, android.graphics.PorterDuff.Mode); - method public void setDither(boolean); + method public deprecated void setDither(boolean); method public void setFilterBitmap(boolean); method public void setHotspot(float, float); method public void setHotspotBounds(int, int, int, int); @@ -27518,10 +27512,6 @@ package android.provider { field public static final java.lang.String PHOTO_FILE_ID = "data14"; } - public static final deprecated class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; - } - protected static abstract interface ContactsContract.ContactsColumns { field public static final java.lang.String CONTACT_LAST_UPDATED_TIMESTAMP = "contact_last_updated_timestamp"; field public static final java.lang.String DISPLAY_NAME = "display_name"; @@ -27837,10 +27827,6 @@ package android.provider { field public static final java.lang.String DATA_ID = "data_id"; } - public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; - } - protected static abstract interface ContactsContract.RawContactsColumns { field public static final java.lang.String ACCOUNT_TYPE_AND_DATA_SET = "account_type_and_data_set"; field public static final java.lang.String AGGREGATION_MODE = "aggregation_mode"; @@ -27911,56 +27897,6 @@ package android.provider { field public static final android.net.Uri PROFILE_CONTENT_URI; } - public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String PHOTO = "photo"; - } - - protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id"; - field public static final deprecated java.lang.String PHOTO_URI = "photo_uri"; - field public static final deprecated java.lang.String SORT_INDEX = "sort_index"; - field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id"; - field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1"; - field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2"; - field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3"; - field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4"; - } - - public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item"; - field public static final deprecated android.net.Uri CONTENT_LIMIT_URI; - field public static final deprecated android.net.Uri CONTENT_PHOTO_URI; - field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item"; - field public static final deprecated android.net.Uri CONTENT_URI; - field public static final deprecated java.lang.String MAX_ITEMS = "max_items"; - } - - public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns { - field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo"; - field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo"; - field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo"; - } - - protected static abstract deprecated interface ContactsContract.StreamItemsColumns { - field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name"; - field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type"; - field public static final deprecated java.lang.String COMMENTS = "comments"; - field public static final deprecated java.lang.String CONTACT_ID = "contact_id"; - field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup"; - field public static final deprecated java.lang.String DATA_SET = "data_set"; - field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id"; - field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id"; - field public static final deprecated java.lang.String RES_ICON = "icon"; - field public static final deprecated java.lang.String RES_LABEL = "label"; - field public static final deprecated java.lang.String RES_PACKAGE = "res_package"; - field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1"; - field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2"; - field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3"; - field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4"; - field public static final deprecated java.lang.String TEXT = "text"; - field public static final deprecated java.lang.String TIMESTAMP = "timestamp"; - } - protected static abstract interface ContactsContract.SyncColumns implements android.provider.ContactsContract.BaseSyncColumns { field public static final java.lang.String ACCOUNT_NAME = "account_name"; field public static final java.lang.String ACCOUNT_TYPE = "account_type"; @@ -30648,8 +30584,7 @@ package android.service.carrier { method public final void notifyCarrierNetworkChange(boolean); method public android.os.IBinder onBind(android.content.Intent); method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier); - field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService"; - field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService"; + field public static final java.lang.String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService"; } public final class MessagePdu implements android.os.Parcelable { @@ -38911,10 +38846,6 @@ package android.view { method public static android.animation.Animator createCircularReveal(android.view.View, int, int, float, float); } - public abstract deprecated class ViewAssistStructure extends android.view.ViewStructure { - ctor public ViewAssistStructure(); - } - public class ViewConfiguration { ctor public deprecated ViewConfiguration(); method public static android.view.ViewConfiguration get(android.content.Context); @@ -39296,7 +39227,7 @@ package android.view { ctor public ViewStructure(); method public abstract int addChildCount(int); method public abstract void asyncCommit(); - method public abstract android.view.ViewAssistStructure asyncNewChild(int); + method public abstract android.view.ViewStructure asyncNewChild(int); method public abstract int getChildCount(); method public abstract android.os.Bundle getExtras(); method public abstract java.lang.CharSequence getHint(); @@ -39304,7 +39235,7 @@ package android.view { method public abstract int getTextSelectionEnd(); method public abstract int getTextSelectionStart(); method public abstract boolean hasExtras(); - method public abstract android.view.ViewAssistStructure newChild(int); + method public abstract android.view.ViewStructure newChild(int); method public abstract void setAccessibilityFocused(boolean); method public abstract void setActivated(boolean); method public abstract void setCheckable(boolean); diff --git a/api/system-removed.txt b/api/system-removed.txt index 2e6c685..7fc927b 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -117,6 +117,64 @@ package android.provider { field public static final deprecated java.lang.String URL = "url"; } + public static final deprecated class ContactsContract.Contacts.StreamItems { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; + } + + public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items"; + } + + public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns { + field public static final deprecated java.lang.String PHOTO = "photo"; + } + + protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns { + field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id"; + field public static final deprecated java.lang.String PHOTO_URI = "photo_uri"; + field public static final deprecated java.lang.String SORT_INDEX = "sort_index"; + field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id"; + field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1"; + field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2"; + field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3"; + field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4"; + } + + public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item"; + field public static final deprecated android.net.Uri CONTENT_LIMIT_URI; + field public static final deprecated android.net.Uri CONTENT_PHOTO_URI; + field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item"; + field public static final deprecated android.net.Uri CONTENT_URI; + field public static final deprecated java.lang.String MAX_ITEMS = "max_items"; + } + + public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns { + field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo"; + field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo"; + field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo"; + } + + protected static abstract deprecated interface ContactsContract.StreamItemsColumns { + field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name"; + field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type"; + field public static final deprecated java.lang.String COMMENTS = "comments"; + field public static final deprecated java.lang.String CONTACT_ID = "contact_id"; + field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup"; + field public static final deprecated java.lang.String DATA_SET = "data_set"; + field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id"; + field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id"; + field public static final deprecated java.lang.String RES_ICON = "icon"; + field public static final deprecated java.lang.String RES_LABEL = "label"; + field public static final deprecated java.lang.String RES_PACKAGE = "res_package"; + field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1"; + field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2"; + field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3"; + field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4"; + field public static final deprecated java.lang.String TEXT = "text"; + field public static final deprecated java.lang.String TIMESTAMP = "timestamp"; + } + public static final class Settings.System extends android.provider.Settings.NameValueTable { field public static final java.lang.String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; field public static final java.lang.String VOLUME_ALARM = "volume_alarm"; diff --git a/core/java/android/app/assist/AssistStructure.java b/core/java/android/app/assist/AssistStructure.java index 1a04895..284dfd6 100644 --- a/core/java/android/app/assist/AssistStructure.java +++ b/core/java/android/app/assist/AssistStructure.java @@ -15,7 +15,7 @@ import android.os.SystemClock; import android.text.TextUtils; import android.util.Log; import android.view.View; -import android.view.ViewAssistStructure; +import android.view.ViewStructure; import android.view.ViewRootImpl; import android.view.WindowManager; import android.view.WindowManagerGlobal; @@ -616,7 +616,7 @@ public class AssistStructure implements Parcelable { } } - static class ViewNodeBuilder extends ViewAssistStructure { + static class ViewNodeBuilder extends ViewStructure { final AssistStructure mAssist; final ViewNode mNode; final boolean mAsync; @@ -827,14 +827,14 @@ public class AssistStructure implements Parcelable { } @Override - public ViewAssistStructure newChild(int index) { + public ViewStructure newChild(int index) { ViewNode node = new ViewNode(); mNode.mChildren[index] = node; return new ViewNodeBuilder(mAssist, node, false); } @Override - public ViewAssistStructure asyncNewChild(int index) { + public ViewStructure asyncNewChild(int index) { synchronized (mAssist) { ViewNode node = new ViewNode(); mNode.mChildren[index] = node; @@ -849,7 +849,7 @@ public class AssistStructure implements Parcelable { synchronized (mAssist) { if (!mAsync) { throw new IllegalStateException("Child " + this - + " was not created with ViewAssistStructure.asyncNewChild"); + + " was not created with ViewStructure.asyncNewChild"); } if (!mAssist.mPendingAsyncChildren.remove(this)) { throw new IllegalStateException("Child " + this + " already committed"); diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 4e7da48..04dbff2 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -109,6 +109,14 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { public static final int FLAG_COSTS_MONEY = 1<<0; /** + * Flag for {@link #protectionLevel}, corresponding + * to the <code>hide</code> value of + * {@link android.R.attr#permissionFlags}. + * @hide + */ + public static final int PROTECTION_FLAG_HIDE = 1<<1; + + /** * Additional flags about this permission as given by * {@link android.R.attr#permissionFlags}. */ diff --git a/core/java/android/hardware/camera2/DngCreator.java b/core/java/android/hardware/camera2/DngCreator.java index 70afe5b..57a080b 100644 --- a/core/java/android/hardware/camera2/DngCreator.java +++ b/core/java/android/hardware/camera2/DngCreator.java @@ -284,6 +284,8 @@ public final class DngCreator implements AutoCloseable { * {@code offset + 2 * width * height)} bytes. The width and height of * the input are taken from the width and height set in the {@link DngCreator} metadata tags, * and will typically be equal to the width and height of + * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE}. Prior to + * API level 23, this was always the same as * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE}. * The pixel layout in the input is determined from the reported color filter arrangement (CFA) * set in {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT}. If insufficient @@ -332,6 +334,8 @@ public final class DngCreator implements AutoCloseable { * {@code offset + 2 * width * height)} bytes. The width and height of * the input are taken from the width and height set in the {@link DngCreator} metadata tags, * and will typically be equal to the width and height of + * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE}. Prior to + * API level 23, this was always the same as * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE}. * The pixel layout in the input is determined from the reported color filter arrangement (CFA) * set in {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT}. If insufficient diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index aebe7f1..8ce1cbf 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1743,6 +1743,9 @@ public final class ContactsContract { * * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated public static final class StreamItems implements StreamItemsColumns { @@ -2831,6 +2834,9 @@ public final class ContactsContract { * * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated public static final class StreamItems implements BaseColumns, StreamItemsColumns { @@ -3267,6 +3273,9 @@ public final class ContactsContract { * * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated public static final class StreamItems implements BaseColumns, StreamItemsColumns { @@ -3365,6 +3374,9 @@ public final class ContactsContract { * * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated public static final class StreamItemPhotos @@ -3415,6 +3427,9 @@ public final class ContactsContract { * @see ContactsContract.StreamItems * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated protected interface StreamItemsColumns { @@ -3805,6 +3820,9 @@ public final class ContactsContract { * * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated public static final class StreamItemPhotos implements BaseColumns, StreamItemPhotosColumns { @@ -3843,6 +3861,9 @@ public final class ContactsContract { * @see ContactsContract.StreamItemPhotos * @deprecated - Do not use. This will not be supported in the future. In the future, * cursors returned from related queries will be empty. + * + * @hide + * @removed */ @Deprecated protected interface StreamItemPhotosColumns { diff --git a/core/java/android/service/carrier/CarrierService.java b/core/java/android/service/carrier/CarrierService.java index 225e70d..455e1b2 100644 --- a/core/java/android/service/carrier/CarrierService.java +++ b/core/java/android/service/carrier/CarrierService.java @@ -29,8 +29,8 @@ import com.android.internal.telephony.ITelephonyRegistry; * <p> * To extend this class, you must declare the service in your manifest file to require the * {@link android.Manifest.permission#BIND_CARRIER_SERVICES} permission and include an intent - * filter with the {@link #CONFIG_SERVICE_INTERFACE} action if the service exposes carrier config - * and the {@link #BIND_SERVICE_INTERFACE} action if the service should have a long-lived binding. + * filter with the {@link #CARRIER_SERVICE_INTERFACE}. If the service should have a long-lived + * binding, set android.service.carrier.LONG_LIVED_BINDING to true in the service's metadata. * For example: * </p> * @@ -39,16 +39,16 @@ import com.android.internal.telephony.ITelephonyRegistry; * android:label="@string/service_name" * android:permission="android.permission.BIND_CARRIER_SERVICES"> * <intent-filter> - * <action android:name="android.service.carrier.ConfigService" /> - * <action android:name="android.service.carrier.BindService" /> + * <action android:name="android.service.carrier.CarrierService" /> * </intent-filter> + * <meta-data android:name="android.service.carrier.LONG_LIVED_BINDING" + * android:value="true" /> * </service> * }</pre> */ public abstract class CarrierService extends Service { - public static final String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService"; - public static final String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService"; + public static final String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService"; private static ITelephonyRegistry sRegistry; @@ -127,13 +127,7 @@ public abstract class CarrierService extends Service { @Override @CallSuper public IBinder onBind(Intent intent) { - switch (intent.getAction()) { - case CONFIG_SERVICE_INTERFACE: - case BIND_SERVICE_INTERFACE: - return mStubWrapper; - default: - return null; - } + return mStubWrapper; } /** diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 92dae2e..502a6bc 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -21041,6 +21041,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (sUseBrokenMakeMeasureSpec) { return size + mode; } else { + if (size < 0) { + throw new IllegalArgumentException("Measure spec size must be >= 0"); + } return (size & ~MODE_MASK) | (mode & MODE_MASK); } } diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java index 3572f1e..9ab0ace 100644 --- a/core/java/android/view/ViewStructure.java +++ b/core/java/android/view/ViewStructure.java @@ -221,7 +221,7 @@ public abstract class ViewStructure { * children at <var>index</var>. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ - public abstract ViewAssistStructure newChild(int index); + public abstract ViewStructure newChild(int index); /** * Like {@link #newChild}, but allows the caller to asynchronously populate the returned @@ -231,7 +231,7 @@ public abstract class ViewStructure { * population is done. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ - public abstract ViewAssistStructure asyncNewChild(int index); + public abstract ViewStructure asyncNewChild(int index); /** * Call when done populating a {@link ViewStructure} returned by diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index 15ed5bd..0abd200 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -23,6 +23,8 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.*; +import android.animation.Animator; +import android.animation.ObjectAnimator; import android.app.ActivityManagerNative; import android.app.SearchManager; import android.os.UserHandle; @@ -2216,6 +2218,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private OnPreDrawListener mFloatingToolbarPreDrawListener; private View mFloatingActionModeOriginatingView; private FloatingToolbar mFloatingToolbar; + private ObjectAnimator mFadeAnim; // View added at runtime to draw under the status bar area private View mStatusGuard; @@ -3345,6 +3348,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } private ActionMode createStandaloneActionMode(ActionMode.Callback callback) { + endOnGoingFadeAnimation(); cleanupPrimaryActionMode(); if (mPrimaryActionModeView == null) { if (isFloating()) { @@ -3384,6 +3388,32 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mPrimaryActionModePopup.showAtLocation( mPrimaryActionModeView.getApplicationWindowToken(), Gravity.TOP | Gravity.FILL_HORIZONTAL, 0, 0); + endOnGoingFadeAnimation(); + mFadeAnim = ObjectAnimator.ofFloat(mPrimaryActionModeView, View.ALPHA, + 0f, 1f); + mFadeAnim.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + mPrimaryActionModeView.setVisibility(VISIBLE); + } + + @Override + public void onAnimationEnd(Animator animation) { + mPrimaryActionModeView.setAlpha(1f); + mFadeAnim = null; + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + mFadeAnim.start(); } }; } else { @@ -3404,13 +3434,44 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return null; } + private void endOnGoingFadeAnimation() { + if (mFadeAnim != null) { + mFadeAnim.end(); + } + } + private void setHandledPrimaryActionMode(ActionMode mode) { + endOnGoingFadeAnimation(); mPrimaryActionMode = mode; mPrimaryActionMode.invalidate(); mPrimaryActionModeView.initForMode(mPrimaryActionMode); - mPrimaryActionModeView.setVisibility(View.VISIBLE); if (mPrimaryActionModePopup != null) { post(mShowPrimaryActionModePopup); + } else { + mFadeAnim = ObjectAnimator.ofFloat(mPrimaryActionModeView, View.ALPHA, 0f, 1f); + mFadeAnim.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + mPrimaryActionModeView.setVisibility(View.VISIBLE); + } + + @Override + public void onAnimationEnd(Animator animation) { + mPrimaryActionModeView.setAlpha(1f); + mFadeAnim = null; + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + mFadeAnim.start(); } mPrimaryActionModeView.sendAccessibilityEvent( AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); @@ -3473,13 +3534,40 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mode == mPrimaryActionMode) { if (mPrimaryActionModePopup != null) { removeCallbacks(mShowPrimaryActionModePopup); - mPrimaryActionModePopup.dismiss(); - } else if (mPrimaryActionModeView != null) { - mPrimaryActionModeView.setVisibility(GONE); } if (mPrimaryActionModeView != null) { - mPrimaryActionModeView.removeAllViews(); + endOnGoingFadeAnimation(); + mFadeAnim = ObjectAnimator.ofFloat(mPrimaryActionModeView, View.ALPHA, + 1f, 0f); + mFadeAnim.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + + } + + @Override + public void onAnimationEnd(Animator animation) { + mPrimaryActionModeView.setVisibility(GONE); + if (mPrimaryActionModePopup != null) { + mPrimaryActionModePopup.dismiss(); + } + mPrimaryActionModeView.removeAllViews(); + mFadeAnim = null; + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + mFadeAnim.start(); } + mPrimaryActionMode = null; } else if (mode == mFloatingActionMode) { cleanupFloatingActionModeViews(); diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp index 9b5fb3a..2116da0 100644 --- a/core/jni/android_graphics_Canvas.cpp +++ b/core/jni/android_graphics_Canvas.cpp @@ -175,24 +175,24 @@ static jboolean quickRejectPath(JNIEnv* env, jobject, jlong canvasHandle, jlong static jboolean clipRect(JNIEnv*, jobject, jlong canvasHandle, jfloat l, jfloat t, jfloat r, jfloat b, jint opHandle) { SkRegion::Op op = static_cast<SkRegion::Op>(opHandle); - bool emptyClip = get_canvas(canvasHandle)->clipRect(l, t, r, b, op); - return emptyClip ? JNI_FALSE : JNI_TRUE; + bool nonEmptyClip = get_canvas(canvasHandle)->clipRect(l, t, r, b, op); + return nonEmptyClip ? JNI_TRUE : JNI_FALSE; } static jboolean clipPath(JNIEnv* env, jobject, jlong canvasHandle, jlong pathHandle, jint opHandle) { SkPath* path = reinterpret_cast<SkPath*>(pathHandle); SkRegion::Op op = static_cast<SkRegion::Op>(opHandle); - bool emptyClip = get_canvas(canvasHandle)->clipPath(path, op); - return emptyClip ? JNI_FALSE : JNI_TRUE; + bool nonEmptyClip = get_canvas(canvasHandle)->clipPath(path, op); + return nonEmptyClip ? JNI_TRUE : JNI_FALSE; } static jboolean clipRegion(JNIEnv* env, jobject, jlong canvasHandle, jlong deviceRgnHandle, jint opHandle) { SkRegion* deviceRgn = reinterpret_cast<SkRegion*>(deviceRgnHandle); SkRegion::Op op = static_cast<SkRegion::Op>(opHandle); - bool emptyClip = get_canvas(canvasHandle)->clipRegion(deviceRgn, op); - return emptyClip ? JNI_FALSE : JNI_TRUE; + bool nonEmptyClip = get_canvas(canvasHandle)->clipRegion(deviceRgn, op); + return nonEmptyClip ? JNI_TRUE : JNI_FALSE; } static void drawColor(JNIEnv* env, jobject, jlong canvasHandle, jint color, jint modeHandle) { diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp index 7d8d151..995d39f 100644 --- a/core/jni/android_hardware_camera2_DngCreator.cpp +++ b/core/jni/android_hardware_camera2_DngCreator.cpp @@ -18,6 +18,8 @@ #define LOG_TAG "DngCreator_JNI" #include <inttypes.h> #include <string.h> +#include <algorithm> +#include <memory> #include <utils/Log.h> #include <utils/Errors.h> @@ -25,7 +27,6 @@ #include <utils/RefBase.h> #include <utils/Vector.h> #include <cutils/properties.h> - #include <system/camera_metadata.h> #include <camera/CameraMetadata.h> #include <img_utils/DngUtils.h> @@ -37,15 +38,6 @@ #include <img_utils/StripSource.h> #include "core_jni_helpers.h" -#include <utils/Log.h> -#include <utils/Errors.h> -#include <utils/StrongPointer.h> -#include <utils/RefBase.h> -#include <utils/Vector.h> -#include <cutils/properties.h> - -#include <string.h> -#include <inttypes.h> #include "android_runtime/AndroidRuntime.h" #include "android_runtime/android_hardware_camera2_CameraMetadata.h" @@ -63,6 +55,14 @@ using namespace img_utils; return; \ } +#define BAIL_IF_INVALID_R(expr, jnienv, tagId, writer) \ + if ((expr) != OK) { \ + jniThrowExceptionFmt(jnienv, "java/lang/IllegalArgumentException", \ + "Invalid metadata for tag %s (%x)", (writer)->getTagName(tagId), (tagId)); \ + return -1; \ + } + + #define BAIL_IF_EMPTY(entry, jnienv, tagId, writer) \ if (entry.count == 0) { \ jniThrowExceptionFmt(jnienv, "java/lang/IllegalArgumentException", \ @@ -111,11 +111,14 @@ enum { class NativeContext : public LightRefBase<NativeContext> { public: - NativeContext(); + NativeContext(const CameraMetadata& characteristics, const CameraMetadata& result); virtual ~NativeContext(); TiffWriter* getWriter(); + std::shared_ptr<const CameraMetadata> getCharacteristics() const; + std::shared_ptr<const CameraMetadata> getResult() const; + uint32_t getThumbnailWidth(); uint32_t getThumbnailHeight(); const uint8_t* getThumbnail(); @@ -125,11 +128,16 @@ public: private: Vector<uint8_t> mCurrentThumbnail; TiffWriter mWriter; + std::shared_ptr<CameraMetadata> mCharacteristics; + std::shared_ptr<CameraMetadata> mResult; uint32_t mThumbnailWidth; uint32_t mThumbnailHeight; }; -NativeContext::NativeContext() : mThumbnailWidth(0), mThumbnailHeight(0) {} +NativeContext::NativeContext(const CameraMetadata& characteristics, const CameraMetadata& result) : + mCharacteristics(std::make_shared<CameraMetadata>(characteristics)), + mResult(std::make_shared<CameraMetadata>(result)), mThumbnailWidth(0), + mThumbnailHeight(0) {} NativeContext::~NativeContext() {} @@ -137,6 +145,14 @@ TiffWriter* NativeContext::getWriter() { return &mWriter; } +std::shared_ptr<const CameraMetadata> NativeContext::getCharacteristics() const { + return mCharacteristics; +} + +std::shared_ptr<const CameraMetadata> NativeContext::getResult() const { + return mResult; +} + uint32_t NativeContext::getThumbnailWidth() { return mThumbnailWidth; } @@ -626,25 +642,92 @@ uint32_t DirectStripSource::getIfd() const { // End of DirectStripSource // ---------------------------------------------------------------------------- -static bool validateDngHeader(JNIEnv* env, TiffWriter* writer, jint width, jint height) { - bool hasThumbnail = writer->hasIfd(TIFF_IFD_SUB1); +/** + * Given a buffer crop rectangle relative to the pixel array size, and the active array crop + * rectangle for the camera characteristics, set the default crop rectangle in the TiffWriter + * relative to the buffer crop rectangle origin. + */ +static status_t calculateAndSetCrop(JNIEnv* env, const CameraMetadata& characteristics, + uint32_t bufXMin, uint32_t bufYMin, uint32_t bufWidth, uint32_t bufHeight, + TiffWriter* writer) { + + camera_metadata_ro_entry entry = + characteristics.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE); + uint32_t xmin = static_cast<uint32_t>(entry.data.i32[0]); + uint32_t ymin = static_cast<uint32_t>(entry.data.i32[1]); + uint32_t width = static_cast<uint32_t>(entry.data.i32[2]); + uint32_t height = static_cast<uint32_t>(entry.data.i32[3]); + + uint32_t aLeft = xmin; + uint32_t aTop = ymin; + uint32_t aRight = xmin + width; + uint32_t aBottom = ymin + height; + + const uint32_t margin = 8; // Default margin recommended by Adobe for interpolation. + + uint32_t bLeft = bufXMin + margin; + uint32_t bTop = bufYMin + margin; + uint32_t bRight = bufXMin + bufWidth - margin; + uint32_t bBottom = bufYMin + bufHeight - margin; + + uint32_t defaultCropOrigin[] = {std::max(aLeft, bLeft), std::max(aTop, bTop)}; + uint32_t defaultCropSize[] = {std::min(aRight, bRight) - defaultCropOrigin[0], + std::min(aBottom, bBottom) - defaultCropOrigin[1]}; + + BAIL_IF_INVALID_R(writer->addEntry(TAG_DEFAULTCROPORIGIN, 2, defaultCropOrigin, + TIFF_IFD_0), env, TAG_DEFAULTCROPORIGIN, writer); + BAIL_IF_INVALID_R(writer->addEntry(TAG_DEFAULTCROPSIZE, 2, defaultCropSize, + TIFF_IFD_0), env, TAG_DEFAULTCROPSIZE, writer); + + return OK; +} +static bool validateDngHeader(JNIEnv* env, TiffWriter* writer, + const CameraMetadata& characteristics, jint width, jint height) { // TODO: handle lens shading map, etc. conversions for other raw buffer sizes. - uint32_t metadataWidth = *(writer->getEntry(TAG_IMAGEWIDTH, (hasThumbnail) ? TIFF_IFD_SUB1 : - TIFF_IFD_0)->getData<uint32_t>()); - uint32_t metadataHeight = *(writer->getEntry(TAG_IMAGELENGTH, (hasThumbnail) ? TIFF_IFD_SUB1 : - TIFF_IFD_0)->getData<uint32_t>()); + if (width <= 0) { + jniThrowExceptionFmt(env, "java/lang/IllegalArgumentException", \ + "Image width %d is invalid", width); + return false; + } - if (width < 0 || metadataWidth != static_cast<uint32_t>(width)) { + if (height <= 0) { jniThrowExceptionFmt(env, "java/lang/IllegalArgumentException", \ - "Metadata width %d doesn't match image width %d", metadataWidth, width); + "Image height %d is invalid", height); return false; } - if (height < 0 || metadataHeight != static_cast<uint32_t>(height)) { + camera_metadata_ro_entry preCorrectionEntry = + characteristics.find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE); + camera_metadata_ro_entry pixelArrayEntry = + characteristics.find(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE); + + int pWidth = static_cast<int>(pixelArrayEntry.data.i32[0]); + int pHeight = static_cast<int>(pixelArrayEntry.data.i32[1]); + int cWidth = static_cast<int>(preCorrectionEntry.data.i32[2]); + int cHeight = static_cast<int>(preCorrectionEntry.data.i32[3]); + + bool matchesPixelArray = (pWidth == width && pHeight == height); + bool matchesPreCorrectionArray = (cWidth == width && cHeight == height); + + if (matchesPixelArray) { + if (calculateAndSetCrop(env, characteristics, 0, 0, static_cast<uint32_t>(pWidth), + static_cast<uint32_t>(pHeight), writer) != OK) { + return false; + } + } else if (matchesPreCorrectionArray) { + if (calculateAndSetCrop(env, characteristics, + static_cast<uint32_t>(preCorrectionEntry.data.i32[0]), + static_cast<uint32_t>(preCorrectionEntry.data.i32[1]), + static_cast<uint32_t>(preCorrectionEntry.data.i32[2]), + static_cast<uint32_t>(preCorrectionEntry.data.i32[3]), writer) != OK) { + return false; + } + } else { jniThrowExceptionFmt(env, "java/lang/IllegalArgumentException", \ - "Metadata height %d doesn't match image height %d", - metadataHeight, height); + "Image dimensions (w=%d,h=%d) are invalid, must match either the pixel " + "array size (w=%d, h=%d) or the pre-correction array size (w=%d, h=%d)", + width, height, pWidth, pHeight, cWidth, cHeight); return false; } @@ -854,7 +937,7 @@ static void DngCreator_init(JNIEnv* env, jobject thiz, jobject characteristicsPt return; } - sp<NativeContext> nativeContext = new NativeContext(); + sp<NativeContext> nativeContext = new NativeContext(characteristics, results); TiffWriter* writer = nativeContext->getWriter(); writer->addIfd(TIFF_IFD_0); @@ -906,7 +989,7 @@ static void DngCreator_init(JNIEnv* env, jobject thiz, jobject characteristicsPt { // Set dimensions camera_metadata_entry entry = - characteristics.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE); + characteristics.find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE); BAIL_IF_EMPTY(entry, env, TAG_IMAGEWIDTH, writer); uint32_t width = static_cast<uint32_t>(entry.data.i32[2]); uint32_t height = static_cast<uint32_t>(entry.data.i32[3]); @@ -1356,16 +1439,16 @@ static void DngCreator_init(JNIEnv* env, jobject thiz, jobject characteristicsPt } { - // Setup default crop + crop origin tags - uint32_t margin = 8; // Default margin recommended by Adobe for interpolation. - uint32_t dimensionLimit = 128; // Smallest image dimension crop margin from. - if (imageWidth >= dimensionLimit && imageHeight >= dimensionLimit) { - uint32_t defaultCropOrigin[] = {margin, margin}; - uint32_t defaultCropSize[] = {imageWidth - 2 * margin, imageHeight - 2 * margin}; - BAIL_IF_INVALID(writer->addEntry(TAG_DEFAULTCROPORIGIN, 2, defaultCropOrigin, - TIFF_IFD_0), env, TAG_DEFAULTCROPORIGIN, writer); - BAIL_IF_INVALID(writer->addEntry(TAG_DEFAULTCROPSIZE, 2, defaultCropSize, - TIFF_IFD_0), env, TAG_DEFAULTCROPSIZE, writer); + // Set dimensions + camera_metadata_entry entry = + characteristics.find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE); + BAIL_IF_EMPTY(entry, env, TAG_DEFAULTCROPSIZE, writer); + uint32_t xmin = static_cast<uint32_t>(entry.data.i32[0]); + uint32_t ymin = static_cast<uint32_t>(entry.data.i32[1]); + uint32_t width = static_cast<uint32_t>(entry.data.i32[2]); + uint32_t height = static_cast<uint32_t>(entry.data.i32[3]); + if (calculateAndSetCrop(env, characteristics, xmin, ymin, width, height, writer) != OK) { + return; } } @@ -1874,7 +1957,7 @@ static void DngCreator_nativeWriteImage(JNIEnv* env, jobject thiz, jobject outSt } // Validate DNG header - if (!validateDngHeader(env, writer, width, height)) { + if (!validateDngHeader(env, writer, *(context->getCharacteristics()), width, height)) { return; } @@ -1978,7 +2061,7 @@ static void DngCreator_nativeWriteInputStream(JNIEnv* env, jobject thiz, jobject } // Validate DNG header - if (!validateDngHeader(env, writer, width, height)) { + if (!validateDngHeader(env, writer, *(context->getCharacteristics()), width, height)) { return; } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index f9b41a9..bb52609 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -349,20 +349,6 @@ android:description="@string/permdesc_writeContacts" android:protectionLevel="dangerous" /> - <!-- @deprecated No longer enforced. This was last enforced in API version 22. --> - <permission android:name="android.permission.READ_PROFILE" - android:permissionGroup="android.permission-group.CONTACTS" - android:label="@string/permlab_readProfile" - android:description="@string/permdesc_readProfile" - android:protectionLevel="dangerous" /> - - <!-- @deprecated No longer enforced. This was last enforced in API version 22. --> - <permission android:name="android.permission.WRITE_PROFILE" - android:permissionGroup="android.permission-group.CONTACTS" - android:label="@string/permlab_writeProfile" - android:description="@string/permdesc_writeProfile" - android:protectionLevel="dangerous" /> - <!-- ====================================================================== --> <!-- Permissions for accessing user's calendar --> <!-- ====================================================================== --> @@ -511,42 +497,6 @@ android:description="@string/permdesc_sdcardWrite" android:protectionLevel="dangerous" /> - <!-- =============================================================== --> - <!-- Permissions for accessing social info --> - <!-- =============================================================== --> - <eat-comment /> - - <!-- Used for permissions that provide access to the user's social connections, - such as contacts, call logs, social stream, etc. This includes - both reading and writing of this data (which should generally be - expressed as two distinct permissions). --> - - <permission-group android:name="android.permission-group.SOCIAL_INFO" - android:label="@string/permgrouplab_socialInfo" - android:icon="@drawable/perm_group_social_info" - android:description="@string/permgroupdesc_socialInfo" - android:permissionGroupFlags="personalInfo" - android:priority="1200" /> - - <!-- Allows an application to read from the user's social stream. - @deprecated This functionality will be unsupported in the future; cursors returned - will be empty. Please do not use. --> - <permission android:name="android.permission.READ_SOCIAL_STREAM" - android:permissionGroup="android.permission-group.SOCIAL_INFO" - android:protectionLevel="dangerous" - android:label="@string/permlab_readSocialStream" - android:description="@string/permdesc_readSocialStream" /> - - <!-- Allows an application to write (but not read) the user's - social stream data. - @deprecated This functionality will be unsupported in the future; cursors returned - will be empty. Please do not use. --> - <permission android:name="android.permission.WRITE_SOCIAL_STREAM" - android:permissionGroup="android.permission-group.SOCIAL_INFO" - android:protectionLevel="dangerous" - android:label="@string/permlab_writeSocialStream" - android:description="@string/permdesc_writeSocialStream" /> - <!-- ====================================================================== --> <!-- Permissions for accessing the device location --> <!-- ====================================================================== --> @@ -741,7 +691,31 @@ android:protectionLevel="normal" /> <!-- ====================================================================== --> - <!-- INSTALLTIME PERMISSIONS --> + <!-- REMOVED PERMISSIONS --> + <!-- ====================================================================== --> + + <!-- @hide We need to keep this around for backwards compatibility --> + <permission android:name="android.permission.READ_PROFILE" + android:protectionLevel="normal" + android:permissionFlags="hide"/> + + <!-- @hide We need to keep this around for backwards compatibility --> + <permission android:name="android.permission.WRITE_PROFILE" + android:protectionLevel="normal" + android:permissionFlags="hide"/> + + <!-- @hide We need to keep this around for backwards compatibility --> + <permission android:name="android.permission.READ_SOCIAL_STREAM" + android:protectionLevel="normal" + android:permissionFlags="hide"/> + + <!-- @hide We need to keep this around for backwards compatibility --> + <permission android:name="android.permission.WRITE_SOCIAL_STREAM" + android:protectionLevel="normal" + android:permissionFlags="hide"/> + + <!-- ====================================================================== --> + <!-- INSTALL PERMISSIONS --> <!-- ====================================================================== --> <!-- ================================== --> @@ -2090,7 +2064,7 @@ <p>Declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application. --> <permission android:name="android.permission.PACKAGE_USAGE_STATS" - android:protectionLevel="signature|development|appop" /> + android:protectionLevel="signature|system|development|appop" /> <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" /> <!-- @hide Allows an application to change the app idle state of an app. diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index f31c1d6..3cb4d7c 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -231,6 +231,9 @@ may cost the user money. Such permissions may be highlighted when shown to the user with this additional information. --> <flag name="costsMoney" value="0x0001" /> + <!-- Additional flag from base permission type: this permission is hidden + and should not show in the UI. --> + <flag name="hide" value="0x2" /> </attr> <!-- Specified the name of a group that this permission is associated diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index ea0d349..0e5df50 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -554,11 +554,6 @@ <string name="permgroupdesc_location">access this device\'s location</string> <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. --> - <string name="permgrouplab_socialInfo">Your social information</string> - <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. --> - <string name="permgroupdesc_socialInfo">Direct access to information about your contacts and social connections.</string> - - <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. --> <string name="permgrouplab_calendar">Calendar</string> <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. --> <string name="permgroupdesc_calendar">access your calendar</string> @@ -901,23 +896,6 @@ <string name="permdesc_writeCallLog" product="default">Allows the app to modify your phone\'s call log, including data about incoming and outgoing calls. Malicious apps may use this to erase or modify your call log.</string> - - <!-- Title of the read profile permission, listed so the user can decide whether to allow the application to read the user's personal profile data. [CHAR LIMIT=30] --> - <string name="permlab_readProfile">read your own contact card</string> - <!-- Description of the read profile permission, listed so the user can decide whether to allow the application to read the user's personal profile data. [CHAR LIMIT=NONE] --> - <string name="permdesc_readProfile" product="default">Allows the app to read - personal profile information stored on your device, such as your name and - contact information. This means the app can identify you and may send your - profile information to others.</string> - - <!-- Title of the write profile permission, listed so the user can decide whether to allow the application to write to the user's personal profile data. [CHAR LIMIT=30] --> - <string name="permlab_writeProfile">modify your own contact card</string> - <!-- Description of the write profile permission, listed so the user can decide whether to allow the application to write to the user's personal profile data. [CHAR LIMIT=NONE] --> - <string name="permdesc_writeProfile" product="default">Allows the app to - change or add to personal profile information stored on your device, such - as your name and contact information. This means the app can identify you - and may send your profile information to others.</string> - <!-- Title of the body sensors permission, listed so the user can decide whether to allow the application to access body sensor data. [CHAR LIMIT=30] --> <string name="permlab_bodySensors">body sensors (like heart rate monitors) </string> @@ -925,23 +903,6 @@ <string name="permdesc_bodySensors" product="default">Allows the app to access data from sensors that monitor your physical condition, such as your heart rate.</string> - <!-- Title of the read social stream permission, listed so the user can decide whether to allow the application to read information from the user's social stream. [CHAR LIMIT=30] --> - <string name="permlab_readSocialStream" product="default">read your social stream</string> - <string name="permdesc_readSocialStream" product="default">Allows the app - to access and sync social updates from you and your friends. Be careful - when sharing information -- this allows the app to read communications - between you and your friends on social networks, regardless of - confidentiality. Note: this permission may not be enforced on all social - networks.</string> - - <!-- Title of the write social stream permission, listed so the user can decide whether to allow the application to write information to the user's social stream. [CHAR LIMIT=30] --> - <string name="permlab_writeSocialStream" product="default">write to your social stream</string> - <string name="permdesc_writeSocialStream" product="default">Allows the app to - display social updates from your friends. Be careful when sharing - information -- this allows the app to produce messages that may appear to - come from a friend. Note: this permission may not be enforced on all social - networks.</string> - <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permlab_readCalendar">read calendar events plus confidential information</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd index 5fa8547..4c2ccb9 100644 --- a/docs/html/about/versions/android-4.0.3.jd +++ b/docs/html/about/versions/android-4.0.3.jd @@ -78,19 +78,19 @@ can now sync that data with each of the user’s contacts, providing items in a stream along with photos for each.</p> <p>The database table that contains an individual contact’s social stream is -defined by {@link android.provider.ContactsContract.StreamItems}, the Uri for +defined by android.provider.ContactsContract.StreamItems, the Uri for which is nested within the {@link android.provider.ContactsContract.RawContacts} directory to which the stream items belong. Each social stream table includes several columns for metadata about each stream item, such as an icon representing the source (an avatar), a label for the item, the primary text content, comments about the item (such as responses from other people), and more. Photos associated with a stream are stored in another table, defined by -{@link android.provider.ContactsContract.StreamItemPhotos}, which is available -as a sub-directory of the {@link android.provider.ContactsContract.StreamItems} +android.provider.ContactsContract.StreamItemPhotos, which is available +as a sub-directory of the android.provider.ContactsContract.StreamItems Uri.</p> -<p>See {@link android.provider.ContactsContract.StreamItems} and -{@link android.provider.ContactsContract.StreamItemPhotos} for more information.</p> +<p>See android.provider.ContactsContract.StreamItems and +android.provider.ContactsContract.StreamItemPhotos for more information.</p> <p>To read or write social stream items for a contact, an application must request permission from the user by declaring <code><uses-permission @@ -272,8 +272,8 @@ let you check and manage video stabilization for a {@link android.hardware.Camer <p>The following are new permissions:</p> <ul> -<li>{@link android.Manifest.permission#READ_SOCIAL_STREAM} and -{@link android.Manifest.permission#WRITE_SOCIAL_STREAM}: Allow a sync +<li>android.Manifest.permission#READ_SOCIAL_STREAM and +android.Manifest.permission#WRITE_SOCIAL_STREAM: Allow a sync adapter to read and write social stream data to a contact in the shared Contacts Provider.</li> </ul> diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd index 6c4ccb4..cc1d1c7 100644 --- a/docs/html/about/versions/android-4.0.jd +++ b/docs/html/about/versions/android-4.0.jd @@ -108,9 +108,9 @@ android.provider.ContactsContract.RawContacts} Uri; instead, you must add a prof the table at {@link android.provider.ContactsContract.Profile#CONTENT_RAW_CONTACTS_URI}. Raw contacts in this table are then aggregated into the single user-visible profile labeled "Me".</p> -<p>Adding a new raw contact for the profile requires the {@link -android.Manifest.permission#WRITE_PROFILE} permission. Likewise, in order to read from the profile -table, you must request the {@link android.Manifest.permission#READ_PROFILE} permission. However, +<p>Adding a new raw contact for the profile requires the +android.Manifest.permission#WRITE_PROFILE permission. Likewise, in order to read from the profile +table, you must request the android.Manifest.permission#READ_PROFILE permission. However, most apps should not need to read the user profile, even when contributing data to the profile. Reading the user profile is a sensitive permission and you should expect users to be skeptical of apps that request it.</p> @@ -1638,9 +1638,9 @@ messages to the device.</li> android.service.textservice.SpellCheckerService} must require this permission for itself.</li> <li>{@link android.Manifest.permission#BIND_VPN_SERVICE}: A service that implements {@link android.net.VpnService} must require this permission for itself.</li> -<li>{@link android.Manifest.permission#READ_PROFILE}: Provides read access to the {@link +<li>android.Manifest.permission#READ_PROFILE: Provides read access to the {@link android.provider.ContactsContract.Profile} provider.</li> -<li>{@link android.Manifest.permission#WRITE_PROFILE}: Provides write access to the {@link +<li>android.Manifest.permission#WRITE_PROFILE: Provides write access to the {@link android.provider.ContactsContract.Profile} provider.</li> </ul> diff --git a/docs/html/guide/topics/providers/contacts-provider.jd b/docs/html/guide/topics/providers/contacts-provider.jd index e3b998a..2b14558 100644 --- a/docs/html/guide/topics/providers/contacts-provider.jd +++ b/docs/html/guide/topics/providers/contacts-provider.jd @@ -57,7 +57,7 @@ page.title=Contacts Provider <li>{@link android.provider.ContactsContract.Contacts}</li> <li>{@link android.provider.ContactsContract.RawContacts}</li> <li>{@link android.provider.ContactsContract.Data}</li> - <li>{@link android.provider.ContactsContract.StreamItems}</li> + <li>android.provider.ContactsContract.StreamItems</li> </ol> <h2>Related Samples</h2> <ol> @@ -606,13 +606,13 @@ page.title=Contacts Provider Access to the user profile requires special permissions. In addition to the {@link android.Manifest.permission#READ_CONTACTS} and {@link android.Manifest.permission#WRITE_CONTACTS} permissions needed to read and write, access - to the user profile requires the {@link android.Manifest.permission#READ_PROFILE} and - {@link android.Manifest.permission#WRITE_PROFILE} permissions for read and write access, + to the user profile requires the android.Manifest.permission#READ_PROFILE and + android.Manifest.permission#WRITE_PROFILE permissions for read and write access, respectively. </p> <p> Remember that you should consider a user's profile to be sensitive. The permission - {@link android.Manifest.permission#READ_PROFILE} allows you to access the device user's + android.Manifest.permission#READ_PROFILE allows you to access the device user's personally-identifying data. Make sure to tell the user why you need user profile access permissions in the description of your application. </p> @@ -1826,8 +1826,8 @@ child elements that provide specific data to the </dl> <h2 id="SocialStream">Social Stream Data</h2> <p> - The {@link android.provider.ContactsContract.StreamItems} and - {@link android.provider.ContactsContract.StreamItemPhotos} tables + The android.provider.ContactsContract.StreamItems and + android.provider.ContactsContract.StreamItemPhotos tables manage incoming data from social networks. You can write a sync adapter that adds stream data from your own network to these tables, or you can read stream data from these tables and display it in your own application, or both. With these features, your social networking @@ -1836,7 +1836,7 @@ child elements that provide specific data to the <h3 id="StreamText">Social stream text</h3> <p> Stream items are always associated with a raw contact. The - {@link android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID} links to the + android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID links to the <code>_ID</code> value for the raw contact. The account type and account name of the raw contact are also stored in the stream item row. </p> @@ -1845,14 +1845,14 @@ child elements that provide specific data to the </p> <dl> <dt> - {@link android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_TYPE} + android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_TYPE </dt> <dd> <strong>Required.</strong> The user's account type for the raw contact associated with this stream item. Remember to set this value when you insert a stream item. </dd> <dt> - {@link android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_NAME} + android.provider.ContactsContract.StreamItemsColumns#ACCOUNT_NAME </dt> <dd> <strong>Required.</strong> The user's account name for the raw contact associated with this @@ -1866,30 +1866,30 @@ child elements that provide specific data to the insert a stream item: <ul> <li> - {@link android.provider.ContactsContract.StreamItemsColumns#CONTACT_ID}: The - {@link android.provider.BaseColumns#_ID} value of the contact that this stream + android.provider.ContactsContract.StreamItemsColumns#CONTACT_ID: The + android.provider.BaseColumns#_ID value of the contact that this stream item is associated with. </li> <li> - {@link android.provider.ContactsContract.StreamItemsColumns#CONTACT_LOOKUP_KEY}: The - {@link android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY} value of the + android.provider.ContactsContract.StreamItemsColumns#CONTACT_LOOKUP_KEY: The + android.provider.ContactsContract.ContactsColumns#LOOKUP_KEY value of the contact this stream item is associated with. </li> <li> - {@link android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID}: The - {@link android.provider.BaseColumns#_ID} value of the raw contact that this stream + android.provider.ContactsContract.StreamItemsColumns#RAW_CONTACT_ID: The + android.provider.BaseColumns#_ID value of the raw contact that this stream item is associated with. </li> </ul> </dd> <dt> - {@link android.provider.ContactsContract.StreamItemsColumns#COMMENTS} + android.provider.ContactsContract.StreamItemsColumns#COMMENTS </dt> <dd> Optional. Stores summary information that you can display at the beginning of a stream item. </dd> <dt> - {@link android.provider.ContactsContract.StreamItemsColumns#TEXT} + android.provider.ContactsContract.StreamItemsColumns#TEXT </dt> <dd> The text of the stream item, either the content that was posted by the source of the item, @@ -1899,7 +1899,7 @@ child elements that provide specific data to the ellipsize long content, but it will try to avoid breaking tags. </dd> <dt> - {@link android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP} + android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP </dt> <dd> A text string containing the time the stream item was inserted or updated, in the form @@ -1910,42 +1910,42 @@ child elements that provide specific data to the </dl> <p> To display identifying information for your stream items, use the - {@link android.provider.ContactsContract.StreamItemsColumns#RES_ICON}, - {@link android.provider.ContactsContract.StreamItemsColumns#RES_LABEL}, and - {@link android.provider.ContactsContract.StreamItemsColumns#RES_PACKAGE} to link to resources + android.provider.ContactsContract.StreamItemsColumns#RES_ICON, + android.provider.ContactsContract.StreamItemsColumns#RES_LABEL, and + android.provider.ContactsContract.StreamItemsColumns#RES_PACKAGE to link to resources in your application. </p> <p> - The {@link android.provider.ContactsContract.StreamItems} table also contains the columns - {@link android.provider.ContactsContract.StreamItemsColumns#SYNC1} through - {@link android.provider.ContactsContract.StreamItemsColumns#SYNC4} for the exclusive use of + The android.provider.ContactsContract.StreamItems table also contains the columns + android.provider.ContactsContract.StreamItemsColumns#SYNC1 through + android.provider.ContactsContract.StreamItemsColumns#SYNC4 for the exclusive use of sync adapters. </p> <h3 id="StreamPhotos">Social stream photos</h3> <p> - The {@link android.provider.ContactsContract.StreamItemPhotos} table stores photos associated + The android.provider.ContactsContract.StreamItemPhotos table stores photos associated with a stream item. The table's - {@link android.provider.ContactsContract.StreamItemPhotosColumns#STREAM_ITEM_ID} column + android.provider.ContactsContract.StreamItemPhotosColumns#STREAM_ITEM_ID column links to values in the {@link android.provider.BaseColumns#_ID} column of - {@link android.provider.ContactsContract.StreamItems} table. Photo references are stored in the + android.provider.ContactsContract.StreamItems table. Photo references are stored in the table in these columns: </p> <dl> <dt> - {@link android.provider.ContactsContract.StreamItemPhotos#PHOTO} column (a BLOB). + android.provider.ContactsContract.StreamItemPhotos#PHOTO column (a BLOB). </dt> <dd> A binary representation of the photo, resized by the provider for storage and display. This column is available for backwards compatibility with previous versions of the Contacts Provider that used it for storing photos. However, in the current version you should not use this column to store photos. Instead, use - either {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID} or - {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI} (both of + either android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID or + android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI (both of which are described in the following points) to store photos in a file. This column now contains a thumbnail of the photo, which is available for reading. </dd> <dt> - {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID} + android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_FILE_ID </dt> <dd> A numeric identifier of a photo for a raw contact. Append this value to the constant @@ -1955,7 +1955,7 @@ child elements that provide specific data to the openAssetFileDescriptor()} to get a handle to the photo file. </dd> <dt> - {@link android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI} + android.provider.ContactsContract.StreamItemPhotosColumns#PHOTO_URI </dt> <dd> A content URI pointing directly to the photo file for the photo represented by this row. @@ -1970,27 +1970,27 @@ child elements that provide specific data to the <ul> <li> These tables require additional access permissions. To read from them, your application - must have the permission {@link android.Manifest.permission#READ_SOCIAL_STREAM}. To + must have the permission android.Manifest.permission#READ_SOCIAL_STREAM. To modify them, your application must have the permission - {@link android.Manifest.permission#WRITE_SOCIAL_STREAM}. + android.Manifest.permission#WRITE_SOCIAL_STREAM. </li> <li> - For the {@link android.provider.ContactsContract.StreamItems} table, the number of rows + For the android.provider.ContactsContract.StreamItems table, the number of rows stored for each raw contact is limited. Once this limit is reached, the Contacts Provider makes space for new stream item rows by automatically deleting the rows having the oldest - {@link android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP}. To get the + android.provider.ContactsContract.StreamItemsColumns#TIMESTAMP. To get the limit, issue a query to the content URI - {@link android.provider.ContactsContract.StreamItems#CONTENT_LIMIT_URI}. You can leave + android.provider.ContactsContract.StreamItems#CONTENT_LIMIT_URI. You can leave all the arguments other than the content URI set to <code>null</code>. The query returns a Cursor containing a single row, with the single column - {@link android.provider.ContactsContract.StreamItems#MAX_ITEMS}. + android.provider.ContactsContract.StreamItems#MAX_ITEMS. </li> </ul> <p> - The class {@link android.provider.ContactsContract.StreamItems.StreamItemPhotos} defines a - sub-table of {@link android.provider.ContactsContract.StreamItemPhotos} containing the photo + The class android.provider.ContactsContract.StreamItems.StreamItemPhotos defines a + sub-table of android.provider.ContactsContract.StreamItemPhotos containing the photo rows for a single stream item. </p> <h3 id="SocialStreamInteraction">Social stream interactions</h3> @@ -2003,8 +2003,8 @@ child elements that provide specific data to the <li> By syncing your social networking service to the Contacts Provider with a sync adapter, you can retrieve recent activity for a user's contacts and store it in - the {@link android.provider.ContactsContract.StreamItems} and - {@link android.provider.ContactsContract.StreamItemPhotos} tables for later use. + the android.provider.ContactsContract.StreamItems and + android.provider.ContactsContract.StreamItemPhotos tables for later use. </li> <li> Besides regular synchronization, you can trigger your sync adapter to retrieve @@ -2356,6 +2356,6 @@ child elements that provide specific data to the </p> <p> Social stream data for a person may also include photos. These are stored in the - {@link android.provider.ContactsContract.StreamItemPhotos} table, which is described in more + android.provider.ContactsContract.StreamItemPhotos table, which is described in more detail in the section <a href="#StreamPhotos">Social stream photos</a>. </p> diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java index f059727..fcd7f63 100644 --- a/graphics/java/android/graphics/drawable/BitmapDrawable.java +++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java @@ -362,11 +362,6 @@ public class BitmapDrawable extends Drawable { invalidateSelf(); } - @Override - public boolean isDither() { - return mBitmapState.mPaint.isDither(); - } - /** * Indicates the repeat behavior of this drawable on the X axis. * diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index 7af78a7..32af59a 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -269,26 +269,16 @@ public abstract class Drawable { } /** - * Set to true to have the drawable dither its colors when drawn to a device - * with fewer than 8-bits per color component. + * Set to true to have the drawable dither its colors when drawn to a + * device with fewer than 8-bits per color component. * - * <p>This can improve the look on those devices, but can also slow down - * the drawing a little.</p> - * - * @see #isDither() * @see android.graphics.Paint#setDither(boolean); + * @deprecated This property is ignored. */ + @Deprecated public void setDither(boolean dither) {} /** - * @return whether this drawable dithers its colors - * @see #setDither(boolean) - */ - public boolean isDither() { - return false; - } - - /** * Set to true to have the drawable filter its bitmaps with bilinear * sampling when they are scaled or rotated. * diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java index 1759f53..b344b86 100644 --- a/graphics/java/android/graphics/drawable/DrawableContainer.java +++ b/graphics/java/android/graphics/drawable/DrawableContainer.java @@ -167,11 +167,6 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { } @Override - public boolean isDither() { - return mDrawableContainerState.mDither; - } - - @Override public void setColorFilter(ColorFilter colorFilter) { mDrawableContainerState.mHasColorFilter = true; diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 626991d..a11b2cd 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -826,11 +826,6 @@ public class GradientDrawable extends Drawable { } @Override - public boolean isDither() { - return mGradientState.mDither; - } - - @Override public ColorFilter getColorFilter() { return mColorFilter; } diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index 90891f6..8373c7f 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -1248,16 +1248,6 @@ public class LayerDrawable extends Drawable implements Drawable.Callback { } @Override - public boolean isDither() { - final Drawable dr = getFirstNonNullDrawable(); - if (dr != null) { - return dr.isDither(); - } else { - return super.isDither(); - } - } - - @Override public void setAlpha(int alpha) { final ChildDrawable[] array = mLayerState.mChildren; final int N = mLayerState.mNum; diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java index adf53e3..152fe6a 100644 --- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java +++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java @@ -374,11 +374,6 @@ public class NinePatchDrawable extends Drawable { } @Override - public boolean isDither() { - return mPaint == null ? DEFAULT_DITHER : mPaint.isDither(); - } - - @Override public void setAutoMirrored(boolean mirrored) { mNinePatchState.mAutoMirrored = mirrored; } diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java index a669d3c..30b588e 100644 --- a/graphics/java/android/graphics/drawable/ShapeDrawable.java +++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java @@ -328,11 +328,6 @@ public class ShapeDrawable extends Drawable { } @Override - public boolean isDither() { - return mShapeState.mPaint.isDither(); - } - - @Override protected void onBoundsChange(Rect bounds) { super.onBoundsChange(bounds); updateShape(); diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp index a323065..6cf66cd 100644 --- a/libs/hwui/SkiaCanvas.cpp +++ b/libs/hwui/SkiaCanvas.cpp @@ -419,12 +419,12 @@ bool SkiaCanvas::quickRejectPath(const SkPath& path) const { bool SkiaCanvas::clipRect(float left, float top, float right, float bottom, SkRegion::Op op) { SkRect rect = SkRect::MakeLTRB(left, top, right, bottom); mCanvas->clipRect(rect, op); - return mCanvas->isClipEmpty(); + return !mCanvas->isClipEmpty(); } bool SkiaCanvas::clipPath(const SkPath* path, SkRegion::Op op) { mCanvas->clipPath(*path, op); - return mCanvas->isClipEmpty(); + return !mCanvas->isClipEmpty(); } bool SkiaCanvas::clipRegion(const SkRegion* region, SkRegion::Op op) { @@ -438,7 +438,7 @@ bool SkiaCanvas::clipRegion(const SkRegion* region, SkRegion::Op op) { } else { mCanvas->clipRect(SkRect::MakeEmpty(), op); } - return mCanvas->isClipEmpty(); + return !mCanvas->isClipEmpty(); } // ---------------------------------------------------------------------------- diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java index 64333ad..003a274 100644 --- a/media/java/android/media/tv/TvView.java +++ b/media/java/android/media/tv/TvView.java @@ -272,7 +272,7 @@ public class TvView extends ViewGroup { /** * Tunes to a given channel. * - * @param inputId The ID of TV input which will play the given channel. + * @param inputId The ID of the TV input for the given channel. * @param channelUri The URI of a channel. */ public void tune(@NonNull String inputId, Uri channelUri) { @@ -282,9 +282,9 @@ public class TvView extends ViewGroup { /** * Tunes to a given channel. * - * @param inputId The ID of TV input which will play the given channel. + * @param inputId The ID of TV input for the given channel. * @param channelUri The URI of a channel. - * @param params Extra parameters which might be handled with the tune event. + * @param params Extra parameters. * @hide */ @SystemApi @@ -298,22 +298,26 @@ public class TvView extends ViewGroup { sMainTvView = new WeakReference<>(this); } } - if (mSessionCallback != null && mSessionCallback.mInputId.equals(inputId)) { + if (mSessionCallback != null && TextUtils.equals(mSessionCallback.mInputId, inputId)) { if (mSession != null) { mSession.tune(channelUri, params); } else { - // Session is not created yet. Replace the channel which will be set once the - // session is made. + // createSession() was called but the actual session for the given inputId has not + // yet been created. Just replace the existing tuning params in the callback with + // the new ones and tune later in onSessionCreated(). It is not necessary to create + // a new callback because this tuning request was made on the same inputId. mSessionCallback.mChannelUri = channelUri; mSessionCallback.mTuneParams = params; } } else { resetInternal(); - // When createSession() is called multiple times before the callback is called, - // only the callback of the last createSession() call will be actually called back. - // The previous callbacks will be ignored. For the logic, mSessionCallback - // is newly assigned for every createSession request and compared with - // MySessionCreateCallback.this. + // In case createSession() is called multiple times across different inputId's before + // any session is created (e.g. when quickly tuning to a channel from input A and then + // to another channel from input B), only the callback for the last createSession() + // should be invoked. (The previous callbacks are simply ignored.) To do that, we create + // a new callback each time and keep mSessionCallback pointing to the last one. If + // MySessionCallback.this is different from mSessionCallback, we know that this callback + // is obsolete and should ignore it. mSessionCallback = new MySessionCallback(inputId, channelUri, params); if (mTvInputManager != null) { mTvInputManager.createSession(inputId, mSessionCallback, mHandler); @@ -337,6 +341,7 @@ public class TvView extends ViewGroup { } private void resetInternal() { + mSessionCallback = null; mPendingAppPrivateCommands.clear(); if (mSession != null) { setSessionSurface(null); @@ -344,7 +349,6 @@ public class TvView extends ViewGroup { mUseRequestedSurfaceLayout = false; mSession.release(); mSession = null; - mSessionCallback = null; resetSurfaceView(); } } diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index fe148da..c541bca 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -186,6 +186,9 @@ public class DocumentsActivity extends BaseActivity { } if (!mState.restored) { + // In this case, we set the activity title in AsyncTask.onPostExecute(). To prevent + // talkback from reading aloud the default title, we clear it here. + setTitle(""); if (mState.action == ACTION_MANAGE || mState.action == ACTION_BROWSE) { final Uri rootUri = getIntent().getData(); new RestoreRootTask(rootUri).executeOnExecutor(getCurrentExecutor()); diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java index b33b10b..25f8872 100644 --- a/services/core/java/com/android/server/BluetoothManagerService.java +++ b/services/core/java/com/android/server/BluetoothManagerService.java @@ -19,6 +19,7 @@ package com.android.server; import android.Manifest; import android.app.ActivityManager; import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothCallback; @@ -114,6 +115,13 @@ class BluetoothManagerService extends IBluetoothManager.Stub { private static final int SERVICE_IBLUETOOTH = 1; private static final int SERVICE_IBLUETOOTHGATT = 2; + private static final String[] DEVICE_TYPE_NAMES = new String[] { + "???", + "BR/EDR", + "LE", + "DUAL" + }; + private final Context mContext; private static int mBleAppCount = 0; @@ -1801,6 +1809,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub { } else { ParcelFileDescriptor pfd = null; try { + writer.println("Bonded devices:"); + for (BluetoothDevice device : mBluetooth.getBondedDevices()) { + writer.println(" " + device.getAddress() + + " [" + DEVICE_TYPE_NAMES[device.getType()] + "] " + + device.getName()); + } + writer.flush(); + pfd = ParcelFileDescriptor.dup(fd); mBluetooth.dump(pfd); } catch (RemoteException re) { diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index d9e5b75..e4f3f49 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1560,7 +1560,7 @@ public class ConnectivityService extends IConnectivityManager.Stub NetworkCapabilities.TRANSPORT_WIFI)) { timeout = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI, - 5); + 15); type = ConnectivityManager.TYPE_WIFI; } else { // do not track any other networks diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index 5436ce0..c5ea8bc 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -27,11 +27,10 @@ import android.content.pm.PackageManager; import android.content.pm.UserInfo; import static android.Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE; import static android.content.Context.USER_SERVICE; -import static android.Manifest.permission.READ_PROFILE; +import static android.Manifest.permission.READ_CONTACTS; import android.database.sqlite.SQLiteDatabase; import android.os.Binder; import android.os.IBinder; -import android.os.Process; import android.os.RemoteException; import android.os.storage.IMountService; import android.os.ServiceManager; @@ -264,12 +263,12 @@ public class LockSettingsService extends ILockSettings.Stub { private final void checkReadPermission(String requestedKey, int userId) { final int callingUid = Binder.getCallingUid(); - for (int i = 0; i < READ_PROFILE_PROTECTED_SETTINGS.length; i++) { - String key = READ_PROFILE_PROTECTED_SETTINGS[i]; - if (key.equals(requestedKey) && mContext.checkCallingOrSelfPermission(READ_PROFILE) + for (int i = 0; i < READ_CONTACTS_PROTECTED_SETTINGS.length; i++) { + String key = READ_CONTACTS_PROTECTED_SETTINGS[i]; + if (key.equals(requestedKey) && mContext.checkCallingOrSelfPermission(READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("uid=" + callingUid - + " needs permission " + READ_PROFILE + " to read " + + " needs permission " + READ_CONTACTS + " to read " + requestedKey + " for user " + userId); } } @@ -722,8 +721,8 @@ public class LockSettingsService extends ILockSettings.Stub { Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED }; - // Reading these settings needs the profile permission - private static final String[] READ_PROFILE_PROTECTED_SETTINGS = new String[] { + // Reading these settings needs the contacts permission + private static final String[] READ_CONTACTS_PROTECTED_SETTINGS = new String[] { Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, Secure.LOCK_SCREEN_OWNER_INFO }; diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 458150c..7204aec 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -1504,6 +1504,8 @@ class MountService extends IMountService.Stub try { final NativeDaemonEvent res = mConnector.execute("volume", "benchmark", volId); return Long.parseLong(res.getMessage()); + } catch (NativeDaemonTimeoutException e) { + return Long.MAX_VALUE; } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } diff --git a/services/core/java/com/android/server/NativeDaemonConnector.java b/services/core/java/com/android/server/NativeDaemonConnector.java index 78c7f38..e7979e4 100644 --- a/services/core/java/com/android/server/NativeDaemonConnector.java +++ b/services/core/java/com/android/server/NativeDaemonConnector.java @@ -421,7 +421,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo event = mResponseQueue.remove(sequenceNumber, timeout, logCmd); if (event == null) { loge("timed-out waiting for response to " + logCmd); - throw new NativeDaemonFailureException(logCmd, event); + throw new NativeDaemonTimeoutException(logCmd, event); } if (VDBG) log("RMV <- {" + event + "}"); events.add(event); diff --git a/core/java/android/view/ViewAssistStructure.java b/services/core/java/com/android/server/NativeDaemonTimeoutException.java index a66d93c..658f7d6 100644 --- a/core/java/android/view/ViewAssistStructure.java +++ b/services/core/java/com/android/server/NativeDaemonTimeoutException.java @@ -14,11 +14,15 @@ * limitations under the License. */ -package android.view; +package com.android.server; /** - * @deprecated Temporary until old apps can move off this. + * An exception that indicates there was a timeout with a + * {@link NativeDaemonConnector} operation. */ -@Deprecated -public abstract class ViewAssistStructure extends ViewStructure { +public class NativeDaemonTimeoutException extends NativeDaemonConnectorException { + public NativeDaemonTimeoutException(String command, NativeDaemonEvent event) { + super(command, event); + } } + diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java index 3854e51..78557634 100644 --- a/services/core/java/com/android/server/am/BatteryStatsService.java +++ b/services/core/java/com/android/server/am/BatteryStatsService.java @@ -38,6 +38,7 @@ import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.WorkSource; +import android.telephony.DataConnectionRealTimeInfo; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.util.Slog; @@ -629,7 +630,10 @@ public final class BatteryStatsService extends IBatteryStats.Stub // Collect data now for the past activity. synchronized (mStats) { if (mStats.isOnBattery()) { - mHandler.scheduleWifiSync("wifi-data"); + final String type = (powerState == DataConnectionRealTimeInfo.DC_POWER_STATE_HIGH || + powerState == DataConnectionRealTimeInfo.DC_POWER_STATE_MEDIUM) ? "active" + : "inactive"; + mHandler.scheduleWifiSync("wifi-data: " + type); } mStats.noteWifiRadioPowerState(powerState, tsNanos); } diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 2da24cc..dbf0f17 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -310,6 +310,7 @@ public class PackageManagerService extends IPackageManager.Stub { static final int SCAN_DELETE_DATA_ON_FAILURES = 1<<10; static final int SCAN_REQUIRE_KNOWN = 1<<12; static final int SCAN_MOVE = 1<<13; + static final int SCAN_INITIAL = 1<<14; static final int REMOVE_CHATTY = 1<<16; @@ -1840,7 +1841,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Set flag to monitor and not change apk file paths when // scanning install directories. - final int scanFlags = SCAN_NO_PATHS | SCAN_DEFER_DEX | SCAN_BOOTING; + final int scanFlags = SCAN_NO_PATHS | SCAN_DEFER_DEX | SCAN_BOOTING | SCAN_INITIAL; final ArraySet<String> alreadyDexOpted = new ArraySet<String>(); @@ -11327,7 +11328,7 @@ public class PackageManagerService extends IPackageManager.Stub { private boolean shouldCheckUpgradeKeySetLP(PackageSetting oldPs, int scanFlags) { // Can't rotate keys during boot or if sharedUser. - if (oldPs == null || (scanFlags&SCAN_BOOTING) != 0 || oldPs.sharedUser != null + if (oldPs == null || (scanFlags&SCAN_INITIAL) != 0 || oldPs.sharedUser != null || !oldPs.keySetData.isUsingUpgradeKeySets()) { return false; } @@ -11711,6 +11712,10 @@ public class PackageManagerService extends IPackageManager.Stub { || (args.volumeUuid != null)); boolean replace = false; int scanFlags = SCAN_NEW_INSTALL | SCAN_UPDATE_SIGNATURE; + if (args.move != null) { + // moving a complete application; perfom an initial scan on the new install location + scanFlags |= SCAN_INITIAL; + } // Result object to be returned res.returnCode = PackageManager.INSTALL_SUCCEEDED; @@ -15007,7 +15012,7 @@ public class PackageManagerService extends IPackageManager.Stub { for (PackageSetting ps : packages) { final PackageParser.Package pkg; try { - pkg = scanPackageLI(ps.codePath, parseFlags, 0, 0, null); + pkg = scanPackageLI(ps.codePath, parseFlags, SCAN_INITIAL, 0L, null); loaded.add(pkg.applicationInfo); } catch (PackageManagerException e) { Slog.w(TAG, "Failed to scan " + ps.codePath + ": " + e.getMessage()); diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 79dac14..93e1f18 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5381,10 +5381,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { } private boolean wakeUp(long wakeTime, boolean wakeInTheaterMode) { - if (!wakeInTheaterMode && isTheaterModeEnabled()) { + final boolean theaterModeEnabled = isTheaterModeEnabled(); + if (!wakeInTheaterMode && theaterModeEnabled) { return false; } + if (theaterModeEnabled) { + Settings.Global.putInt(mContext.getContentResolver(), + Settings.Global.THEATER_MODE_ON, 0); + } + mPowerManager.wakeUp(wakeTime); return true; } |
