(+Bcc dev-b2g)

Hi Terry!

Thanks for bringing up this topic. There are already some bugs related to this. 
Check [1], [2] and for low device storage topic in general [3].

I totally agree about the need of this API. However, I think that we might 
probably keep it a bit simpler :)

>>> Therefore, we need some web API to support the feature.
>>> For a detail application, we need:
>>>    -stop()--to force stop the application
>>>    -isRunning()--to check if the application is running
>>>    -clearAppData()--to clear data of an application
>>>    -getDataSize()--to calculate the size of an application
>>> For applicationMgmt,
>>>    -getRunningApps()

Correct me if I am wrong please, but I think that you are suggesting to expose 
"isRunning()" and "stop()" functions so the application which data we want to 
clear can be stopped (if it is running) before calling "clearAppData()". Am I 
right? In that case, why not just adding that functionality within the 
"clearAppData()" implementation? I mean, "clearAppData" should check if the app 
is running, stop the application in that case and then clear its data. This way 
we can get rid of "isRunning()" and "stop()".

I agree with Fabrice that "getRunningApps()" is also not needed.

So the API would be like:

partial interface Application {
  DOMRequest clearAppData(DOMString type);
  DOMRequest getDataSize(DOMString type);
};

I am not sure about the usage of Promise instead of DOMRequest though. I think 
that we are supposed to start using Promise, but I am not entirely sure that we 
want to mix DOMRequest and Promise in the same API (we probably don't) instead 
of migrating the entire API at once. In any case, that's something to be 
discussed later.

We also probably need to revisit the "type" values that you are suggesting at 
[4], but I think that's the basic idea.

Thanks!

/ Fernando

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=882098
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=862408
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=861898
[4] 
https://github.com/yinjun/AppManager/commit/e9ddb0728ce1c61d8ba387796c3689f19c418591#L0R112
_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to