Commit Graph

103 Commits

Author SHA1 Message Date
Danesh M
e1ba9407f7 CMSDK : Fix generateAlertColorFromDrawable for non BitmapDrawable
In the case that the bitmap being passed in was not a bitmap drawable,
we were not retaining any of the attributes from the original drawable.
This patch ensures we ask that drawable to draw on the canvas/bitmap so we
can use that information. Also add tests around it.

Change-Id: I3eefba6e6624fe0bed4965ddf9029320c40f7420
2016-08-14 21:57:37 -07:00
d34d
131de78e2e Themes: Provide 100% test coverage for themes
This patch completes the ThemeManagerTest and thus brings the themes
package to 100% test coverage! \o/

Change-Id: I3bdb41781f127c9554c83f56503d591371031a23
TICKET: CYNGNOS-3029
2016-06-24 13:20:46 -07:00
d34d
f4dd414643 Themes: Fix ThemeManagerTest
This fixes the assmption that a device will have a default theme
declared in CMSettings, which is not always the case.  If no default
theme package is defined in CMSettings we use ThemeConfig.SYSTEM_DEFAULT
instead.

Change-Id: If7952ea984eea0accf3d0990871fb11e3ccc373a
2016-06-20 10:43:00 -07:00
Luis Vidal
b25a32413c Weather API test: Wait for a bit before Mockito verifies if method was called
Sometimes the runnable posted to runOnServiceThread() might run a bit
faster than the calls made to the mocked weather provider, which causes
Mockito to throw an exception. Add a timeout to instruct Mockito to
wait for a bit before it verifies if the method was actually called.

Also removed an unused variable in CMWeatherManagerTest

TICKET: CYNGNOS-3043
Change-Id: I53b6541aeb571a6c83d1c26b6723d74c3661e8cc
2016-06-16 16:05:42 -07:00
Adnan Begovic
3251a4506f cmsdk: Increase flaky test tolerance on zenmode tests.
Change-Id: Iff5522913a518b403bf580152d4890ed1e4d275e
TICKET: CYNGNOS-3014
2016-06-16 14:07:26 -07:00
Adnan Begovic
0b76a46515 cmsdk: Provide test coverage for remainder PartnerInterface's.
TICKET: CYNGNOS-3051

Change-Id: I1c15516dc03d3c0897cdd35f22281b25eedb84de
2016-06-16 13:54:13 -07:00
Adnan Begovic
afa47a7973 cmsdk: Provide remainder test coverage for CMStatusbarManager.
Change-Id: I4cfa89ac3d9e27b234c3209c203f2a3f2bf9c46b
TICKET: CYNGNOS-3050
2016-06-16 11:08:28 -07:00
Adnan Begovic
5d5e556c49 cmsdk: Provide remaining ProfileManager test coverage.
TICKET: CYNGNOS-3046

Change-Id: I42792fe03fd7c218bec6f997115bd79bb8e97403
2016-06-16 11:08:28 -07:00
Adnan Begovic
9b50627030 cmsdk: Provide remaining Profile test coverage.
Change-Id: Ief60939e92c1e8efe700410e3e23a0eeff744364
TICKET: CYNGNOS-3046
2016-06-16 11:08:28 -07:00
Luis Vidal
3f8b3b3862 Provide remaining Weather API test coverage
Change-Id: I15acbb4193158e7b2b98f7298b1774e1a1bc0cc2
TICKET: CYNGNOS-3043
2016-06-15 16:52:24 -07:00
Danesh M
c701b8ea6e CMSDK : Add tests for ColorUtils
CYNGNOS-3047

Change-Id: Icdea3bd18f80302eb421cbd572abc9e6eeb30f0a
2016-06-15 13:38:40 -07:00
Danesh M
60c6053a92 CMSDK : Fix external view test
Java's assert doesn't really do much on android and just returns true, which
makes you feel good about your tests, but its just lying to you. On the long run
its best that you know the real result and fix it, hence switch to JUnit's assert.

CYNGNOS-3042

Change-Id: If7e5982b10abc1f842a52110973566818b1e3bf4
2016-06-15 13:38:22 -07:00
Danesh M
912410f27d CMSDK : Add LiveLockScreenManager tests
CYNGNOS-3048

Change-Id: I5a372d23028c43a3952199b8ad70854bec2dc7a1
2016-06-15 13:38:03 -07:00
Danesh M
b6e71bc544 External view test
CYNGNOS-3042

Change-Id: Ibdd11b631c6deea3eb030ffb1ba55b6ca5fe022b
2016-06-14 13:14:35 -07:00
Adnan Begovic
7fff40e2d0 cmsdk: Clean up posted tile in CustomTileListenerService test.
TICKET: CYNGNOS-3022
Change-Id: If0c2e18b86c5d2061fd36d404d9e63496998c25f
2016-06-14 11:29:12 -07:00
Adnan Begovic
8387d3cc07 cmsdk: Add CustomTileListenerService tests.
Change-Id: Ife06dc7672efded1d6ce34afce2d3d3954c50d1f
TICKET: CYNGNOS-3022
2016-06-13 11:37:04 -07:00
Adnan Begovic
0e0cb73c61 cmsdk: Provide test coverage to Profile's *Settings classes.
Change-Id: I775cdd00e7e5cfbead681d548075f44d5799bccf
TICKET: CYNGNOS-3027
2016-06-13 11:35:38 -07:00
Adnan Begovic
2add3de267 cmsdk: Provide tests for Profile.ProfileTrigger interfaces.
Change-Id: I2ece6365defdd126c2cce1bbdf1ccc7d671d3a70
TICKET: CYNGNOS-3021
2016-06-13 11:28:07 -07:00
Adnan Begovic
fda1fc6843 cmsdk: Provide coverage for serial number and unique device id.
Tests for unique device id are enforced to be implemented correctly
  on user builds.

Change-Id: I1c6b24bbf68fe1dce645744f8323c869fdeb9ada
TICKET: CYNGNOS-3026
2016-06-09 15:37:46 -07:00
Adnan Begovic
7a48ce3b42 cmsdk: Add test package to CMTS targets.
Change-Id: Iddb3ab6c5361875567e816c004ce4d6c438210ba
2016-06-07 10:43:41 -07:00
Adnan Begovic
39f001274e cmsdk: Provide themescontract tests.
TICKET: CYNGNOS-3015
Change-Id: Ice714eb144c7da7e03abd0423f3cfe4b0574067e
2016-06-07 10:42:14 -07:00
Adnan Begovic
70d3b76d2a cmsdk: Add binder transaction id tests for api 5 interfaces.
Change-Id: I693f09266dab763141e3957392fb82c4fb7344a0
2016-06-04 11:56:52 -07:00
Adnan Begovic
ef4a783b6e cmsdk: Skip powersave during testing.
Since powersave is ignored while the device is plugged in,
  and switching pluggedmodes via runtime executing dumpsys commands
  is blocked by sepolicy. Ignore the powersave portion of the test.

Change-Id: Ia2b206649a7fc1960cc25d16ffd22379e7c616e3
TICKET: CYNGNOS-2603
2016-05-20 15:47:52 -07:00
Adnan Begovic
94dd91a34c cmsdk: Fix PerformanceManagerTest expectations.
Since the API for PerformanceManager returns the number
  of profiles supported we can assume what the profiles are
  since the HAL provides them in an ordered manner. Thus,
  iterate through the size of the number of profiles and verify
  each one that's possible.

Change-Id: I87f6d1a847c849bd9e544c1e89a666726c61fe83
TICKET: CYNGNOS-2603
2016-05-02 10:33:21 -07:00
Steve Kondik
bf3c0cf948 cmsdk: Add CMAudioManager
* This is a rework of the session callback API which previously
   lived in the framework due to JNI usage. This has been split out
   and cleaned up for CMSDK.
 * The JNI library lives on the server side, and the app-level
   callback has been changed to a protected broadcast. This allows
   us to wake up registered services when these events occur.
 * Additionally, we support listing all active audio sessions.
 * Also brings some JNI love/hate over to CMSDK.

Change-Id: I31c293943474419e3db088bb7ffab75f7440ac0f
2016-04-27 22:13:36 -07:00
Steve Kondik
4595cfde0b livedisplay: Add some unit tests
* Test color temperature control and mode selection

Change-Id: Icc4fffef4c64cf3424e30890b5a4a37154482b3a
2016-04-26 01:18:19 -07:00
Luis Vidal
ab3916fd2a Add Weather API test coverage
Test coverage for:
- DayForecast.Builder
- ServiceRequestResult.Builder
- WeatherInfo.Builder
- WeatherLocation.Builder

Change-Id: I66e716fa7a768b095e4b72011eda359b06a55f2e
TICKET: CYNGNOS-2491
2016-04-20 10:27:10 -07:00
d34d
ea7d71200d cmsdk: Add test coverage for parceling LiveLockScreenInfo
Change-Id: I75898014f211075bdec06a00289837e1df6f3a84
2016-04-01 15:12:50 -07:00
d34d
3757686b93 cmsdk: Add test coverage for LiveLockScreenInfo.Builder
Change-Id: If802d3fcb5b1941d641d08beabbec9882c8ea451
2016-04-01 15:12:09 -07:00
Adnan Begovic
3726f6bcb9 cmsdk: Add test coverage for parceling of ThemeChangeRequests.
Change-Id: Id0cb15133de1ab5c202417837b7b72e3d3937958
TICKET: CYNGNOS-2307
2016-03-31 17:58:35 -07:00
Adnan Begovic
3916ed759c cmsdk: Add test coverage for ThemeChangeRequestBuilder and object.
Change-Id: I24894d50c6e28939e5f5c3497e0279dbb45ca851
TICKET: CYNGNOS-2307
2016-03-31 17:58:30 -07:00
Adnan Begovic
22859efbfd cmsdk: Add preliminary ThemeManager test coverage.
TICKET: CYNGNOS-2307
Change-Id: Ie94ae3cd55678ecb2c631dc10d2335fb5d7362a7
2016-03-31 17:58:24 -07:00
Adnan Begovic
eafcdbd229 cmsdk: Create Concierge parcel handler concept.
Simply, Concierge handles your parcels and makes sure they
  get marshalled and unmarshalled correctly when cross IPC
  boundaries even when there is a version mismatch between the client
  sdk level and the framework implementation.

 On incoming parcel (to be unmarshalled):
     ParcelInfo incomingParcelInfo = Concierge.receiveParcel(incomingParcel);
     int parcelableVersion = incomingParcelInfo.getParcelVersion();

     // Do unmarshalling steps here iterating over every plausible version

     // Complete the process
     incomingParcelInfo.complete();

 On outgoing parcel (to be marshalled):
     ParcelInfo outgoingParcelInfo = Concierge.prepareParcel(incomingParcel);

     // Do marshalling steps here iterating over every plausible version

     // Complete the process
     outgoingParcelInfo.complete();

Change-Id: I0096851e08ce25908e19e39e6bc4af344e85725e
2016-03-31 17:58:11 -07:00
Adnan Begovic
b271dcf279 cmsdk: Mandate partner feature xml's for service implementation.
The feature xml plays two roles:

      1) To allow sdk interface (constructor) to throw when system
      service is unavailable. This allows for clearer platform
      development debugging.

      2) To allow for simpler disambiguation of what services to
      instrument in a modular environment.

Change-Id: Ic980225df9c115e97f7147cf043cf92bbb225f01
TICKET: CYNGNOS-2293
2016-03-25 14:16:35 -07:00
Adnan Begovic
279ce42664 cmsdk: Mandate performance feature xml's for service implementation.
The feature xml plays two roles:

      1) To allow sdk interface (constructor) to throw when system
      service is unavailable. This allows for clearer platform
      development debugging.

      2) To allow for simpler disambiguation of what services to
      instrument in a modular environment.

Change-Id: I50f5993ff9c5107fdeaa9a5aa95377235eb3ac02
TICKET: CYNGNOS-2294
2016-03-25 14:14:14 -07:00
Adnan Begovic
21a567428d cmsdk: Mandate profile feature xml's for service implementation.
The feature xml plays two roles:

      1) To allow sdk interface (constructor) to throw when system
      service is unavailable. This allows for clearer platform
      development debugging.

      2) To allow for simpler disambiguation of what services to
      instrument in a modular environment.

TICKET: CYNGNOS-2288
Change-Id: Id0adcc1eaa4a0512faf25f11057c45dc2ac733e0
2016-03-24 16:50:56 -07:00
Adnan Begovic
cdf85adde1 cmsdk: Mandate cm sb feature xml's for service implementation.
The feature xml plays two roles:

      1) To allow sdk interface (constructor) to throw when system
      service is unavailable. This allows for clearer platform
      development debugging.

      2) To allow for simpler disambiguation of what services to
      instrument in a modular environment.

TICKET: CYNGNOS-2289
Change-Id: Ice0ae7c45aecbb34e0ea667128b040906c46d7e7
2016-03-24 16:50:40 -07:00
Adnan Begovic
a335ba39c2 cmsdk: Mandate cmhw feature xml's for service implementation.
The features xml plays two roles:

      1) To allow sdk interface (constructor) to throw when system
      service is unavailable. This allows for clearer platform
      development debugging.

      2) To allow for simpler disambiguation of what services to
      instrument in a modular environment.

Change-Id: I41f4ac60af076743909c6090fd50c3ad045bc9e1
2016-03-15 14:09:04 -07:00
Adnan Begovic
b4eafda7de cmsdk: Add PerformanceManager tests, Change target permission.
Since PerformanceManager is strictly a CyanogenMod construct,
  it doesn't make sense to enforce the interfaces with an android
  specific permission (even though the implementation is delegated
  to power manager). To keep consistency with the other api's,
  modify the enforcing permission to a cm specific declaration.

  Also add test cases for the PerformanceManager public interfaces.

Change-Id: I430b69dbee73bf94bb60932d1942ab97e3ba193e
2016-03-08 09:24:34 -08:00
Adnan Begovic
7ed4fcaf8e cmsdk: Keep generated java classes from aidl interfaces.
Keep any classes extending IInterface so we can have
  the BinderTransactionTest run successfully.

Change-Id: Ic49794017e472499cbbf351dfa12732854ceea8d
TICKET: CYNGNOS-2189
2016-03-08 09:24:32 -08:00
Adnan Begovic
c0bd6d0882 cmsdk: Clean up proguard flags.
-dontskipnonpubliclibraryclasses and class members covers
  the processing of external libraries which makes the -injars
  option defunct.

  Also keep more android support related classes for when we expand
  the test package for more coverage.

TICKET: CYNGNOS-2189
Change-Id: I37b66acdac86400f41d1f7f1e6610d1d9ca480b3
2016-03-08 09:24:31 -08:00
Adnan Begovic
873364cfca cmsdk: Remove debugging from proguard.
TICKET: CYNGNOS-2189
Change-Id: Ia45f1e31bc23dcffc5a7f9923e268f9ad513df2a
2016-03-04 16:08:15 -08:00
Adnan Begovic
ba01275cb4 cmsdk: Strip unused cmsdk members for codecoverage.
Change-Id: Id5437b11168d0dfd222cfc4abef2fc03629a17ca
TICKET: CYNGNOS-2189
2016-03-04 15:24:26 -08:00
Adnan Begovic
9c902f898e cmsdk: Update binder transaction tests for new interfaces.
Change-Id: I79352dc36a4934f9821c5b487df0fb19a7ebc693
2016-02-22 14:39:15 -08:00
Adnan Begovic
eb17396831 cmsdk: Add concept of parameterized BinderIdTransactionTest.
To avoid any future release having offset binder transaction
  call ids, create a means to validate binder transaction ids
  within a parameterized environment based off of prior releases.

  This requires utilizing the new android testing support library
  for junit4 support.

Change-Id: Iefe3c183de2bdfa127ea53dcf21c8223f0355c34
2016-02-05 13:52:31 -08:00
Adnan Begovic
a6ce9b8325 cmsdk: Annotate a few zenmode tests as flaky.
This allows them to rerun without consequence to
  the entire suite on first failure case.

Change-Id: Ia16b3dc433a7b9c83d36f8039b53052fda91c4b7
2016-02-03 16:49:18 -08:00
Matt Wagantall
eb82dbf050 cmsdk: cmhw: Add UniqueDeviceId support
It's sometimes useful to know what physical device you're using.

CMHW SerialNumber and an "ro.serialno" property already exists, but
are not guaranteed to be unique. Different OEM may use overlapping
numbering schemes, and sometimes placeholder like "012345ABCDE" are
used.

Attempt to work around these shortcomings by defining a new
UniqueDeviceId class that provides a globally unique device ID that
is both deterministic for a given device and designed not to overlap
with IDs of any other devices.

Change-Id: I3f426972558394ba8e78261273ac8521aa603327
2016-02-02 16:37:59 -08:00
Khalid Zubair
a3c05bf3ff Revert "cmsdk: Add example service test."
This reverts commit 33e300e32d.

CYNGNOS-1677

Change-Id: Ia4a9d192fde03152d308f7a93f3fe6525cb57c7d
2016-01-26 11:00:27 -08:00
Khalid Zubair
25a71471ae Revert "cmsdk/tests: Temp hack to fix mka builds."
This reverts commit 969cda0807.

CYNGNOS-1677

Change-Id: Ic814b7af9e9d1aef725b310af9f3b0383701eec7
2016-01-26 10:59:09 -08:00
Scott Mertz
62579b157a cmsdk: add invalid input checking for persistent storage APIs
Some of this exists in the PersistentStorage implementation, but it
was never formally documented in the APIs.  Inherit the cmhw implementation
error checking & move it into the service.

Add tests to validate the new restrictions & a test that was previously
failing.

Change-Id: I3ecda29fdd28bbc4e6d8ccce7511c4644065ea46
2016-01-22 16:24:33 -08:00