65 Commits

Author SHA1 Message Date
Alan Viverette
51efddbd3b Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.

Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
2017-04-14 11:15:50 -04:00
Paul Duffin
88c0facc1e Merge "Use Utils.assertTrue() in code that used junit.framework.Assert.assertTrue()" am: 372b6b2c45 am: 3fbcd8cf38
am: dec65547e2

Change-Id: Icd19f7ae6a7628df97ee7e8e57d63ca51ad581cc
2017-02-20 16:10:16 +00:00
Paul Duffin
0589d8287e Use Utils.assertTrue() in code that used junit.framework.Assert.assertTrue()
The previous changes to these files, which inlined the behavior
of Assert.assertTrue() were done in a hurry to fix the build.
This change makes use of the existing Utils.assertTrue() method
that was created for this purpose.

Bug: 30188076
Test: make checkbuild
Change-Id: Iacd505f8c3f7cefe6de94d30b56e39600bb9b0af
2017-02-20 13:27:38 +00:00
Paul Duffin
14fd9cebe9 Merge "Avoid using JUnit code in production WallpaperCropper" am: 9598c98db0 am: e4add524e9
am: 1f2955ad0d

Change-Id: I0921dc15784c2aff6b1b1c4ce33fe8aed0eaba98
2017-02-20 13:03:59 +00:00
Paul Duffin
c36ff4cf4f Avoid using JUnit code in production WallpaperCropper
Bug: 30188076
Test: make checkbuild
Change-Id: Ib6fe445a246d15dbabb8b86f9251b0059ed216b5
2017-02-20 12:37:35 +00:00
Colin Cross
0cbda3181f Merge "WallpaperCropper has no tests, it doesn't need junit" am: a34472b7e6 am: 11436455cf
am: de523d80d1

Change-Id: Ib567b678baa71884b7d8b5b603cd4a9e3ced1c75
2017-02-18 06:27:33 +00:00
Colin Cross
5a252e6b4b WallpaperCropper has no tests, it doesn't need junit
Test: builds
Change-Id: I1e65b921120f061119e06efeea9fb22d043bf305
2017-02-16 17:34:45 -08:00
Paul Duffin
ccb0445027 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

(cherry picked from 6387604f9e672ece85e07c4bcbd7be396867f06f)

Bug: 30188076
Test: make checkbuild
Merged-In: I13e88297731253420e4e5f5291d503f13a39a156
Change-Id: I58446eb8c45d8ac2bcdbc9fa40d1321e811bdd4b
2017-01-19 09:43:05 +00:00
Paul Duffin
8aeb59ebcd Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
2017-01-18 16:39:34 +00:00
Roozbeh Pournader
b84a505b62 Rename language+country resources to just language
Bug: 26496609
Test: none
Change-Id: I40b99a8728f1f324f4c1f8066a61c3d5f92b1ac6
2017-01-10 23:51:26 -08:00
Alan Viverette
ae4908f41c Remove DayNight theme
Bug: 21854466
Change-Id: I739872112d0ae457d0d4620f9222206072d54b4b
2016-03-31 16:18:27 -04:00
Alan Viverette
ba398eaafe Remove DayNight themes from public API (again)
Bug: 22628106
Change-Id: Id55c9e626813c70671a93aedf8b1e0cdaed45ec1
2015-12-16 15:28:23 -05:00
Alan Viverette
8078e4396a am a80ea2ee: am 8b73003f: am ea288fd3: Merge "Fix WallpaperCropper crash when setting wallpaper over 8MB"
* commit 'a80ea2eec3df6477fcf04563c8bc47a57e90ce91':
  Fix WallpaperCropper crash when setting wallpaper over 8MB
2015-08-26 14:48:32 +00:00
Alan Viverette
a80ea2eec3 am 8b73003f: am ea288fd3: Merge "Fix WallpaperCropper crash when setting wallpaper over 8MB"
* commit '8b73003fa0723b971c022fe373cba271c95d78b2':
  Fix WallpaperCropper crash when setting wallpaper over 8MB
2015-08-26 14:37:27 +00:00
Stephen Woo
cd2709ec7b Fix WallpaperCropper crash when setting wallpaper over 8MB
Use large heap for WallpaperCropper to avoid OOM crash in
createBitmap().

Change-Id: I1dc171286eaf0da37323ccf9fab046ca17e2ff07
Signed-off-by: Stephen Woo <stephen.m.woo@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
2015-08-26 10:27:47 +08:00
Alan Viverette
15d48a16f6 DO NOT MERGE: Remove DayNight theme
Do not go gentle into that good night,
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

Though wise men at their end know dark is right,
Because their words had forked no lightning they
Do not go gentle into that good night.

Bug: 21854466
Change-Id: I0b7cd116c23f7df88e94f31b3aee7dd22a102804
2015-06-18 15:15:16 -07:00
Alan Viverette
b9da280ac2 DayNight theme for framework packages
Change-Id: I745f90561c957c83540e75a2886e294633c83be1
2015-05-05 14:09:21 -07:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Neil Fuller
3b96bfb103 am 9b0109eb: am c7aa8fe6: Merge "Removing some more FloatMath references"
* commit '9b0109eb051fcf0a7ad801d03e73aa4e0bf2d7a7':
  Removing some more FloatMath references
2014-10-17 14:59:48 +00:00
Neil Fuller
5a135a1cbb am 9b0109eb: am c7aa8fe6: Merge "Removing some more FloatMath references"
* commit '9b0109eb051fcf0a7ad801d03e73aa4e0bf2d7a7':
  Removing some more FloatMath references
2014-10-17 14:59:41 +00:00
Neil Fuller
6de42dac43 Removing some more FloatMath references
See frameworks/base commit 33253a4baa6279f81a73425b49dfb6abe5f5416e
for details.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I46d4ee4c4be7972e3bcc6782fb50f024b6fff1ee
2014-10-15 11:45:45 +01:00
Selim Cinek
f8574f865b am 6e46a99f: am 3b0169ae: am a07421c6: am 2c461def: Merge "Fixed missing translation for wallpaper cropper" into lmp-dev
* commit '6e46a99fa5bbe3214a7adc56a301aa65ba436417':
  Fixed missing translation for wallpaper cropper
2014-10-10 23:21:10 +00:00
Selim Cinek
41de47c995 am 2c461def: Merge "Fixed missing translation for wallpaper cropper" into lmp-dev
* commit '2c461def93f235d3a7853851ee125cb3caaf2955':
  Fixed missing translation for wallpaper cropper
2014-10-10 21:18:41 +00:00
Selim Cinek
2c461def93 Merge "Fixed missing translation for wallpaper cropper" into lmp-dev 2014-10-10 21:14:34 +00:00
Selim Cinek
b7cde675a2 Fixed missing translation for wallpaper cropper
Also a fixed a small visibility issue.

Bug: 17927204
Change-Id: Ia9566fe8fe0c70f83edc295b0bf8317e94eb85fe
2014-10-10 13:55:36 -07:00
Christoph Studer
d55008d4b7 am efeb94a8: am a6a6f4b2: am a2830b7d: am 2c2cb29a: Merge "WallpaperCropper: Use white color for action bar" into lmp-dev
* commit 'efeb94a87d5598b486299202e35a72d4e46cde8b':
  WallpaperCropper: Use white color for action bar
2014-10-10 17:14:50 +00:00
Christoph Studer
d9364908bc am 2c2cb29a: Merge "WallpaperCropper: Use white color for action bar" into lmp-dev
* commit '2c2cb29a3d7f0a90d753b0fa9c32c1fc5cdbff32':
  WallpaperCropper: Use white color for action bar
2014-10-09 21:01:29 +00:00
Christoph Studer
9e8482062d WallpaperCropper: Use white color for action bar
Bug: 17343815
Change-Id: I5802f04204d081b97fbc2e2cb203fa03f16fea6a
2014-10-09 13:50:21 -07:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
Neil Fuller
f7cf5d43aa resolved conflicts for merge of ee665151 to lmp-dev-plus-aosp
Change-Id: I97671e62de26919e391dbb2686511584c59ab990
2014-10-02 11:48:08 +01:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Sunny Goyal
fabf1f23d6 Fixing memory leak in WallpaperCropActivity
issue: 15516788
Change-Id: I53a312addbb7ce17ecf02b2f14b9e991eab42be9
2014-07-23 10:52:32 -07:00
Adam Skory
0212c563c8 Squash unreachable catch
The compiler warning distracts me often.

Change-Id: Ia96e6c82ce1c0f1ae58f7faadbf8769b36d1f810
2014-06-05 14:38:30 +01:00
Alan Viverette
e3c38a0b0e Fix recents theme, add missing headers
Change-Id: Ib8eea6153eaf7e0e93e54c69fe59e63e98a409a6
2014-04-02 15:39:13 -07:00
Alan Viverette
6259933ec9 Switch framework Holo references to Quantum.Light
Change-Id: Ib545a143f1959b6104adbc9d594dd626851d90b3
2014-04-01 14:57:39 -07:00
Selim Cinek
49fb8aeff5 am c3db8011: am 58e99f56: am b6e077dc: am 7718fc12: Fixed crash when setting wallpaper with built in rotation
* commit 'c3db8011d7f7a5bcb0a9e5ae2d20022c6e88d8f9':
  Fixed crash when setting wallpaper with built in rotation
2014-03-27 23:16:51 +00:00
Selim Cinek
7718fc1291 Fixed crash when setting wallpaper with built in rotation
If an image had a built in rotation, a crash could occur,
when setting it. An example was a panorama image which had
a rotation of 90 degrees

Change-Id: Iede8226dac3a40f08d39a69162eb388e6aba97ec
Bug: 13507421
2014-03-27 19:34:01 +00:00
Selim Cinek
92a87e3026 am 50cd7c39: am f7805dd7: am 7290b56b: am 8ae8689d: am c41853ce: Fixed wallpaper bug where wrong size was taken when cropping
* commit '50cd7c39bb9f62d443a62d1f4af7f6ebc107f217':
  Fixed wallpaper bug where wrong size was taken when cropping
2014-03-25 21:18:45 +00:00
Selim Cinek
c41853cee8 Fixed wallpaper bug where wrong size was taken when cropping
When cropping, the selected area of the image was incorrectly
cropped to the size of the view instead of the size of the image

Bug: 13617446
Change-Id: If54a0891fa2cdeee70ba63752874f1543d401701
2014-03-24 13:53:06 +01:00
Selim Cinek
ba126c09a5 Disable Set Wallpaper button while loading image
Bug: 13534714
Change-Id: I45ff3436de40ea85fb22d776584d9f30f0795898
(cherry picked from commit 0fa6c1b146f7ed1aba335c30878e2c1b2bf2a8f1)
2014-03-21 22:15:10 +00:00
Adam Cohen
fb40d78c57 Merge "Catch exceptions if Exif is malformed" 2014-03-21 19:55:54 +00:00
Adam Cohen
146af201d3 Merge "Catching security exception when activity destroyed" 2014-03-21 19:54:55 +00:00
Selim Cinek
a4c1ccf3e0 Merge "Disable Set Wallpaper button while loading image" 2014-03-21 19:39:38 +00:00
Selim Cinek
5ab7d37d90 Catch exceptions if Exif is malformed
Bug: 11650650
Change-Id: Ie1680220fdb235a166a0eaa0a2309729f861865c
2014-03-21 20:32:34 +01:00
Selim Cinek
d6901a95d8 Catching security exception when activity destroyed
Fixed a bug where an asynctask tried to load an image
even after the activity was destroyed leading to a
security exception since the permission could not be granted anymore.

Bug: 12760267
Change-Id: Ieffb10b1007f349371647512ffe4fe72433344e7
2014-03-21 20:24:55 +01:00
Selim Cinek
0fa6c1b146 Disable Set Wallpaper button while loading image
Bug: 13534714
Change-Id: I45ff3436de40ea85fb22d776584d9f30f0795898
2014-03-21 19:19:08 +01:00
Adam Cohen
55b523cc3f Merge "[DO NOT MERGE] Fix wallpaper cropping bugs" into klp-dev 2014-03-19 20:16:11 +00:00
Michael Jurka
929e75e8d0 [DO NOT MERGE] Centering the crop by default in system wallpaper cropper
Bug: 12034934

Change-Id: Ice1b1140bd6e351dd4e520f555f245d84a645aac
(cherry picked from commit 2ab14daebac46307d2364733481edc3115bbf98c)
2014-03-19 17:57:17 +00:00
Michael Jurka
c82618c660 [DO NOT MERGE] Fix wallpaper cropping bugs
- take into account that image decoder might not
respect inSampleSize
- check rounded values so we don't have crop rects
that lie outside a bitmap's dimensions
- correctly set initial scale on bitmaps that are
larger than the screen size
- switch to using asynctask when setting wallpaper
dimensions
(cherry picked from commit e39c9a953ca11319b747b3aa79f4ccd082b775b7)

Change-Id: I43372f0bff37f139c8bc83f9956a967d0b4a8708
2014-03-19 17:56:55 +00:00
Selim Cinek
eb95e74e21 DO NOT MERGE - Fixed crash for odd image width/height
Due to an internal rounding in the renderer, the calculations
for the cropping area could be slightly offset, getting out
of the image boundaries. I sanitized the rect by ensuring they
are inside the image.

Bug: 12174629
Change-Id: Icc37790732ddd479631b898b23c05501d2dcd5be
2014-03-14 20:11:17 +00:00