What is the function of Phone.PartialLock?

awama

Active Member
Licensed User
Longtime User
What is the function of Phone.PartialLock?

I have no effects on my phone.

Dim phone As PhoneWakeState

Phone.PartialLock '???
'Phone.ReleasePartialLock ' = end of .PartialLock

Many Thanks.

Walter
 

Ian Garton

Member
Licensed User
Longtime User
Is it normal behaviour that when using a PartialLock that the current activity is paused?
If so, what is the purpose of this lock? I can't find any symptoms of its behaviour.

The reason I'm looking at locks, is that I have an application which runs an SQL query from a service at an interval. This uses the httputils module and service. The call back from this requires an Activity module, and this all works fine when the device is running.
However I'd like the SQL query to still pull back the data and analyse even when the screen turns off or power button pressed.
Is this even possible?
 
Upvote 0

Jost aus Soest

Active Member
Licensed User
Longtime User
Is it normal behaviour that when using a PartialLock that the current activity is paused?

No.

If so, what is the purpose of this lock? I can't find any symptoms of its behaviour.

The lock is to avoid that the device goes to sleeping mode.
Or that the brightness changes.
For details see the documentation links given above.

However I'd like the SQL query to still pull back the data and analyse even when the screen turns off or power button pressed.

So you don't want to lock anything, do you?
 
Upvote 0

Ian Garton

Member
Licensed User
Longtime User
So you don't want to lock anything, do you?

I don't mind the screen turning off, but I need the Activity to still run.

For some reason the partial locking seems to do nothing on my device - Galaxy Nexus.
According to the log, the activity is paused each time the device turns off itself after inactivity.
 
Upvote 0

Ian Garton

Member
Licensed User
Longtime User
Is there anyway a service can be used as a callback for HttpUtils?
Or will I have to use HttpClient directly in the service and not use Httputils and HttpUtilsService?
 
Upvote 0
Top