Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8e9b5c2 authored by Amit Kumar's avatar Amit Kumar
Browse files

Merge branch 'eelo-0.2' of https://gitlab.e.foundation/e/os/android_frameworks_base into eelo-0.2

parents 223f9045 540cc3f0
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -806,11 +806,19 @@ public final class Parcel {
            return;
        }
        Set<Map.Entry<String,Object>> entries = val.entrySet();
        writeInt(entries.size());
        int size = entries.size();
        writeInt(size);

        for (Map.Entry<String,Object> e : entries) {
            writeValue(e.getKey());
            writeValue(e.getValue());
            size--;
        }

        if (size != 0) {
            throw new BadParcelableException("Map size does not match number of entries!");
        }

    }

    /**
+41 −6
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
@@ -41,7 +42,8 @@ import com.android.internal.R;
public final class RotationPolicy {
    private static final String TAG = "RotationPolicy";
    private static final int CURRENT_ROTATION = -1;
    private static final int NATURAL_ROTATION = Surface.ROTATION_0;
    private static final int NATURAL_ROTATION =
            SystemProperties.getInt("ro.sf.hwrotation", Surface.ROTATION_0) / 90;

    private RotationPolicy() {
    }
@@ -72,7 +74,7 @@ public final class RotationPolicy {
     * otherwise Configuration.ORIENTATION_UNDEFINED if any orientation is lockable.
     */
    public static int getRotationLockOrientation(Context context) {
        if (!areAllRotationsAllowed(context)) {
        if (!isCurrentRotationAllowed(context)) {
            final Point size = new Point();
            final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
            try {
@@ -112,7 +114,8 @@ public final class RotationPolicy {
                Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
                UserHandle.USER_CURRENT);

        final int rotation = areAllRotationsAllowed(context) ? CURRENT_ROTATION : NATURAL_ROTATION;
        final int rotation = isCurrentRotationAllowed(context)
                ? CURRENT_ROTATION : NATURAL_ROTATION;
        setRotationLock(enabled, rotation);
    }

@@ -129,8 +132,40 @@ public final class RotationPolicy {
        setRotationLock(enabled, NATURAL_ROTATION);
    }

    private static boolean areAllRotationsAllowed(Context context) {
        return context.getResources().getBoolean(R.bool.config_allowAllRotations);
    public static boolean isRotationAllowed(int rotation,
            int userRotationAngles, boolean allowAllRotations) {
        if (userRotationAngles < 0) {
            // Not set by user so use these defaults
            userRotationAngles = allowAllRotations ?
                    (1 | 2 | 4 | 8) : // All angles
                    (1 | 2 | 8); // All except 180
        }
        switch (rotation) {
            case Surface.ROTATION_0:
                return (userRotationAngles & 1) != 0;
            case Surface.ROTATION_90:
                return (userRotationAngles & 2) != 0;
            case Surface.ROTATION_180:
                return (userRotationAngles & 4) != 0;
            case Surface.ROTATION_270:
                return (userRotationAngles & 8) != 0;
        }
        return false;
    }

    private static boolean isCurrentRotationAllowed(Context context) {
        int userRotationAngles = Settings.System.getInt(context.getContentResolver(),
                "accelerometer_rotation_angles", -1);
        boolean allowAllRotations = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowAllRotations);
        final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
        try {
            return isRotationAllowed(wm.getDefaultDisplayRotation(), userRotationAngles,
                    allowAllRotations);
        } catch (RemoteException exc) {
            Log.w(TAG, "Unable to getWindowManagerService.getDefaultDisplayRotation()");
        }
        return false;
    }

    private static void setRotationLock(final boolean enabled, final int rotation) {
+1626 −1628
Original line number Diff line number Diff line
@@ -500,8 +500,7 @@
    <!-- Message shown during fingerprint acquisision when the user removes their finger from the sensor too quickly -->
    <!-- Message shown during fingerprint acquisision when the user moves their finger too slowly -->
    <!-- Array containing custom messages shown during fingerprint acquisision from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_acquired_vendor">
    </string-array>
    <string-array name="fingerprint_acquired_vendor"></string-array>
    <!-- Error message shown when the fingerprint hardware can't be accessed -->
    <!-- Error message shown when the fingerprint hardware has run out of room for storing fingerprints -->
    <!-- Error message shown when the fingerprint hardware timer has expired and the user needs to restart the operation. -->
@@ -511,8 +510,7 @@
    <!-- Generic error message shown when the fingerprint hardware can't recognize the fingerprint -->
    <!-- Template to be used to name enrolled fingerprints by default. -->
    <!-- Array containing custom error messages from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_error_vendor">
    </string-array>
    <string-array name="fingerprint_error_vendor"></string-array>
    <!-- Content description which should be used for the fingerprint icon. -->
    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+3108 −3129
Original line number Diff line number Diff line
@@ -729,8 +729,7 @@
    <string name="permdesc_writeCallLog" product="default">Permite que les aplicaciones modifiquen el rexistru de llamaes del teléfonu, incluyendo datos tocante a llamaes entrantes y salientes.
        Les aplicaciones malicioses podríen usar esto pa desaniciar o modificar el rexistru de de llamaes.</string>
    <!-- Title of the body sensors permission, listed so the user can decide whether to allow the application to access body sensor data. [CHAR LIMIT=80] -->
  <string name="permlab_bodySensors">acceder a sensores corporales
    </string>
    <string name="permlab_bodySensors">acceder a sensores corporales</string>
    <!-- Description of the body sensors permission, listed so the user can decide whether to allow the application to access data from body sensors. [CHAR LIMIT=NONE] -->
    <string name="permdesc_bodySensors" product="default">Permite que l\'aplicación acceda a datos de los sensores
    que supervisen la to condición física como los pulseos.</string>
@@ -844,8 +843,7 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_getAccounts" product="tablet">Permite que l\'aplicación consiga\'l
      llistáu de cuentes reconocíes pola tableta.  Esto podría incluyir
      cualesquier cuenta creada por aplicaciones qu\'instalesti.
</string>
      cualesquier cuenta creada por aplicaciones qu\'instalesti.</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_getAccounts" product="tv">Permite que l\'aplicación consiga\'l
      llistáu de cuentes reconocíes pola TV.  Esto podría incluyir
@@ -961,8 +959,7 @@
    <!-- Message shown during fingerprint acquisision when the user moves their finger too slowly -->
    <string name="fingerprint_acquired_too_slow">Moviesti\'l deu perdespacio. Volvi tentalo, por favor.</string>
    <!-- Array containing custom messages shown during fingerprint acquisision from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_acquired_vendor">
    </string-array>
    <string-array name="fingerprint_acquired_vendor"></string-array>
    <!-- Error message shown when the fingerprint hardware can't be accessed -->
    <string name="fingerprint_error_hw_not_available">Hardware de buelgues non disponible.</string>
    <!-- Error message shown when the fingerprint hardware has run out of room for storing fingerprints -->
@@ -979,8 +976,7 @@
    <!-- Template to be used to name enrolled fingerprints by default. -->
    <string name="fingerprint_name_template">Deu <xliff:g id="fingerId" example="1">%d</xliff:g></string>
    <!-- Array containing custom error messages from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_error_vendor">
    </string-array>
    <string-array name="fingerprint_error_vendor"></string-array>
    <!-- Content description which should be used for the fingerprint icon. -->
    <string name="fingerprint_icon_content_description">Iconu de buelga</string>
    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
@@ -1476,22 +1472,16 @@
         where the device will be wiped. -->
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
  <string name="lockscreen_failed_attempts_now_wiping" product="tablet">
       Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="lockscreen_failed_attempts_now_wiping" product="tablet">Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
  <string name="lockscreen_failed_attempts_now_wiping" product="tv">
       Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="lockscreen_failed_attempts_now_wiping" product="tv">Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- For the unlock screen, informational message shown in dialog when user has exceeded the
        maximum attempts and the device will now be wiped -->
  <string name="lockscreen_failed_attempts_now_wiping" product="default">
       Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="lockscreen_failed_attempts_now_wiping" product="default">Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- On the unlock screen, countdown message shown while user is waiting to try again after too many
         failed attempts -->
    <string name="lockscreen_too_many_failed_attempts_countdown">Volvi tentalo en <xliff:g id="number">%d</xliff:g> segundos.</string>
@@ -1532,8 +1522,7 @@
    <string name="lockscreen_access_pattern_cell_added">Caxella amestada</string>
    <!-- Accessibility description sent when user adds a dot to the pattern. Announces the
    actual cell when headphones are connected [CHAR LIMIT=NONE]  -->
  <string name="lockscreen_access_pattern_cell_added_verbose">
            Amestóse la caxella <xliff:g id="cell_index" example="3">%1$s</xliff:g></string>
    <string name="lockscreen_access_pattern_cell_added_verbose">Amestóse la caxella <xliff:g id="cell_index" example="3">%1$s</xliff:g></string>
    <!-- Accessibility description sent when user completes drawing a pattern. [CHAR LIMIT=NONE] -->
    <string name="lockscreen_access_pattern_detected">Patrón completáu</string>
    <!-- Accessibility description of the unlock pattern area. [CHAR_LIMIT=none] -->
@@ -1847,15 +1836,13 @@
    <!-- Summary for a warning message about the interaction model changes after allowing an accessibility
         service to put the device into explore by touch mode, displayed as a dialog message when
         the user selects to enables the service. (tablet). [CHAR LIMIT=NONE] -->
  <string name="enable_explore_by_touch_warning_message" product="tablet">
        <xliff:g id="accessibility_service_name">%1$s</xliff:g> quier activar la esploración con
    <string name="enable_explore_by_touch_warning_message" product="tablet"><xliff:g id="accessibility_service_name">%1$s</xliff:g> quier activar la esploración con
        toques. Cuando s\'activa, vas poder oyer o ver descripciones de lo que ta sol deu, o
        facer xestos pa interactuar cola tableta.</string>
    <!-- Summary for a warning message about the interaction model changes after allowing an accessibility
         service to put the device into explore by touch mode, displayed as a dialog message when
         the user selects to enables the service. (default). [CHAR LIMIT=NONE] -->
  <string name="enable_explore_by_touch_warning_message" product="default">
        <xliff:g id="accessibility_service_name">%1$s</xliff:g> quier activar la esploración con
    <string name="enable_explore_by_touch_warning_message" product="default"><xliff:g id="accessibility_service_name">%1$s</xliff:g> quier activar la esploración con
       toques. Cuando s\'activa, vas poder oyer o ver descripciones de lo que ta sol deu, o
       facer xestos pa interactuar col teléfonu.</string>
    <!-- String used to display the date. This is the string to say something happened 1 month ago. -->
@@ -2982,20 +2969,14 @@
    <!-- Message shown when user is almost at the limit of password attempts where the device will be wiped. -->
    <!-- Message shown when user is almost at the limit of password attempts where the device will be wiped. -->
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
  <string name="kg_failed_attempts_now_wiping" product="tablet">
       Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="kg_failed_attempts_now_wiping" product="tablet">Tentesti de desbloquiar incorreutamente la tableta <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
  <string name="kg_failed_attempts_now_wiping" product="tv">
       Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="kg_failed_attempts_now_wiping" product="tv">Tentesti de desbloquiar incorreutamente la TV <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- Message shown in dialog when user has exceeded the maximum attempts and the device will now be wiped -->
  <string name="kg_failed_attempts_now_wiping" product="default">
       Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.
    </string>
    <string name="kg_failed_attempts_now_wiping" product="default">Tentesti de desbloquiar incorreutamente\'l teléfonu <xliff:g id="number">%d</xliff:g> vegaes.
       Agora va reafitase\'l preséu.</string>
    <!-- Message shown in dialog when user is almost at the limit where they will be
    locked out and may have to enter an alternate username/password to unlock the phone -->
    <!-- Message shown in dialog when user is almost at the limit where they will be
@@ -3009,9 +2990,7 @@
    <string name="kg_reordering_delete_drop_target_text">Desaniciar</string>
    <!-- Message shown in dialog when user is attempting to set the music volume above the
    recommended maximum level for headphones -->
  <string name="safe_media_volume_warning" product="default">
       «¿Xubir el volume penriba\'l nivel aconseyáu?\n\nSentir soníos con volume altu demientres periodos de tiempu llargos podría mancate los oyíos.»
    </string>
    <string name="safe_media_volume_warning" product="default">«¿Xubir el volume penriba\'l nivel aconseyáu?\n\nSentir soníos con volume altu demientres periodos de tiempu llargos podría mancate los oyíos.»</string>
    <!-- Dialog title for dialog shown when the accessibility shortcut is activated, and we want
     to confirm that the user understands what's going to happen-->
    <!-- Message shown in dialog when user is in the process of enabling the accessibility
+1626 −1628
Original line number Diff line number Diff line
@@ -500,8 +500,7 @@
    <!-- Message shown during fingerprint acquisision when the user removes their finger from the sensor too quickly -->
    <!-- Message shown during fingerprint acquisision when the user moves their finger too slowly -->
    <!-- Array containing custom messages shown during fingerprint acquisision from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_acquired_vendor">
    </string-array>
    <string-array name="fingerprint_acquired_vendor"></string-array>
    <!-- Error message shown when the fingerprint hardware can't be accessed -->
    <!-- Error message shown when the fingerprint hardware has run out of room for storing fingerprints -->
    <!-- Error message shown when the fingerprint hardware timer has expired and the user needs to restart the operation. -->
@@ -511,8 +510,7 @@
    <!-- Generic error message shown when the fingerprint hardware can't recognize the fingerprint -->
    <!-- Template to be used to name enrolled fingerprints by default. -->
    <!-- Array containing custom error messages from vendor.  Vendor is expected to add and translate these strings -->
  <string-array name="fingerprint_error_vendor">
    </string-array>
    <string-array name="fingerprint_error_vendor"></string-array>
    <!-- Content description which should be used for the fingerprint icon. -->
    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
Loading