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

Commit 924041dd authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[ToA] Add more details in javadoc" into main

parents f318409c 346623e1
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -125,7 +125,10 @@ public class GrammaticalInflectionManager {
    /**
    /**
     * Get the current grammatical gender of privileged application from the encrypted file.
     * Get the current grammatical gender of privileged application from the encrypted file.
     *
     *
     * @return the value of grammatical gender
     * @return the value of system grammatical gender only if the calling app has the permission,
     * otherwise throwing an exception.
     *
     * @throws SecurityException if the caller does not have the required permission.
     *
     *
     * @see Configuration#getGrammaticalGender
     * @see Configuration#getGrammaticalGender
     */
     */
+5 −2
Original line number Original line Diff line number Diff line
@@ -61,7 +61,6 @@ import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.charset.StandardCharsets;


/**
/**
@@ -133,7 +132,11 @@ public class GrammaticalInflectionService extends SystemService {


        @Override
        @Override
        public int getSystemGrammaticalGender(AttributionSource attributionSource, int userId) {
        public int getSystemGrammaticalGender(AttributionSource attributionSource, int userId) {
            return canGetSystemGrammaticalGender(attributionSource)
            if (!checkSystemGrammaticalGenderPermission(mPermissionManager, attributionSource)) {
                throw new SecurityException("AttributionSource: " + attributionSource
                        + " does not have READ_SYSTEM_GRAMMATICAL_GENDER permission.");
            }
            return checkSystemTermsOfAddressIsEnabled()
                    ? GrammaticalInflectionService.this.getSystemGrammaticalGender(
                    ? GrammaticalInflectionService.this.getSystemGrammaticalGender(
                    attributionSource, userId)
                    attributionSource, userId)
                    : GRAMMATICAL_GENDER_NOT_SPECIFIED;
                    : GRAMMATICAL_GENDER_NOT_SPECIFIED;