Commit Graph

335 Commits

Author SHA1 Message Date
TreeHugger Robot
85fb9ddccc Merge "Add android.test.base/stubs dependency" 2017-12-15 14:00:38 +00:00
Philip P. Moltmann
dab728b9cd Switch to modern ArgumentMatchers am: 13ade30481 am: 4825219c58
am: aac55283be

Change-Id: I2d60912d3e54cfb69c57c2bba17ef4c594835507
2017-12-15 11:37:41 +00:00
Philip P. Moltmann
aac55283be Switch to modern ArgumentMatchers am: 13ade30481
am: 4825219c58

Change-Id: I36cc4d4c4a21024cf85f407426d4cbe09eaeaca7
2017-12-15 11:16:30 +00:00
Philip P. Moltmann
4825219c58 Switch to modern ArgumentMatchers
am: 13ade30481

Change-Id: I179e84cc63294062f158813685a03dfa326431fb
2017-12-15 10:55:57 +00:00
Paul Duffin
3a14dd0aa8 Add android.test.base/stubs dependency
In preparation for the removal of the non-junit classes in the
android.test.base library from the android.jar this adds a dependency
on android.test.base/stubs to ensure this code will continue to
compile.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/Android.mk
    Added 'android.test.base.stubs' to LOCAL_JAVA_LIBRARIES because
    messagingtests's will need them in order to compile once its
    classes are removed from the current SDK on which it currently
    depends.

Bug: 30188076
Test: make dist
Change-Id: Iabfb3c655897781ab3aee2b0dbf574d6048954a9
2017-12-15 07:22:38 +00:00
Philip P. Moltmann
13ade30481 Switch to modern ArgumentMatchers
Test: - adb shell am instrument -w -e class com.android.messaging.ui.attachmentchooser.AttachmentChooserFragmentTest com.android.messaging.test/android.test.InstrumentationTestRunner
      - adb shell am instrument -w -e class com.android.messaging.ui.conversation.ComposeMessageViewTest com.android.messaging.test/android.test.InstrumentationTestRunner
      - adb shell am instrument -w -e class com.android.messaging.ui.conversationlist.ConversationListItemViewTest com.android.messaging.test/android.test.InstrumentationTestRunner
Change-Id: Ic3f29ed0e13b392d5687934f25d99c2a0e8c4dac
2017-12-14 09:48:05 -08:00
Philip P. Moltmann
f6aa0ff80e Merge "Switch to modern ArgumentMatchers" 2017-12-13 23:40:20 +00:00
Paul Duffin
dc6414be65 Use a.t.mock.stubs instead of a.t.mock.sdk am: 13c0cbe2c6 am: 79fbe99445
am: f18ac489da  -s ours

Change-Id: I771681a6d2479b44034a377d4f6bc2cd27c698f3
2017-12-13 01:57:22 +00:00
Paul Duffin
f18ac489da Use a.t.mock.stubs instead of a.t.mock.sdk am: 13c0cbe2c6
am: 79fbe99445

Change-Id: Ic556f9fccca1051830d428985d36cc4126602b63
2017-12-13 01:43:58 +00:00
Paul Duffin
79fbe99445 Use a.t.mock.stubs instead of a.t.mock.sdk
am: 13c0cbe2c6

Change-Id: I41c4cf94c3aba9c259a55d2fc3a6b207069944ee
2017-12-13 01:11:53 +00:00
Philip P. Moltmann
ea5d77fa38 Switch to modern ArgumentMatchers
Test: - adb shell am instrument -w -e class com.android.messaging.ui.attachmentchooser.AttachmentChooserFragmentTest com.android.messaging.test/android.test.InstrumentationTestRunner
      - adb shell am instrument -w -e class com.android.messaging.ui.conversation.ComposeMessageViewTest com.android.messaging.test/android.test.InstrumentationTestRunner
      - adb shell am instrument -w -e class com.android.messaging.ui.conversationlist.ConversationListItemViewTest com.android.messaging.test/android.test.InstrumentationTestRunner
Change-Id: Ic3f29ed0e13b392d5687934f25d99c2a0e8c4dac
2017-12-12 13:07:12 -08:00
Paul Duffin
13c0cbe2c6 Use a.t.mock.stubs instead of a.t.mock.sdk
Remove dependencies on android.test.mock.sdk as it is a duplicate of
android.test.mock.stubs and will be removed.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/Android.mk
    Replaced 'android.test.mock.sdk' with 'android.test.mock.stubs' in
    LOCAL_JAVA_LIBRARIES because android.test.mock.sdk has been
    deprecated.

Bug: 30188076
Test: make checkbuild
Change-Id: I40d388f5e07293f7d958b563bc8ab94f89ff9f8d
Merged-In: I40d388f5e07293f7d958b563bc8ab94f89ff9f8d
(cherry picked from commit ea59fb8c73)
2017-12-07 13:33:09 -08:00
Paul Duffin
2e86be170a Flatten dependency hierarchy of legacy-android-test
Previous changes statically included legacy-android-test in preparation
for removing android.test.* and junit.* classes from the android.jar.
Unfortunately, that lead to duplicate classes between APKs and the
bootclasspath which caused build problems (Proguard) and also runtime
problems (when targeting and running on older releases).

Switching from statically including the classes to using the runtime
libraries cannot be done in one step because legacy-android-test is
statically included in libraries which are used in many APKs and so
removing it from those libraries requires that all APKs be updated at
once. Doing that atomically across dozens of projects is not practical.

This change modifies APKS that statically include the
legacy-android-test library indirectly.

* If the APK manifest uses the android.test.runner library then the APK
  is modified to stop statically including legacy-android-test and
  instead build against android.test.base/mock/runner libraries instead.

* Otherwise, the APK statically includes legacy-android-test.

Also, any libraries that statically include are modified to stop
statically including it and if it has source dependencies on the classes
is changed to build against the android.test.base/mock/runner libraries.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/Android.mk
    Replaced 'legacy-android-test' with 'android.test.runner.stubs' in
    LOCAL_JAVA_LIBRARIES because messagingtests's source depends on its
    classes. The classes do not need to be statically included because
    the classes will be provided by the runtime, either from the
    default bootclasspath or from the android.test.runner library that
    messagingtests specifies in its manifest.

Bug: 30188076
Test: make checkbuild
Change-Id: I7fa5bcf37c3b003c84ba5e493c6d675a619b6bcd
2017-12-05 18:36:57 +00:00
Aurimas Liutikas
9812a75c01 Migrate messaging to aapt2.
Test: make messaging
Change-Id: I460554bc92244feeca6e28081daf66d0dc2e6281
2017-11-21 12:50:18 -08:00
Paul Duffin
ea59fb8c73 Use a.t.mock.stubs instead of a.t.mock.sdk
Remove dependencies on android.test.mock.sdk as it is a duplicate of
android.test.mock.stubs and will be removed.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/Android.mk
    Replaced 'android.test.mock.sdk' with 'android.test.mock.stubs' in
    LOCAL_JAVA_LIBRARIES because android.test.mock.sdk has been
    deprecated.

Bug: 30188076
Test: make checkbuild
Change-Id: I40d388f5e07293f7d958b563bc8ab94f89ff9f8d
2017-11-16 12:57:30 +00:00
Xin Li
6337883a56 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
am: cd9ba9e128

Change-Id: I1d26b974d483b727ff1f023838cd3ac121ffa86c
2017-11-15 02:36:20 +00:00
Xin Li
cd9ba9e128 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
Change-Id: Ieafa1d7163c3b586f9daa34a8b8239ea57db6636
2017-11-14 16:38:23 -08:00
Xin Li
8f6c644d6f Merge commit 'b2dd6a8ef54b233843b463204ec4e3b67148a7e8' into HEAD
Change-Id: Id7e29d1428552414abd16ac7cd17d86b51e61658
2017-11-13 14:35:43 -08:00
Chih-Hung Hsieh
14dbcbcee7 Use -Werror in packages/apps/Messaging/jni am: cd6efe25a4 am: dfd8a9187f
am: ea2d2ad395

Change-Id: I20efed71a86dbee07b0f7edf2831393e1147ed89
2017-11-02 19:48:29 +00:00
Chih-Hung Hsieh
ea2d2ad395 Use -Werror in packages/apps/Messaging/jni am: cd6efe25a4
am: dfd8a9187f

Change-Id: Ic4f431bbe8c918b7f15f26d06553917e2a8ddfbc
2017-11-02 19:17:18 +00:00
Chih-Hung Hsieh
dfd8a9187f Use -Werror in packages/apps/Messaging/jni
am: cd6efe25a4

Change-Id: I56f5bee51ab4a56b11fc4e639b063728735f31e0
2017-11-02 19:03:25 +00:00
Chih-Hung Hsieh
cd6efe25a4 Use -Werror in packages/apps/Messaging/jni
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I3d7f5b98523c9fee08f2d1c29178ae050923617c
2017-11-01 15:56:01 -07:00
Tom Taylor
467361dbcf 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. The frameworks team is changing the underlying code to
throw an OutOfMemoryError instead of a NullPointerException.
In order to catch both errors, the code needs to catch Throwable.

Test: I added code to GifImageResource.getDrawable to throw a new
OutOfMemoryError and then used the debugger to verify it was caught by the
new catch Throwable statement. I did the same test with NullPointerException.
I tested attaching gif images and sending them to verify the gif path still
worked.

BUG=37742976

Change-Id: If71a7e65f8c0b083fe6c4b79f78358666338d59d
2017-10-05 11:27:21 -07:00
Tom Taylor
b2dd6a8ef5 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f am: c12af8d012 am: 3f22a4820c
am: 443a8888f2

Change-Id: I85c47a8571a609321e2c3e0dd4f2a2b57015e839
2017-07-12 19:33:47 +00:00
Tom Taylor
9a643d5c1c 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f am: c12af8d012 am: 7ace2d5308
am: cb822ae902

Change-Id: I0b28ce9619853b280cd93af783b93d6aff92bc4f
2017-07-12 19:33:39 +00:00
Tom Taylor
443a8888f2 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f am: c12af8d012
am: 3f22a4820c

Change-Id: I3007cf14803262bbb6f28db602b16252ebc4a62c
2017-07-12 19:29:21 +00:00
Tom Taylor
cb822ae902 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f am: c12af8d012
am: 7ace2d5308

Change-Id: I1872889b944cdffa63bafd7a125315d2fe2d7917
2017-07-12 19:28:15 +00:00
Tom Taylor
7ace2d5308 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f
am: c12af8d012

Change-Id: I70465c2290a2ba08d7647acab20bdfb25e8b3ecd
2017-07-12 19:24:50 +00:00
Tom Taylor
3f22a4820c 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b am: f9b9dc3d2f
am: c12af8d012

Change-Id: I5c9fd14d532b95caaceb8ca8b5e70feee77c34a0
2017-07-12 19:24:29 +00:00
Tom Taylor
c12af8d012 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2 am: cbed68f73b
am: f9b9dc3d2f

Change-Id: Ica8bedeb18ee6604e1382f54f0ad910b7cfa8c40
2017-07-12 19:20:09 +00:00
Tom Taylor
f9b9dc3d2f 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4 am: 93d52cb5e2
am: cbed68f73b

Change-Id: I66781d5390231f55da0ead3293010a240c632ff8
2017-07-12 19:15:11 +00:00
Tom Taylor
cbed68f73b 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1 am: a072033ce4
am: 93d52cb5e2

Change-Id: I35c5b7ee69984e1c91c63c9cf78af9d1c0e0ab43
2017-07-12 19:12:40 +00:00
Tom Taylor
93d52cb5e2 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4 am: 6ea30b87b1
am: a072033ce4

Change-Id: I2ead912804b75f6633d04259e0bdd61f2b4aad5f
2017-07-12 19:11:39 +00:00
Tom Taylor
a072033ce4 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360 am: 7a6b99a4a4
am: 6ea30b87b1

Change-Id: I28cfc0b9abbc28420feec7c690406ebe922b31e8
2017-07-12 19:09:10 +00:00
Tom Taylor
6ea30b87b1 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec am: 22bbfd7360
am: 7a6b99a4a4

Change-Id: I0817d9c8e4e30630cd0008f93ee31a728342eae1
2017-07-12 19:07:09 +00:00
Tom Taylor
7a6b99a4a4 37742976 - Catch bad gifs am: e0f247e399 am: 7c28ca34ec
am: 22bbfd7360

Change-Id: Ibe13d61b03cc6ae40d6782bf7ae045b5aeb491de
2017-07-12 19:06:10 +00:00
Tom Taylor
22bbfd7360 37742976 - Catch bad gifs am: e0f247e399
am: 7c28ca34ec

Change-Id: I0dad7e115a279290a51ee652dbd6a4f9b7ab7081
2017-07-12 19:02:38 +00:00
Tom Taylor
7c28ca34ec 37742976 - Catch bad gifs
am: e0f247e399

Change-Id: I54307fd0a08e1ecc14b2f3be5b8d52fac6ff7033
2017-07-12 19:01:08 +00:00
Tom Taylor
e0f247e399 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. Catch the NPE.

Test: manually tested the "crash.gif" attached to the bug. Stepped
through the debugger to verify we're catching the NPE and logging
the attempt. Verified normal gifs still work.

Bug: 37742976

Change-Id: Iab814d5b0b514bed0cecddd9a76f1fc095f90892
(cherry picked from commit 3671fd94ae)
2017-06-23 16:48:57 -07:00
TreeHugger Robot
8bd347d158 Merge "37742976 - Catch bad gifs" 2017-06-23 22:41:29 +00:00
Tom Taylor
3671fd94ae 37742976 - Catch bad gifs
* A security researcher crafted a gif that would cause the Android
Bitmap code to throw an NPE. That would cause messaging to crash when
decoding the NPE. Catch the NPE.

Test: manually tested the "crash.gif" attached to the bug. Stepped
through the debugger to verify we're catching the NPE and logging
the attempt. Verified normal gifs still work.

BUG=37742976

Change-Id: Iab814d5b0b514bed0cecddd9a76f1fc095f90892
2017-06-23 14:09:12 -07:00
Paul Duffin
0cf794c98b Fix dependencies of packages that target earlier releases am: 7b2c6ed6a5 am: 37f70d2951 am: 3fb6abb421
am: eaa925147a

Change-Id: If3fca43c17da75f1464640a721ffd61d375506b5
2017-06-14 14:45:17 +00:00
Paul Duffin
eaa925147a Fix dependencies of packages that target earlier releases am: 7b2c6ed6a5 am: 37f70d2951
am: 3fb6abb421

Change-Id: Ie95146abc1a8c899e8907c360bcf296a73a8c0d7
2017-06-14 14:42:27 +00:00
Paul Duffin
3fb6abb421 Fix dependencies of packages that target earlier releases am: 7b2c6ed6a5
am: 37f70d2951

Change-Id: I439fd98863bd439008529193d0c6d7f2cba0f73e
2017-06-14 14:40:01 +00:00
Paul Duffin
37f70d2951 Fix dependencies of packages that target earlier releases
am: 7b2c6ed6a5

Change-Id: I82c88cdf42903770c7cbbc23e3f0b0394c833089
2017-06-14 14:36:55 +00:00
Paul Duffin
7b2c6ed6a5 Fix dependencies of packages that target earlier releases
A previous change added legacy-android-test as a static dependency to
all packages that build against the current, test_current or
system_current and failed to compile when the junit and android.test
classes were removed from the API. Unfortunately, those changes did not
take into account that some of those packages target earlier API
versions and so will always have the classes available at runtime.

This change replaces those static dependencies with dynamic dependencies
for any package that targets an earlier API version. The file changes
were made automatically by a tool that constructed and then analyzed a
full dependency graph of all the Android Java modules. The individual
changes were checked manually to ensure that the changes matched the
intent. The affected modules were built against an API with the junit
and android.test classes removed. Any issues found during this process
resulted in either the tool being updated to address the issue or a
separate change being made to fix an existing problem with the build. A
sample of the affected packages were run to ensure that they worked as
expected at runtime; no issues were found during testing.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/Android.mk
    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because messagingtests's manifest file (AndroidManifest.xml)
    targets API level 19 and dynamically includes the
    android.test.runner library at runtime so there is no point in
    statically including the classes.

    Added 'android.test.mock.sdk' and 'legacy-android-test' to
    LOCAL_JAVA_LIBRARIES because module messagingtests builds against
    'LOCAL_SDK_VERSION := current' and uses classes from packages
    android.test and android.test.mock (possibly indirectly) so will no
    longer compile once they are removed from the API.

    Dependency 'android.test.mock.sdk' is used instead of
    'android.test.mock' because module messagingtests builds against
    the API not internal jars and so should use libraries that build
    against the API not internal jars.

    A future change will replace the dependency on
    'legacy-android-test', which builds against the internal jars with
    a dependency on 'android.legacy.test' which will build against the
    API.

Bug: 30188076
Test: make checkbuild and ran a sample of tests
Change-Id: I3421d13eb6847647cae6982ecf704af769c83500
2017-06-13 12:28:59 +01:00
Aurimas Liutikas
441c8b85a6 Remove usages of ActionBarActivity. am: d3b23f568a
am: 10244bf817

Change-Id: I8a59c98cd83c19aaa373fa1c38b26de6da1a8046
2017-06-06 21:27:52 +00:00
Aurimas Liutikas
10244bf817 Remove usages of ActionBarActivity.
am: d3b23f568a

Change-Id: Ia3525872e1a635f787ac6836ea961d95cc76d57f
2017-06-06 21:24:03 +00:00
Aurimas Liutikas
d3b23f568a Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
(cherry picked from commit 11224977e7)
2017-06-06 15:13:49 +00:00
Aurimas Liutikas
11224977e7 Remove usages of ActionBarActivity.
ActionBarActivity has been deprecated for 2+ years and has been
extending AppCompatActivity for all that time. These changes
should be no-ops.

Bug: 35253513
Test: None
Change-Id: I699f327aaa99b26a0a0b562cf425203e4b625c33
2017-05-18 11:16:47 -07:00