23527 Commits

Author SHA1 Message Date
Stephen Smalley
1fd675815a SELinuxPolicyInstallReceiver: Switch to file_contexts.bin.
Switch to file_contexts.bin.

Change-Id: I745a98c324075b42d8f20cf6cf36568896476f3e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-08-05 13:40:49 -04:00
Matthew Williams
0c53f72eda Merge "Fix NPE in JobStore when jobs.xml is empty." 2015-08-04 17:39:51 +00:00
Matthew Williams
608ad1409d Merge "Idle Job Start During SCREEN_ON or DREAMING_STOPPED" 2015-08-03 23:58:48 +00:00
Kevin Zhu
ccfe87356f Idle Job Start During SCREEN_ON or DREAMING_STOPPED
When the screen goes off or dreaming start, an alarm will be
scheduled and idle state will be true when the alarm expired.
If the screen goes on or dreaming stop happens before
the alarm expired, the alarm isn't cancelled and idle state is
set to be true when the device is in SCREEN_ON or DREADING_STOPPED
state. There is also a case that Idle alarm triggered when
the screen on or dreaming stop just start to be processed.
ACTION_TRIGGER_IDLE will set mIdle to true during screen on
or dreaming stop.

In this patch, the alarm will be cancelled when the screen goes
on or dreaming stop and screen-on flag will be set. So the idle
state can only be set when screen is off or dreaming started.

Change-Id: I06ae4b7fd77901f9570ce0459d2299bbfd4b46b4
2015-08-02 22:10:25 -07:00
Yusuke Sato
158560ad66 Merge "Distinguish user-requested shutdown from power-related ones" 2015-07-31 23:13:16 +00:00
Yusuke Sato
705ffd1efe Distinguish user-requested shutdown from power-related ones
With this patch, when the user requested shutdown,
PowerManagerService sets sys.powerctl is set to
"shutdown,userrequested", and init runs fsck on shutdown.

When shutdown is triggered due to a low power state etc.,
the service sets the property to "shutdown,", and init
immediately shuts down the system without running the
command.

This is a follow-up CL for http://r.android.com/158525.

Bug: 21853106
Change-Id: Iae72990130fe9aa479c802f77301438190dbbfb3
2015-07-30 23:47:13 -07:00
riddle_hsu
98bfb3466c Fix NPE in JobStore when jobs.xml is empty.
It is possible that jobs.xml does not have valid content
if the device meet unexpected power off or reboot during
writing the file, then parser.getName() may get null string
on next boot.

Because log does not allow to print null message.
It will result boot fail:
Caused by: java.lang.NullPointerException: println needs a message
 at android.util.Log.println_native(Native Method)
 at android.util.Slog.d
 at com.android.server.job.JobStore
    $ReadJobMapFromDiskRunnable.readJobMapImpl

Change-Id: Icd485096e2f00f4028428a9ad95cd0ef66b2dca0
2015-07-30 21:52:58 +08:00
Nick Kralevich
bd6b7e0973 ActivityManagerService: delete unnecessary mkdir
/data/anr is now created in init.rc. This code is unnecessary.

Bug: 22385254
Change-Id: Ide6c9749c27668523f9316049a1d40d961f2276d
2015-07-25 21:17:43 -07:00
Neil Fuller
eccbc7c96f Merge "Fix NativeCrashListener" 2015-07-16 10:26:18 +00:00
Chris Tate
2fccb66deb Merge "Fix a bug disappearing installerPackageName info of packages after reboot." 2015-07-16 00:09:38 +00:00
Neil Fuller
e64f3e3fee Fix NativeCrashListener
In the move from InetUnixAddress to UnixSocketAddress
commit e9d537506bf19375fb932ac7d25ac9a9e3aef61d did not modify
the Os.accept() call in NativeCrashListener. It was passing
an empty InetSocketAddress.

The type could have been changed, but the peer address is
never used and it is safe to pass a null.

Bug: 3106438
Change-Id: I2a61221c4504657b3e1de848b0b493f202726126
2015-07-15 17:38:28 +01:00
Neil Fuller
c83d18190d Merge "Switch from InetUnixAddress to UnixSocketAddress" 2015-07-09 09:44:32 +00:00
hyemin.hwang
7ee9a4ef14 Fix a bug disappearing installerPackageName info of packages after reboot.
If user install apps from playstore, system has installerPackageName attribute of app.
but, after reboot, some apps(have sharedUserID) installerPackageName attribute disappearing.
because lack of copy routine.
So, I added copy routine(installerPackageName).

Testcase :
1. Install app(has sharedUserId, ex Lync2013) from market.
2. Confirm package info from packages.xml(exist installer info).
3. reboot.
4. Re-confirm package info from packages.xml(not exist installer info).

Change-Id: I5f9597b0f0f23be21efdfc7c7780ce7cfd2b9672
2015-07-09 09:16:12 +09:00
Neil Fuller
e9d537506b Switch from InetUnixAddress to UnixSocketAddress
UnixSocketAddress is replacing InetUnixAddress.

Bug: 3106438
Change-Id: I7c03fa357adfb3221908294fd254c8faae91fd1b
2015-07-07 16:58:00 +01:00
Elliott Hughes
0254af6f68 Merge "Fix "Bluetooh" logging typo." 2015-07-07 06:00:56 +00:00
Elliott Hughes
7271613ed6 Fix "Bluetooh" logging typo.
Change-Id: I2b9aea64f1b53e100ead6e71835bf5935b410eb9
2015-07-06 22:10:36 -07:00
wang.zhenyu
19b26f8754 Miss USB device Interface from UsbManager.getDeviceList().
In the scenario that you connect more than one device to android phone with an usb hub,
when you attach the second device,mNewConfigurationis is still corresponded to the first
device unless another mNewConfiguration is created by a new operation.
However,before another mNewConfiguration is created,setInterfaces() in addUsbConfiguration()
has already been executed. Problem is that mNewInterfaces has already been cleared when
it finished endUsbDeviceAdded for the first device. As a result,the UsbInterface descriptor
in the first device's Configuration descriptor is set to null.

Change-Id: I0ba4f07c809d07ebebed633e43c3ee8e2e4c5060
2015-07-06 11:35:44 +08:00
Henrik Baard
c90ca48a7c Remove memory leak in PersistentDataBlockService jni
When calling the methods
 com_android_server_PersistentDataBlockService_getBlockDeviceSize()
 com_android_server_PersistentDataBlockService_wipe()
memory is leaked because string created by
 GetStringUTFChars() is not released.

Use ScopedUtfChars instead to ensure that memory is released.

Change-Id: I880a6d66a4824778b411b858774b8ffa009c1e17
2015-07-01 13:30:26 +00:00
Man Cao
cfa78b2080 Add an AM option to start with allocation tracking
The new option "--track-allocation" is to work with the new
allocation tracker in ART.

Bug:20037135
Change-Id: Ic5f8945ab4c1f167c27b05ad0d11d04bac680c1f
2015-06-24 13:29:29 -07:00
seunghyun85.lee
92d9c81835 Apply the scale to surfaceinsets when computing crop region
While in computing surface crop region, magnification specs are
not applied to surface insets from LayoutParams.

So, in case magnification specs are set,
surface crop region should be calculated considering scale factor.

(For instance, using TouchZoom in Accessibility
at AppsPermissionActivity in market app)

Bug: 20863078
Change-Id: I9e7e21e502b29208f2856918d6fcda050f515595
Signed-off-by: Seunghyun Lee <seunghyun85.lee@lge.com>
2015-06-19 07:56:31 -07:00
Wale Ogunwale
ce7dba6bdf Merge "[ActivityManager] Fix index OOB when updating visible." 2015-06-18 14:38:20 +00:00
Vladimir Marko
dc22cfed5d Merge "Don't prevent notification updates in DOS protection." 2015-06-17 09:04:35 +00:00
Chris Tate
396b83b0c8 Merge "Fix overflow/underflow problem in comparison" 2015-06-12 19:52:45 +00:00
Andre Eisenbach
945c52d5d7 Bluetooth native dumpsys logging support (3/5)
Bug: 18508263
Change-Id: I88f9c90dab8b0c825010c8617709449a3dd704b2
2015-06-10 19:34:41 +00:00
Tao Bao
f2a91ee148 Improve the reboot-to-recovery dialogs
To address the UX comments, this CL modifies the dialogs when the
device is rebooted to install an update or to perform factory data
reset.

Bug: 20949086
(cherry picked from commit 81dce6631396012e8b722bbed6d003f584800ae1)
Change-Id: I6d0cbbbaf184806366c6581c1c2e7dbcc5d89a17
2015-06-09 14:59:15 -07:00
Tao Bao
fa861429f7 Wait for uncrypt to finish before rebooting
/system/bin/uncrypt needs to be triggered to prepare the OTA package
before rebooting into the recovery. For larger packages, uncrypt may be
killed before it finishes the work after the timeout. Change to monitor
the uncrypt status and show the progress to user.

Needs matching changes in bootable/recovery/uncrypt, system/core and
external/sepolicy.

Also pick up the two NPE fixes in commits
9bb765448df43d41e0a3edb7de1d1641c9251c35 and
da3f63ffb87397943546a7c5c893ce98f2489df2.

Bug: 20012567
Bug: 20949086
(cherry picked from commit 90237f7beb55dae79cdcba5271f96be778573737)
Change-Id: Ibf2fc80032967e5f6cda3cd469005dd29665c87c
2015-06-09 14:58:13 -07:00
riddle_hsu
3fe52da421 [ActivityManager] Fix index OOB when updating visible.
If there is an Activity Z of Task T needs be visible but
isn't running, and the process P of Z is existed, it will
just to schedule launch Z.

The problem will happen when P is died (e.g. kill itself)
right before scheduleLaunchActivity. Once RemoteException
is caught, startSpecificActivityLocked will try to restart
the process and run cleanup procedure because the process
record is existed (death recipient of P has not entered AMS
yet). And assume task T contains X, Y, Z. X and Y have
declared stateNotNeeded=true, so X and Y will be removed
from task T.

Now the size of task T changes from 3 to 1. And because
activityNdx=2 when updating Z, the next round (--activityNdx)
will have exception at activities.get(activityNdx):
IndexOutOfBoundsException: Invalid index 1, size is 1

The ActivityRecord in TaskRecord is removed by below flow:

ActivityStack.ensureActivitiesVisibleLocked
 ActivityStackSupervisor.startSpecificActivityLocked
  ActivityStackSupervisor.realStartActivityLocked
   ApplicationThreadProxy.scheduleLaunchActivity -> IPC fail
  ActivityManagerService.startProcessLocked
   ActivityManagerService.handleAppDiedLocked
    ActivityStackSupervisor.handleAppDiedLocked
     ActivityStack.handleAppDiedLocked
      ActivityStack.removeHistoryRecordsForAppLocked
       ActivityStack.removeActivityFromHistoryLocked
        task.removeActivity(r) -> mActivities.remove(r)

There is also similar patch to solve the same problem:
https://android-review.googlesource.com/143780/

Change-Id: Iac646bcb8ed3d3cfb2bda14e05e11abfcfe980d1
2015-06-05 16:38:38 +08:00
Charles Tsai
cdaaeeec0d Fix overflow/underflow problem in comparison
Here's overflow/underflow problem in comparators.
"when1 - when2" may suffer in overflow/underflow condition.
Comparing them directly can avoid this problem.

Change-Id: Id46af3db2adac90654210182d26ade1986ee0661
2015-06-04 17:14:03 +08:00
Olawale Ogunwale
ad2be762f2 Merge "Fix null pointer dereference when security exception occurs" 2015-06-01 14:45:28 +00:00
Olawale Ogunwale
5ef5378374 Merge "WindowManagerService not propagating X and Y steps" 2015-06-01 14:42:37 +00:00
David Srbecky
f39477b592 Replace --include-cfi with --generate-debug-info.
This follows a change in dex2oat.

Change-Id: I46b61298ca00bee2e83080456b180d63efd95b8f
2015-05-28 17:16:09 +01:00
jinho.park
df7f900cf4 Fix bug regarding the comparator sorts Alarms into increasing time order.
The comparator used variable "when" in IncreasingTimeOrder class.
variable "when" means "elapsed time" or "real time"(RTC) and these types have different unit of time.
so, I recommend that you use a "whenElapsed" which has the equal unit of time as its default value.

Change-Id: I248863ef8a5c49cc7114cb2965f3d6b78f4faa59
Signed-off-by: Jinho Park <jinho.park@lge.com>
2015-05-27 14:44:18 +09:00
Wojciech Staszkiewicz
4f11754f72 Pass charset to XmlPullParser.setInput instead of null
Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

(cherry picked from commit 9e9e2e73c6ec7bece20268196dc89ad0c8bafad4)

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
2015-05-22 10:26:31 +01:00
Narayan Kamath
561e13d687 Fix application moves.
We don't dex2oat during application moves, so we must scan
the package again scanPackageDirtyLI to deduce its ABI.

This is unnecessary (since a move cannot change ABIs), but we
need some additional refactoring to avoid a second scan.

bug: 21337469

(cherry picked from commit cd251fa382e887f59c278d4d7cd0a858812c6114)

Change-Id: Id1ed3bdfabb41e05e6a2f7efbd05d2103a67c663
2015-05-22 08:29:54 +00:00
Narayan Kamath
a96ecf7821 Throw a checked exception on inconsistent installs.
Allows us to proceed without crashing the system process. Also,
complete an incomplete error message. Follow up comments from
change b904863476991d8540d37d5.

bug: 21144503

(cherry picked from commit c52ae28006605fb2da38b305b60b9bb419aa2f80)

Change-Id: I47b8762449714162fcd5c16eba6fcc146b93120b
2015-05-22 08:29:32 +00:00
Narayan Kamath
2b6d792ad5 Scan package to derive ABIs before optimizing.
This requires a minor refactor to extract the ABI detection logic
out of scanPackageDirtyLI.

Note that there's a minor regression here : we ignore the
cpuAbiOverride from the package settings when calculating the
CPU ABI. This is OK (and possibly better behaviour) because this
is only a debug only option (for adb install) AND because the instructions
require users to specify the abi override on every adb install
invocation. Furthermore, the behaviour when an ADB installed app
(with an override) is auto-updated is more consistent.

bug: 21144503

(cherry picked from commit b904863476991d8540d37d542c0a49b78deab680)

Change-Id: I1eb88b808fd2e90e14c32322131659220aafdb7a
2015-05-22 08:29:07 +00:00
Fyodor Kupolov
589f2b53f2 Do not create oat directory for an app in ASEC container
Currently installation fails, if an app is located on SD card (inside ASEC).
If an app is located inside ASEC, dexopt output should go to
/data/dalvik-cache. dexopt also needs to be performed at a later stage,
because the name of the oat file contains the absolute path to the dex file.

Bug: 20452651
Bug: 21360107

(cherry picked from commit 94056d1cb8183bde3e942336735b289b9654deb1)

Change-Id: Id1ced7159e5af9c05be0b637437b3b260e859c1d
2015-05-21 19:42:34 +01:00
Christopher Desjardins
a64cd48594 Fix null pointer dereference when security exception occurs
Just above the SecurityException is a check for r.record == null,
thus dereferencing r.record will cause a null pointer exception.

Found in Android 4.3 with the following steps:

1) Start the music app.
2) Switch to the restricted user.
3) Navigate to Settings->Apps->Running->Music.
4) Tap the stop button.

The security exception should be thrown which results in
a nice message to the user, but instead a null pointer
exception is thrown which results in the settings app
crashing.

Change-Id: I4a306c38650c9d366896e592767dde70adb71c57
2015-05-21 09:20:46 +02:00
Fyodor Kupolov
5053258e20 Merge "Allow creating a managed profile if there is only one user." 2015-05-19 17:47:03 +00:00
Vladimir Marko
d9f4c95b7d Don't prevent notification updates in DOS protection.
The NotificationManagerService limits the number of
notifications per package+user to 50. Once that limit is
reached, it will refuse new notifications. However, it was
also erroneously refusing updates to existing notifications.

Bug: 5821364
Change-Id: I3aa4be9ad4b288e4a22bf7a64f67521695dfb579
2015-05-19 10:01:11 +01:00
Nicolas Prevot
12678a99f1 Allow creating a managed profile if there is only one user.
BUG:21119929

Change-ID: Ice1cf25f8ae8199228f828d22118c94b9e11b567
2015-05-18 10:48:16 -07:00
Richard MacGregor
74d2afdf0b WindowManagerService not propagating X and Y steps
WindowManagerService received X and Y offset steps but failed to pass
them off to the relavent wallpaperservice.

Live wallpapers expect a valid value for xOffsetStep and yOffsetStep
when the WallpaperService.Engine::onOffsetsChanged function is called
As specified here:
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html
onOffsetsChanged(float,float, float, float, int, int)

See bug report:
https://code.google.com/p/android/issues/detail?id=173607

Change-Id: I532dedf2db055e27d6eca813e30346e37f52dc65
(cherry picked from commit e03ea68d0a7f7d7c60663feae587225cca3a3a5b)
2015-05-15 14:25:57 -07:00
Olawale Ogunwale
354be7cd87 Merge "Use the correct parent size to initialize animations" 2015-05-15 17:23:07 +00:00
Olawale Ogunwale
4857c1d885 Merge "Fix lost singleton provider after force-stopping user or package." 2015-05-15 17:13:02 +00:00
riddle_hsu
daf23d9c77 Fix lost singleton provider after force-stopping user or package.
Case 1 (name == null):
Switch user from guest to owner. All processes of guest
will be killed, it will not include processes which singleton
components live in, but singleton provider records are still
collected and removed.

When the user switch is complete and the process of removed
singleton provider is still alive, there is someone access
the provider, it will create a new ContentProviderRecord and
wait but no one will notify it because the provider process
is alive with different ContentProviderRecord.

Then the access cannot get response unless the process of target
provider is died and restarted.

Case 2 (name != null):
Switch to another non-guest user, launch an application which
contains singleton provider. Go to Settings to force-stop the
package then switch back to owner user. Launch an application
which will access the singleton provider. It will also cannot
get response that similar as case 1.

Solution:
Only collect singleton provider if target user is all or owner.

Change-Id: Ic6828da66645172d1378cfb1f66d092df5966516
2015-05-15 11:33:03 +08:00
riddle_hsu
691a1737a3 Also restart provider if there is external handle.
e.g. ContentResolver.getType will call
ActivityManagerService.getProviderMimeType
that will not have connection but increase
externalProcessNoHandleCount.

Change-Id: I649c0b2390a749c77c6be5e7dfadc1acb689ec4c
2015-05-13 18:59:03 +08:00
Chad Brubaker
31c2897105 Add keystore onUserAdded/Removed methods
Change-Id: I73fe9344ec5660e58425d5c85d14381820533d57
2015-05-12 13:24:43 -07:00
Olawale Ogunwale
9c32e1022b Merge "Don't apply animation clip to dialog activities" 2015-05-12 16:50:35 +00:00
Chad Brubaker
d88fffa58d Cleanup keystore password changing and unlocking
Add KeyStore.onUserPasswordChanged for the lockscreen to call when
the user changes their password. Keystore will then handle the logic of
deleting keys. Instead of calling Keystore.password_uid for both
unlocking and password changes the behavior has been split into
Keystore.unlock and onUserPasswordChanged.

(cherry-picked from commit a91a8504191d91d288c55821caa5bf00c9be26a2)

Change-Id: I324914c00195d762cbaa8c63084e41fa796b7df8
2015-05-11 11:20:59 -07:00
tiger_huang
5b36c49aea Use the correct parent size to initialize animations
The original logic would use out-of-date parent sizes to initialize
animations. If the screen size is changed after assigning mAnimDw and
mAnimDh in the constructor of WindowStateAnimator, the fromDeltaY
(in the most cases) of TranslateAnimation would be initialized
incorrectly.

In this change, we always use up-to-date parent sizes to initialize
animations to prevent the issue.

https://code.google.com/p/android/issues/detail?id=170348

Change-Id: Ib9c609121228934bdb463263feb1924eb389c1d2
2015-05-08 13:08:47 +00:00