Add seinfo parsing to PackageManagerService.

This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory. Modifications
also include, adjustments to ApplicationInfo.java
to store the seinfo tag per package, adjustments
to installd to communicate the seinfo tag to
libselinux, and finally a set of unit tests.

Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Added SELinux enforcing status and booleans keys to secure system settings.

Conflicts:
	core/java/android/provider/Settings.java

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8474e
Add APIs to allow Device Admins to change SELinux settings

These calls, added to the Device Admin API, will allow Device Admin apps
to change various SELinux settings, including:
* Toggling SELinux enforcing and permissive modes
* Toggle SELinux booleans
* Load a new SELinux policy file (sepolicy)
* Load new SELinux context files ({property,file,seapp}_contexts)

In order to use these APIs, a Device Admin must first request
USES_POLICY_ENFORCE_SELINUX, then become a SELinux Admin by calling
setSELinuxAdmin(). All other set* calls relevant to SELinux are guarded
by a check against whether the admin is a SELinux Admin.

Otherwise, the style of the set* calls are very similar to the other
calls setting device policy in the Device Admin API. That is, these
calls change the Admin's internal state and then call a sync method to
update the device's state to the Admin's state.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8476e
Remove SELinux additions from public API

Change-Id: If2e076312b0e411145c1cd900f3ae20d998a0f24
Apply MMAC changes from master.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8477e
Proper security labeling of multi-user data directories.

This patch covers 2 cases. When an app is installed
and the resulting data directory is created for all
existing users. And when a new user is created and
all existing app data directories are created for
the new user.

Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8478e
Update location of policy files

The location of policy files has changed from
/data/system to /data/security.

Also, a name change to mmac enforcing property
name to place it under persist.mmac. namesepace.

Adds api's for getting and setting the MMAC
enforcing mode.

Change-Id: I0e9468fe651cd6ec018d5c85d35d693e55479e89
Move seinfo and install-time changes to inside PMS.

Per request by Google, move the install-time checks entirely
inside PMS.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8479e
Bring install-time code inline with AOSP.

Recent submissions to AOSP rework some of the
internal logic of SELinuxMMAC and the PMS.
Bring our maintained version inline with
those changes while still allowing policy
to dictate all seinfo values regardless
of location.

Change-Id: I11ff4c4089217e6a9d95ca2841c5bc29bfd763ad
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Follow AOSP behavior for seinfo assignment.

No distinctions can be made among third party apps.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Change-Id: Ic894086485bfea884c0e21af13f98a2d54346b15
Replace SEAndroid with SELinux.

Change-Id: Ibbe544a9f025d71ad416bc01cee2145b62d7b2d4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Drop "SE Android" from strings.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change-Id: I814411cbc8d16eaed99a1389f5487529e36e627b
Restore support for labeling non-system apps based on their certificate.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Change-Id: I814411cbc8d16eaed99a1389f5487529e36e637b
Fix SELinux.java doc errors

This fixes five errors when building the Java docs. It also
removes two obsolete lines.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
Change-Id: I814411cbc8d16eaed99a1389f5487529e36e647b
Add data validation on seinfo labels.

Ensure that policy contains a clean seinfo
string. Where clean means no whitespace characters.

Change-Id: I814411cbc8d16eaed99a1389f5487529e36e617b
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Implement Device Admin API for MMAC

Change-Id: I9e2b494d48496542171ec2500dace6486775e952
Framework: Fix blacklist support

Copy & Paste isn't a good friend for programmers ;)

Change-Id: Ic6ab81462530f614b9e896cb098590241accb192
Fix appwidgets not updating

Previously there was a bug where if an appwidget's update caused a
TransactionTooLargeException then the AppWidgetServiceImpl.Host's
callbacks were completely disabled, for all widgets.

The fix still allows a DeadObjectException or other RemoteException
to disable the host callbacks, as that would be caused by a bad host.

Fixes issue 28216 on the public tracker
https://code.google.com/p/android/issues/detail?id=28216

Change-Id: I5c5d5939d7211ed23cca69e6674de730b51b0f3e
Signed-off-by: Kevin Barry <kevin@teslacoilsw.com>
Merge commit 'refs/changes/53/31653/1' of ssh://grapefruit.slimroms.net:29299/SlimRoms/frameworks_base into HEAD
Frameworks: better navbar and navring support for ppl without gnow

an installe without google now had some negative effect on our
custom navring/navbar actions

- do not depend on search action on tiny circle lockcreen...check targets available instead
- same for navbar transparency
- fix google typo
- split ontouchlistener for home button and tiny circle due that
it does not make sense to react same like home button if the user
assigned to the home button a custom action

cheers

Change-Id: I8e6a250c3b4ee5f2c17ef48bbe9532511a7737d6