BatteryTest::BatteryTest(QObject *parent) :
    QObject(parent)
{
	ContextProperty *property = new ContextProperty("Battery.OnBattery",this);

	property->subscribe();
	property->waitForSubscription();

	connect(property,SIGNAL(valueChanged()),this,SLOT(valueChanged()));

	qDebug()<<"initial value: "<<property->value().toBool();
}
void MDeclarativeScreenPrivate::initContextSubscriber()
{
#ifdef HAVE_CONTEXTSUBSCRIBER
    //waiting for properties to synchronize
    topEdgeProperty.waitForSubscription();
    isCoveredProperty.waitForSubscription();
    keyboardOpenProperty.waitForSubscription();

    QObject::connect(&topEdgeProperty, SIGNAL(valueChanged()),
            q, SLOT(_q_updateOrientationAngle()));
    QObject::connect(&isCoveredProperty, SIGNAL(valueChanged()),
            q, SLOT(_q_isCoveredChanged()));
    QObject::connect(&keyboardOpenProperty, SIGNAL(valueChanged()),
            q, SLOT(_q_updateOrientationAngle()));


    //initiating the variables to current orientation
    _q_updateOrientationAngle();
    if (orientation == MDeclarativeScreen::Portrait)
        // make sure we notify the input method
        _q_setOrientationHelper();
    _q_isCoveredChanged();
#endif
}