Instead of polling every 15 minutes, register for alerts that trigger
when system-wide traffic passes a threshold. Still mixed with polling
to persist UID stats, but relaxed to 30 minutes. Currently watches
for every 512kB.
Make persistence decision separately for network versus UID, and use
total delta bytes when making decision. Use light bootstrap during
systemReady() instead of heavy poll, which had been force-loading all
UID data unnecessarily.
Bug: 5023631
Change-Id: I04b723d6c4bf872fb1028071122dba66a8e1b576
Add policy controls to NetworkStateTracker which are combined with
other user preference and internal flags to decide if data connection
should be established. Better locking around enabled flags.
When data network would be over limit, proactively disable data on
that network. Enable when policy is snoozed or when cycle resets.
Track and dismiss notifications from now-stale policies.
Bug: 4587023, 5178147
Change-Id: Ibfcc9f73cda7c369209af701b46eddd3d1943f2d
The new specification calls for LED to continue blinking until the user
pulls down the notification shade in the status bar.
Bug: 5143247
Change-Id: Id004cc3d1d9d76108329e57c6fbd8a8100068e0a
Signed-off-by: Mike Lockwood <lockwood@android.com>
...(when turning display on after recently turning it off)
Also clean up when we decide to turn the screen on to improve that
transition. There are still problems here with turning it on
before the wallpaper gets dispayed.
Change-Id: I2bc56c12e5ad75a1ce5a0546f43a845bf0823e66
This introduces a new facility for code during the boot process
to display messages to the user through a progress dialog. This
is only for use when performing longer-than-usual post-upgrade
operations such as running dexopt on applications or upgrading
databases.
Change-Id: I0e78439ccec3850fb67872c22f235bf12a158dae
As init now uses SIGKILL to stop daemons, performing graceful shutdown
becomes impossible. Here we implement our own solution by asking daemons
to monitor the control socket and terminate when it is closed.
Change-Id: I07a28807173a81b7f95e70f4193e974317acf88a
This fixes a crash caused by permission problems when we try to update
the password history and discover there's no password salt. The code
attempts to create the salt, which triggers the exception.
This could be fixed by wrapping the call with a clearCallingIdentity()/
restoreCallingIdentity(ident). However, while looking at it, it occurred to me
that this can cause unexpected failures if the DPM tries to set the
password twice or happens to set it to something in the password history.
Instead, we should *always* allow the DPM to reset the password to whatever it wants,
provided it passes the minimum password criteria.
Change-Id: I1505b24f9c097ee5c2c44e4bf378ba90095b113b
cryptfs has long-running operations that cause the Watchdog to fire
reliably when encrypting the filesystem. Disable Watchdog on
MountService for this reason.
Change-Id: Id03f5f60c704dcd74a8696ad9f32b5fba5381731
When restricting background data, show ongoing notification to give
easy access to re-enable. Deprecate getBackgroundDataSetting() API
to always return true, since NetworkInfo.isConnected() is new source
of truth. Handle upgrade path by reading from existing secure value,
and kick one last broadcast when changing value. Remove background
data code from ConnectivityService.
Remove warning alerts, since they push ifaces into restricted list;
should only happen when iface has limit.
Bug: 5163559, 5129421
Change-Id: I0064d9d643656a4d32aaae51d4a58bce49fe295f
There turn out to be two distinct bugs leading to runtime restarts.
The first, dating from at least Android 3.1, is that following certain kinds
of app crashes we properly clean up the drag-state bookkeeping, but aren't
prepared in the case of the drag-target timeout clock firing with a now-
null drag state in effect. We now catch that edge condition and don't NPE
(and note that there was already similar code around the separate timeout
when an app is *starting* the drag process).
The second bug is that some new-in-ICS code in the input channel management
wasn't prepared for certain cases where the current touch window could have
become unusable and its input channel torn down summarily in the case of the
aforesaid app crash during drag. The code now makes sure that there really
is an input channel that needs to be flushed / cancelled prior to attempting
that operation.
Fixes bug 5173534
Change-Id: Idaae158ecfb4b93456ab1425769b669962893c00
to avoid ID collisions with other system services.
Bug: 5161005
Change-Id: I069fbc40a8764bc85cceeacd04264abd32b62668
Signed-off-by: Mike Lockwood <lockwood@android.com>
Now the dumpsys battery output will show up in bugreports again.
Change-Id: Id36e87d27e9d3c06dcc17671c81aa1d3fe260d1e
Signed-off-by: Mike Lockwood <lockwood@android.com>
Currently legacy VPN only works on IPv4, and it should always
turn down when the addresses are changed. It assumed that the
interface will be brought down and up, so the event can be
detected via interfaceStatusChanged(). However, the assumption
was incorrect and the event is actually driver-dependent. To
fix this issue, ConnectivityService now tells VPN that the
interface is down when resetting IPv4 addresses.
Change-Id: I76d15e56552d86635c5b274ca980be5da905a6fb
Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background. Add AID_NET_BW_ACCT to
system_server so it can control counter sets.
Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage. Persisting still clusters by identity,
since that is heaviest object.
Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.
Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
Bug: 5161290
Replace mDisposeAfterWriteToParcel with code that takes advantage
of the standard Parcel API support for releasing resources after
writing a Binder reply.
This change makes it less likely that InputChannels will leak
accidentally when passed across a Binder.
Change-Id: Id37706e7b88d074e8e4ac687c88f0db8963200f2
- When shutting down, if the screen goes to sleep there is code
that tries to do a notifyAll without holding the lock:
java.lang.IllegalMonitorStateException: object not locked by thread before notifyAll()
at java.lang.Object.notifyAll(Native Method)
at com.android.server.am.ActivityStack.checkReadyForSleepLocked(ActivityStack.java:776)
at com.android.server.am.ActivityStack$1.handleMessage(ActivityStack.java:282)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.ServerThread.run(SystemServer.java:603)
- If an invalid Uri object is sent to the system process it can crash because
the Uri class throws an assertion while unmarshalling. Change this to an
IllegalArgumentException so it gets sent back to the caller:
java.lang.AssertionError
at android.net.Uri$PathPart.readFrom(Uri.java:2224)
at android.net.Uri$HierarchicalUri.readFrom(Uri.java:1106)
at android.net.Uri$1.createFromParcel(Uri.java:1689)
at android.net.Uri$1.createFromParcel(Uri.java:1681)
at android.content.IContentService$Stub.onTransact(IContentService.java:53)
at android.content.ContentService.onTransact(ContentService.java:120)
at android.os.Binder.execTransact(Binder.java:338)
at dalvik.system.NativeStart.run(Native Method)
- StrictMode can try to access the first index in the stack crawl of a stack crawl
array of length 0. Not sure why this happens, but make the code more robust:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ApplicationErrorReport$CrashInfo.<init>(ApplicationErrorReport.java:341)
at android.os.StrictMode$ViolationInfo.<init>(StrictMode.java:1978)
at android.os.StrictMode$AndroidBlockGuardPolicy.startHandlingViolationException(StrictMode.java:1097)
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1068)
at libcore.io.BlockGuardOs.read(BlockGuardOs.java:137)
at libcore.io.IoBridge.read(IoBridge.java:426)
at java.io.FileInputStream.read(FileInputStream.java:179)
at java.io.InputStream.read(InputStream.java:148)
at com.android.internal.os.ProcessStats.readFile(ProcessStats.java:804)
at com.android.internal.os.ProcessStats.getCpuSpeedTimes(ProcessStats.java:564)
at com.android.internal.os.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:545)
at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1470)
at com.android.server.am.ActivityManagerService.batteryNeedsCpuUpdate(ActivityManagerService.java:1522)
at com.android.internal.os.BatteryStatsImpl$MyHandler.handleMessage(BatteryStatsImpl.java:110)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1302)
(Also fix this code to not cause strict mode to trigger at all, because there is
no need, because this is just reading stuff from /proc.)
- The system seems to crash during boot if it thinks it needs to rotate
the screen, when it is trying to take the freeze snapshot way too early.
There is no need to freeze the screen during boot or if the screen is off:
java.lang.NullPointerException
at android.view.Surface.init(Native Method)
at android.view.Surface.<init>(Surface.java:256)
at com.android.server.wm.ScreenRotationAnimation.<init>(ScreenRotationAnimation.java:91)
at com.android.server.wm.WindowManagerService.startFreezingDisplayLocked(WindowManagerService.java:8758)
at com.android.server.wm.WindowManagerService.startAppFreezingScreenLocked(WindowManagerService.java:3971)
at com.android.server.wm.WindowManagerService.startAppFreezingScreen(WindowManagerService.java:4003)
at com.android.server.am.ActivityRecord.startFreezingScreenLocked(ActivityRecord.java:515)
at com.android.server.am.ActivityStack.ensureActivityConfigurationLocked(ActivityStack.java:3997)
at com.android.server.am.ActivityManagerService.updateConfigurationLocked(ActivityManagerService.java:12535)
at com.android.server.am.ActivityManagerService.updateConfiguration(ActivityManagerService.java:12439)
at com.android.server.wm.WindowManagerService.systemReady(WindowManagerService.java:6161)
at com.android.server.ServerThread.run(SystemServer.java:521)
Change-Id: I85062bb5f6b0909a0f52feedaa75e7611d9d7fbd
- Solves bug where an icon showed focus state on startup in Launcher. Once the keyboard arrows are used, Launcher enters non-touch mode as usual
Change-Id: I0080f3b72f6c22833c600a1026af0abc35024510