The POLICY_REJECT_BACKGROUND policy requires that network traffic be
blocked when a UID goes into the background. Even if the UID has an
activity in the foreground, it's considered "background" if the screen
is turned off.
This changes watches for SCREEN_ON/OFF broadcasts, and rule generation
now observes screen state. It also introduces an observer pattern so
that ActivityManager doesn't directly know about NetworkPolicy, and
moves the service management into SystemServer.
Change-Id: Ie7a84929d3ca60ae4578d47e19d5a8da10fd8d58
This is the type returned by event.getX/Y methods. Conversion
to ints is only performed when needed. Low performance impact
since there is only a minimal amount of computations on these
values.
Change-Id: I53a56efe5e3a1a96911adc25fedaab7f40f1ba8e
* commit '7dfdb914206eafbf2aa4533e9b6a50428a5d0d3d':
Change measurement of effective screen height for PopupWindow now that DisplayMetrics reports it without system decorations.
This is needed for specific TextEdit (such as AutoCompleteTextField)
which do not want to display the "No suggestions available" message.
Bug 4443830
Change-Id: Ic228b56bacfdf2765e70eb24952ab087556c1f93
The current browser pause/resume logic uses an integer count to track
the pause/resume behavior, which is mostly working fine in phone. The interger
count is usually 0 when browser is paused, and its value is usually 1
when the browser is resumed and will trigger any delayed timer.
But in tablet, where tabs can be easily created/switched/deleted, this
logic will not work well and sometimes cause resources timers get stuck.
For example, in case multiple tabs are created, and you reload one of the
tabs, when it's almost finished, switch to another tab, and hit home or power
button, at this point of time, the browser will be suspended at
Controller.java::onPause, hence the integer count will be 0; but since
the other tab is also finished after the pause, the current logic at
Controller.java::onPageFinished will call pause timer again, which will make
the integer count to be -1. Before the time the browser is resumed, it's very
possible some tabs will have some resources, such as images/flashs,
scheduled to be loaded, these will be in delayed timer in
ResourceLoadScheduler.cpp's m_requestTimer.
Now when the browser is resumed, the integer count will be 0, which will not
trigger delayed timer. Then all the new timers will be stuck as well since
old timers are not executed yet.
The fix is to simplify the pause/resume logic by just using a boolean variable
instead of error-prone integer counting.
issue: 4177932
Change-Id: Id10af9298c7be1f82222d0b94c34c5dc68403630
Added startDataProfiling() and stopDataProfiling() to TrafficStats,
which can be used by apps to measure network usage delta between two
points in time. Currently takes two NetworkStats snapshots and returns
delta, which will eventually include tag-level granularity. Added
tests for NetworkStats delta subtraction.
Added NMS.getNetworkStatsUidDetail() that returns stats for specific
UID. Always gives stats access for the calling UID, otherwise enforces
that caller has permission. Fix readSingleLongFromFile(), since
/proc/ files don't have well-defined lengths.
Change-Id: Ic5b6414d8effbd66846e275b00d4b8a82c74589d
* commit 'f483ed90401d63b7317f823fcac10315146d3072':
Change measurement of effective screen height for PopupWindow now that DisplayMetrics reports it without system decorations.
* commit 'bdc26dc34a5d848883d5acdee62f5b4403e8fe04':
Change measurement of effective screen height for PopupWindow now that DisplayMetrics reports it without system decorations.
* New opaque assets (now actually opaque!)
* SearchDialog determines theme to use from parent context
* SearchDialog now disallows action modes
Change-Id: If05fe64d7cc4460678d78412275ee988ddb47e9e