6863 Commits

Author SHA1 Message Date
Eric Laurent
497b3fe725 Issue 5081351: isWiredHeadsetOn() permission.
AudioManager.isWiredHeadsetOn() should not require permission MODIFY_AUDIO_SETTINGS.
Remove permission checks on all getters in audio policy manager as permission enforcement
is really usefull for setters.
Also deprecate AudioManager.isWiredHeadsetOn() which name and implementation are deceptive.

Change-Id: I38f8df7c26c0d417bf0e2b74e4c11c2d143f2ecd
2011-08-12 17:43:35 -07:00
Mathias Agopian
7b53848d14 Merge "fix an orientation change drawing artifact." 2011-08-12 17:13:01 -07:00
Mathias Agopian
b290b5e3cb fix an orientation change drawing artifact.
a wrong orientation would be briefly shown when
rotation the screen. this happened when the window manager
set a custom transformation and the h/w composer was used.

the custom transformation was applied twice in that case.

Bug: 5037522
Change-Id: Ic1f87b63cd843f4475e4265d1624463825d775c4
2011-08-12 17:09:09 -07:00
Dianne Hackborn
7c0d8472d0 Merge "Fix some crashes that are happening in the system process." 2011-08-12 15:22:32 -07:00
Marco Nelissen
2255a1e64f Don't remove effects on session 0
b/5159902
Change-Id: Id6f29fb1c687069f7480dd81d4745a558f202226
2011-08-12 14:54:56 -07:00
Dianne Hackborn
8e8d65ff5f Fix some crashes that are happening in the system process.
- 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
2011-08-12 14:20:59 -07:00
Mathias Agopian
91b5398018 SurfaceFlinger doesn't rely on having a custom RefBase destructor
we just use a message to the main thread to
destroy our GLES state.
2011-08-11 22:33:02 -07:00
Michael Jurka
b858ec559e Merge "On device startup, be in touch mode" 2011-08-11 19:49:15 -07:00
Michael Jurka
e99adc70c8 On device startup, be in touch mode
- 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
2011-08-11 18:28:01 -07:00
Jeff Brown
61bb11cfa0 Merge "Ensure outValue is set, even when an error occurs." 2011-08-11 18:26:11 -07:00
Jeff Brown
2749668e36 Merge "Exorcise notification panel ghosts. Bug: 5105599" 2011-08-11 17:23:38 -07:00
Jeff Brown
64e35bb006 Merge "Improve touch device configuration. Bug: 5064702" 2011-08-11 17:23:05 -07:00
Jeff Brown
063097545e Ensure outValue is set, even when an error occurs.
Change-Id: If883f60cde28792bd0e108597ced49d69d13136e
2011-08-11 17:10:06 -07:00
Jeff Brown
8bcbbefa3b Exorcise notification panel ghosts.
Bug: 5105599

Don't clear slot data when slot is no longer in use.

The kernel will not resend absolute slot values if they are
unchanged, even if the slot was previously marked unused.

Because the protocol is stateful, this could cause problems if
evdev drops events (marked by SYN_DROPPED) since we cannot
query the initial values of the slots, but there's nothing
we can do.

Change-Id: Ie13e68097fb8ed2542c2f60338b499082cf9e77f
2011-08-11 15:54:54 -07:00
Christopher Tate
7bc4827e36 Merge "Fix partial-read handling during restore" 2011-08-11 15:07:25 -07:00
Jeff Brown
a1f89ceec0 Improve touch device configuration.
Bug: 5064702

This change improves compatibility with standard touch device
drivers.  All existing touch device IDC files will need to
be updated because the input system now assumes that the
touch device drivers implement the multitouch input
protocol correctly and use the appropriate axes.

Change-Id: I93aad0e011efea74fbc7fa3da31f7967aff8136c
2011-08-11 14:57:50 -07:00
Eric Laurent
45bd6086cc Merge "Audio effects: track CPU and memory use separately" 2011-08-11 14:40:04 -07:00
Eric Laurent
6752ec80b2 Audio effects: track CPU and memory use separately
Before this change, CPU and memory usage for an audio effect were
registered and checked against the limit by audio policy manager
upon effect instantiation. Even if an effect was not enabled
it would prevent another effect to be created if the CPU load budget
was exceeded, which was too restrictive.

This change adds a method to register/unregister CPU load only when
an effect is enabled or disabled.
It also adds a mechanism to place all effects on the global output mix
in suspend state (disabled) when an effect is enabled on a specific session.
This will allow applications using session effects to have the priority
over others using global effects.

Also fixes some issues with suspend/restore mechanism:
- avoid taking actions when an effect is disconnected and was not enabled.
- do not remove a session from the suspended sessions list when corresponding
effect chain is destroyed.

Change-Id: I5225278aba1ae13d0d0997bfe26a0c9fb46b17d3
2011-08-11 14:33:45 -07:00
Kenny Root
e342551e56 Merge "Better errors from copyResource" 2011-08-11 13:27:10 -07:00
Dianne Hackborn
e09cd7914c Merge "New broadcast telling when an app is fully removed." 2011-08-11 11:35:07 -07:00
Robert Greenwalt
bde7a61a06 Merge "Remove default routes for non-default networks." 2011-08-11 09:55:08 -07:00
Christopher Tate
6853fcf53f Fix partial-read handling during restore
...by once and for all making all of the code deal appropriately with
expected partial reads.  We also now produce a properly conformant
underlying 'tar' EOF sequence [which will be compressed to almost
nothing] to doubly bulletproof the end-of-archive logic.

Fixes bug 5133658

Change-Id: I24a785574861d64ef10fc727b9f6b235575696b0
2011-08-10 17:55:15 -07:00
Jeff Brown
c269dc55f1 Merge "Add input system to Watchdog. Bug: 5094994" 2011-08-10 17:28:15 -07:00
Jeff Brown
7034e4e665 Merge "Fix getSwitchState and others to check bitmasks. Bug: 5149443" 2011-08-10 17:28:09 -07:00
Jeff Brown
bf48b571cf Merge "Use BTN_TOUCH or BTN_TOOL_* to determine if touch active. Bug: 5064702" 2011-08-10 17:28:05 -07:00
Dianne Hackborn
f9abb40590 New broadcast telling when an app is fully removed.
Change-Id: Ia516d826f302a01881fa92d9ffdc0adfbf669a4b
2011-08-10 17:15:17 -07:00
Kenny Root
f5121a9b80 Better errors from copyResource
Copy resource would fail without a good error code when the file
couldn't be found during copy.

Also destroy the target container ID during move operations since it
might exist. If the copy failed due to it existing, it would get
destroyed anyway. This way the user has a chance to have a good outcome
the first time.

Bug: 3375299
Bug: 5113898
Change-Id: I00559833f0801bc50e7cc031b462495e37a6b4ab
2011-08-10 17:00:30 -07:00
Jeff Brown
89ef0720ee Add input system to Watchdog.
Bug: 5094994

Change-Id: I153866958efc64ac19bda8b997c1c9f6ad425ec4
2011-08-10 16:25:21 -07:00
Irfan Sheriff
7244c977ec Ensure interface down before wpa_supplicant start
Now that the driver is built into the kernel, a runtime crash
followed by a driver unload and reload does not reset the interface.

Ensure interface is down before bringing up supplicant

Bug: 5032635
Change-Id: Ib8f3d47617e587139a8a91a82146ee3a2f329700
2011-08-10 15:49:25 -07:00
Jeff Brown
ba421dddfd Fix getSwitchState and others to check bitmasks.
Bug: 5149443

Removed some dead code and unnecessary checks, such as checks
for non-nullity of arrays that used to be dynamically allocated
once upon a time but are now part of the Device object itself.

Change-Id: I531116e816772d7c5030d22da0c8e1d7dcfba778
2011-08-10 15:17:37 -07:00
Jeff Brown
d87c6d5fd5 Use BTN_TOUCH or BTN_TOOL_* to determine if touch active.
Bug: 5064702

Should not include stylus buttons in the condition.

Change-Id: If4d78a875b77da8bd59672d6fdbf5353004d0023
2011-08-10 14:55:59 -07:00
Irfan Sheriff
cb30b22ff5 Add firmware reload support for P2P
Refactor firmware reload call to support various modes - AP, STA & P2P

Bug: 5002384
Change-Id: I10d20fe5a7842437cf80861bc8a834990db87db5
2011-08-10 10:18:59 -07:00
Jeff Sharkey
8cceb1e42b Merge "Enable network stats module by default." 2011-08-09 21:02:55 -07:00
Robert Greenwalt
e6b2429cf7 Remove default routes for non-default networks.
Recoding/port of a change that existed in GB but got dropped
in the shuffle.

bug:5036222
Change-Id: I87e819d255c0c46f3ec8fe0fe18d27ae9df1ae36
2011-08-09 16:52:58 -07:00
Mathias Agopian
f6d08b9528 Merge changes Ie06e73e5,I7ac6b5b0
* changes:
  free all buffers when ANativeWindow::disconnect is called
  return correct value from query after connecting a surface
2011-08-09 15:23:19 -07:00
Jeff Sharkey
05355c3eb6 Enable network stats module by default.
Bug: 5138315
Change-Id: Id4cffdc126bf14a005fc2d3aece87ea036a51999
2011-08-09 14:44:19 -07:00
Kenny Root
e13e48d6fc Merge "Add security checks for new API" 2011-08-09 13:58:26 -07:00
Kenny Root
461ff1f03c Add security checks for new API
Bug: 5137679
Change-Id: Ic0c1e0cf2960a7062ba318b60ee2c92506f6aab6
2011-08-09 11:08:34 -07:00
Marco Nelissen
4332168439 Merge "Keep effects sessions active when the caller dies." 2011-08-09 11:02:26 -07:00
Dianne Hackborn
6ae7ba3230 Merge "Improve window manager debug output." 2011-08-09 10:41:45 -07:00
Marco Nelissen
c74b93fdf3 Keep effects sessions active when the caller dies.
Don't remove effects until the session they are in goes away or all
AudioEffects have been explicitly released. This allows the control
panel process to die without stopping the effects.

Change-Id: I4496e5df080230ca1af149dec95c1309ab8ea888
2011-08-09 10:21:10 -07:00
Mathias Agopian
053b02df2d return correct value from query after connecting a surface
the first time a surface was connected, the values returned
by query NATIVE_WINDOW_DEFAULT_{WIDTH|HEIGHT} and
NATIVE_WINDOW_TRANSFORM_HINT were wrong until a call
to queueBuffer was performed.

Bug: 5137366, 5121607
Change-Id: I7ac6b5b0daa876638f6bed7c20f286a6e6d984f6
2011-08-08 20:25:44 -07:00
Mathias Agopian
fc4ba11415 Merge "improve dumpsys SurfaceFlinger output" 2011-08-08 20:13:16 -07:00
Dianne Hackborn
a44abeb125 Improve window manager debug output.
Cleaned this up while I was debugging another issue.

Change-Id: I0663b9ed581c6868b59655a0f994d870971ec1a6
2011-08-08 19:24:28 -07:00
Mathias Agopian
0c3367f1bb improve dumpsys SurfaceFlinger output
we now output the handle and size of all buffers of each layer.

Change-Id: I8d011ee4ae9199f4198bd07bed770ec3bcf02986
2011-08-08 16:02:13 -07:00
Chia-chi Yeh
880f64ac10 Merge "VPN: introduce VpnService as the base class for user space VPN." 2011-08-08 11:33:57 -07:00
Mark Brophy
930740d1ef Merge "Store last-resume times in a separate XML file." 2011-08-08 11:30:19 -07:00
Chia-chi Yeh
199ed6ef89 VPN: introduce VpnService as the base class for user space VPN.
Change-Id: I4793a6eb51b33f669fc6d39e1a16cf5eb9e3d851
2011-08-08 11:15:41 -07:00
Eric Laurent
c993acbce6 Merge "AudioFlinger: protect input/output stream access" 2011-08-08 09:31:42 -07:00
Eric Laurent
828b9773cc AudioFlinger: protect input/output stream access
Some methods would not check that the output orinput stream of a thread
was still valid before calling functions on its interface.
This could cause a crash if those methods where called while the output or
input was being closed by another thread.

Make sure that the output or input stream pointer is cleared before closing the
stream.
Always check that the output or input pointer is not null before calling
functions at the stream interface.
Generalize the use of initCheck() method to verify that the output or input
stream is not null.

Change-Id: I9d9ca6b744d011bcf3a7bbacb4a581ac1477bfa5
2011-08-08 08:55:29 -07:00