This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8b1533cbea835343dcf589cbaa57c63794be58bd
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting U or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the U release.
Bug: 234659204
Test: Build
Change-Id: I15aba10fe12dfcd2e67330ca844491341ef6d920
android.text.format.Time is deprecated since 2014 and there are
better alternatives.
Bug: 16550209
Test: presubmit
Change-Id: Ibbc4fb11e96b5179ff5dec906e74c9d582b6fb97
Change-Id: I81c01202306d856f6f8f8b74a5a28d7c1011fcec
Tested: Was no longer able to repro b/222091734.
Bug: 222091734
(cherry picked from commit 2283165c23)
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE.
Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2
Bug: 215212561
UriUtil.isFileUri contains several additional fixes, so this ensure that existing instances where we check for the file scheme use this method as well. This covers all existing instances in the app of SCHEME_FILE.
Change-Id: I1f3131b33823eae3e620aa9608be8e72b2e84aa2
Bug: 215212561
The underlying framework recognizes " file://..." as a valid URI and fetches the file, allowing for a possible exploit (see b/209965112). This trims the URI so that we can properly recognize it as a file from within our code.
Bug: 209965112
Change-Id: I8d9d9100e9a8c3bd64d19015d2177a14ec2306f3
Test: See repro steps on http://b/209965112, was no longer able to repro.
The underlying framework recognizes " file://..." as a valid URI and fetches the file, allowing for a possible exploit (see b/209965112). This trims the URI so that we can properly recognize it as a file from within our code.
Bug: 209965112
Change-Id: I8d9d9100e9a8c3bd64d19015d2177a14ec2306f3
Test: See repro steps on http://b/209965112, was no longer able to repro.
This fixes an edge case where a "File://" style URI could be passed in
but not pass this check, even though the underlying framework recognizes
this as a legitimate file.
Bug: 197328178
Test: See repro steps on http://b/197328178, was no longer able to
repro.
Change-Id: Id837744a79d1aca91b41d24207dc9b98f2b5b5e9
(cherry picked from commit 9607c95e71)
This fixes an edge case where a "File://" style URI could be passed in
but not pass this check, even though the underlying framework recognizes
this as a legitimate file.
Bug: 197328178
Test: See repro steps on http://b/197328178, was no longer able to
repro.
Change-Id: Id837744a79d1aca91b41d24207dc9b98f2b5b5e9
MediaMetadataRetriever.release now declares a thrown IOException.
Bug: 200173116
Test: Should be a non-functional change (only relevant when using MediaDataSource).
Change-Id: Ia3f5f01ee79feb35a10ec8bbbef6db88b32f2161
Test: receive a message, select it by long press, verify text is selectable.
Change-Id: I9f80df970c6ee1c06b8056c78bffe942eb8eb9bf
Signed-off-by: Timi Rautamäki <timi.rautamaki@gmail.com>
If sync operation is occurred between ResendMessageAction and
SendMessageAction, the pending outgoing messages in local db are deleted
and new messages are added from remote db.
To fix this issue, ResendMessageAction will update RETRY_TIMESTAMP only.
And RECEIVED_TIMESTAMP and SENT_TIMESTAMP will be updated in
SendMessageAction when the message is queued.
Test: manual
Change-Id: I0ffa6f46a7094ec3dfd2954d4313b78dd57d6994
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
If a SIM is inactive, Mark messages corresponding to the SIM as failed
instead of updating selfId as default selfId. The failed messages could
be sent through the SIM manually if the SIM is re-activated.
Test: Manual
Change-Id: I1eee7c12aaedebe8aa3e0c41b4b057758a3b17a2
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
If a device own phone number is unknown and there is only a single
address in all TO and CC for incoming MMS, ignore the address as it is
device own phone number.
Test: Manual
Change-Id: I26de39bd3b71d3ad391372f35cfce0bd5c7b66ed
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Load an icon image for audio files from app resources instead because
ContentResolver#getTypeInfo() is for API level >= 29.
And it includes size-fit ic_photo_library_light images also.
Bug: 159987488
Test: Manual
Change-Id: Ie8f766f148a30e105e598e4b7e6b1b22bccda6ae
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Test: In debug mode, turn off all the configs for advanced category
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I52ea0905b9d4f03a57b4849e5b575bc5e508dd2d
Creating ConnectivityUtil instances after checking the minimum set of
permissions since SubscriptionManager#getActiveSubscriptionInfoList()
requires READ_PHONE_STATE and users can revoke the permission.
On P and beyond, the subscription list will be filtered instead when no
permission.
Bug: 159421050
Test: Manual
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Iafc3c57060e1893a91e629b1b3e3ba9ad78967cb
Call onRequiredPermissionsAcquired() before calling redirect() so that
BugleApplication initialization can be done completed always even
PermissionCheckActivity#onResume() case.
Test: Manual
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I01bb681442e0b391238bc162ce139ff40d947eaf
Fixes error: "NoSuchFieldError exception: Telephony.Carriers.SIM_APN_URI requires API level 29"
Bug: 159055957
Test: manual - Tested the messaging UI. Without this change the app is crashing when we click on it.
$ make -j 40
Change-Id: Ic34ccac673531a61386c1eaa3bbfff950d19517b
Remove a Lambda Exp and replace ConcurrentHashMap#computeIfAbsent() with
containsKey() and put() so that this app can be built using JAVA 7.
Test: Build
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I7ff8a3b5fc4673dfe05c5ecc9418d377f3ed4f2e
Use SmsMessage#createFromPdu(pdu, format) at least on M and replace
SmsMessage#FORMAT_3GPP2 with "3gpp2".
- SmsMessage#createFromPdu(pdu, format) is added in API level 23.
- SmsMessage#FORMAT_3GPP2 is added in API level 28.
Test: Manual
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Icab2c6c3c86ee8b6597881bfac6066fed60db4d2
After this CL, ConnectivityUtil for default subId is used again on pre
N because TelephonyManager has createForSubscriptionId() for a specific
subId from N.
Nevertheless, listen() uses the default subId on PhoneStateListener
instead of the subId on the manager still even N. On O and beyond,
ConnectivityUtil works correctly on multi-sim devices.
Revert "Fix missing computeIfAbsent() method in L_MR1 and M"
This reverts commit f0ccb76d8d.
Reason for revert: Manage ConnectivityUtil instances for subIds at least
on N instead.
Test: Manual
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I2f08928a6798a2ce275c5c75569ad379999d274c
Replace ConcurrentHashMap#computeIfAbsent() with containsKey() and put()
since computeIfAbsent() is added in API level 24.
Bug: 158846265
Test: Build
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I3c43f0d7b1f289f0442c9359de4f099217244387
Same methods in PhoneUtils are used everywhere instead.
Test: Build
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Ia17c1f17511c53a9235af462fa0809146726e89f
It allows to call to well-formatted phone numbers or carrier specific
phone numbers starting with star sign such as *20 so that user can make
a call directly in a conversation for voice mail SMSs.
Revert "Check whether dialable only"
This reverts commit dbc43316cf.
Reason for revert: a call icon is disappeared for well-formatted phone
number with parentheses, dash and etc.
Test: Check the call icon in conversations for phone numbers and voice
mail numbers.
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I1b279f8a5372b00a5a0c572f9969731f1e633389
Check CONFIG_SEND_MULTIPART_SMS_AS_SEPARATE_MESSAGES directly for each
sending messages always so that the correct config can be used for each
SIM cards in multi-sim devices.
Test: Manual
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Iff80d093f43014ff2fe97caf6929aefe43911192
ConcurrentModificationException could be happened during iterating if
parts are added newly.
Test: Select several images on Gallery app and attach them to a message
via Sharing
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Idb96239ef2c05a08fc0727797b97739aa89f12a4
UriUtil#parseRecipientsFromSmsMmsUri() will returns a comma-separated
recipients for common use so that InsertNewMessageAction#createMessage()
can create or get a conversation correctly for RESPOND_VIA_MESSAGE.
In addition, mms/mmsto schemes are added. And it includes small cleanup
intent-filters for LaunchConversationActivity.
Test: adb shell am startservice
-a android.intent.action.RESPOND_VIA_MESSAGE -d "sms:12345678,87654321"
-e android.intent.extra.TEXT "Text"
Change-Id: I291dc765a46846982d059016d44f90873c687867
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
No need code to handle any retry case after downloading MMS.
Test: No behavior change
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I053f85e0260f7c4cd76d52114077d220ac0b25ba
Show an error toast instead since ACTION_CALL intent cannot be used to
call emergency numbers.
Test: Make a call to an emergency number.
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Ia42c588848b643def068dec1d73e2e917a4b8214