Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[battery] use context properties #232

Merged
merged 1 commit into from
Feb 25, 2015
Merged

[battery] use context properties #232

merged 1 commit into from
Feb 25, 2015

Conversation

deztructor
Copy link
Contributor

QBatteryInfo provides more information than needed, using context properties (as
also for information about PSM).

What is removed: 100mA charging from SDP or invalid charger can't be tracked by
this layer reliably, so do not show NotificationNoEnoughPower w/o support from
underlying middleware.

Signed-off-by: Denis Zalevskiy denis.zalevskiy@jolla.com

batteryNotifier->applyChargingState(0, QBatteryInfo::Charging);
batteryNotifier->notificationTimer.stop();
batteryNotifier->applyChargingState(0, QBatteryInfo::UnknownChargingState);
QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you comment why you comment these out?:)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is no notificationTimer now

@deztructor
Copy link
Contributor Author

Removed non-applicable or duplicated unit tests. Unified prepareNotification() function.

@deztructor
Copy link
Contributor Author

Any comments? I am going to merge it today.

@sledges
Copy link
Contributor

sledges commented Feb 20, 2015

LGTM

QBatteryInfo provides more information than needed, using context properties (as
also for information about PSM).

What is removed: 100mA charging from SDP or invalid charger can't be tracked by
this layer reliably, so do not show NotificationNoEnoughPower w/o support from
underlying middleware.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
@chriadam
Copy link

I tried to build this locally, and got:

make[2]: Entering directory `/home/chriadam/Jolla/depot/homescreen/lipstick/tools/notificationtool'
g++  -o notificationtool notificationtool.o notificationmanagerproxy.o moc_notificationmanagerproxy.o   -L../../src -llipstick-qt5 -lmlite5 -lQt5Gui -lQt5DBus -lQt5Core -lGLESv2 -lpthread 
/srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so: undefined reference to `qtaround::mt::deleteOnApplicationExit(std::shared_ptr<qtaround::mt::Actor>)'
/srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so: undefined reference to `qtaround::mt::Actor::postEvent(QEvent*)'
/srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so: undefined reference to `qtaround::mt::Actor::createSync(std::function<std::unique_ptr<QObject, void (*)(QObject*)> ()>, QObject*)'
collect2: ld returned 1 exit status
make[2]: *** [notificationtool] Error 1

Is there a BuildRequires version bump or something missing from the .spec file? Or have I forgotten something obvious?

@deztructor
Copy link
Contributor Author

@chriadam Hm, statefs-qt5 has explicit "BuildRequires: pkgconfig(qtaround) >= 0.2.4", so libcontextkit-statefs-qt5.so should be linked with proper libqtaround.
What does ldd /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so show there?

@chriadam
Copy link

$ ls -al /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so
-rwxr-xr-x 1 chriadam chriadam 86276 Feb 9 14:25 /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so
$ ldd /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so
not a dynamic executable
$ file /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so
/srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=d676edd7d58d3b85fdfef3c3abb9ff55d08f7d38, stripped
$ nm -C /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so
nm: /srv/mer/targets/jolla-qt5/usr/lib/libcontextkit-statefs-qt5.so: no symbols

@chriadam
Copy link

Heh, thanks to a suggestion from Robin, I ran ldd under sb2, and got some real output:

$ ldd /usr/lib/libcontextkit-statefs-qt5.so
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x48832000)
libstatefs-qt5.so => /usr/lib/libstatefs-qt5.so (0x48b5b000)
libqtaround.so.1 => /usr/lib/libqtaround.so.1 (0x48b71000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x48ba0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x48c52000)
libc.so.6 => /lib/libc.so.6 (0x48c6a000)
/lib/ld-linux-armhf.so.3 (0x40801000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x48d6f000)
libpthread.so.0 => /lib/libpthread.so.0 (0x48da2000)
libz.so.1 => /usr/lib/libz.so.1 (0x48dc5000)
libicui18n.so.52 => /usr/lib/libicui18n.so.52 (0x48dee000)
libicuuc.so.52 => /usr/lib/libicuuc.so.52 (0x48f46000)
libpcre16.so.0 => /usr/lib/libpcre16.so.0 (0x4904a000)
libdl.so.2 => /lib/libdl.so.2 (0x49095000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x490a8000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x490ba000)
librt.so.1 => /lib/librt.so.1 (0x491aa000)
libsystemd-journal.so.0 => /usr/lib/libsystemd-journal.so.0 (0x491c0000)
libsystemd-id128.so.0 => /usr/lib/libsystemd-id128.so.0 (0x491e5000)
libm.so.6 => /lib/libm.so.6 (0x491fb000)
libcor.so.0 => /usr/lib/libcor.so.0 (0x49270000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x492a0000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x4930f000)
libicudata.so.52 => /usr/lib/libicudata.so.52 (0x49336000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x4a9b1000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x4aa02000)
libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0x4aa2a000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x4aa96000)

@chriadam
Copy link

Not sure what happened - after a zypper ref -f && zypper dup inside scratchbox, it now builds correctly.

@chriadam
Copy link

Tested on device, seems to work nicely.

@deztructor
Copy link
Contributor Author

@chriadam the interesting part is that libqtaround.so.1 => /usr/lib/libqtaround.so.1 (0x48b71000) is present. I wonder why it missed references to qtaround::mt::deleteOnApplicationExit etc. Maybe I did not increased soversion when introduced changes in qtaround. I need to check but this is not related to this PR :)

Thank you for verifying it!

deztructor pushed a commit that referenced this pull request Feb 25, 2015
[battery] use context properties
@deztructor deztructor merged commit 6693db5 into master Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants