Detect whether overflow button should be shown based on menu key state

Some devices may have hardware keys but not contain a hardware menu key.
Hardware keys are also able to remapped. The overflow button detection logic
currently does not take that into account. This change allows detects
whether any key is capable of emitting the MENU_ACTION keystroke in
order to determine whether the overflow button should be shown or not.

Change-Id: I8699bd0242560314f8eadc54b187c69c992cf875
Reduce number of binder calls by saving nav bar state

Change-Id: I3729d05a34a661cb74e998c40b61c615cdbf83a6
PrivacyGuard: New icons close to AOSP style
Halo: Avoid showing Halo))) icons in status bar while added to Halo (Credits @Anu6is)
Kill floating activities running in the same thread when tapping outside
This change makes all activities from the same app to be finished when we tap outside the halo window. Other apps running in different threads
(floating or not) won't be finished.

Change-Id: I3c51eafdcee7032fa90876411da3ff1eae0106c3
Revert "Reduce number of binder calls by saving nav bar state"

This reverts commit 50af9195c01ce2c097a017bb32c56737bea535e9.
Revert "Detect whether overflow button should be shown based on menu key state"

This reverts commit e64abe4684998a4dceae037914485848ce15a64f.
Fix menu ui overflow
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
Save off the seinfo value with packages.list.

Patch adds the seinfo label per package to the file.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8475e
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
Simplify check during admin removal for whether to cleanup SELinux

Also re-arrange and cleanup

Change-Id: I1261e715d8d04b72f8a29b8a24268d75946d24dc
Apply MMAC changes from master.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8477e
Implement Device Admin API for MMAC

Conflicts:
	api/current.txt
	core/java/android/app/admin/DevicePolicyManager.java

Change-Id: I1df507ced67fbcab8fdcde9cce78705b5e54e346
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
Change DPMS code to accommodate enforce states on boot.

We need to respect if setenforce (selinux enforce), setsebool (booleans),
or setprop (mmac enforce) are set in the any of the init.rc files.
This set of changes will allow the init.rc values to win over any
potential device admin wishes.

Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8473e
Signed-off-by: Robert Craig <rpcraig@tycho.ncsc.mil>
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>