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

Commit 81e806a7 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Move LazyIntToIntMap to services.jar

This class should have lived in services.jar.  When I introduced
LazyIntToIntMap [1] to re-enable cross-profile use of spell checker
APIs, I unnecessarily put this class in frameworks.jar despite the
fact that this utility class is used only in the system server
process.

This CL also makes this utility class package-private so that other
component will not accidentaly depend on it.

This is purely a mechanical refactoring.  There should be no
observable behavior difference.

 [1]: Ic046f832f203115106409a53418a5746eb6d4939
      3f8c5688

Bug: 115516399
Test: atest FrameworksServicesTests:com.android.server.textservices
Change-Id: I9390ba11687e1db66d02fe1cdfb9ed59adde3768
parent eb1e8049
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -14,21 +14,18 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.internal.textservice;
package com.android.server.textservices;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.util.SparseIntArray;
import android.util.SparseIntArray;


import com.android.internal.annotations.VisibleForTesting;

import java.util.function.IntUnaryOperator;
import java.util.function.IntUnaryOperator;


/**
/**
 * Simple int-to-int key-value-store that is to be lazily initialized with the given
 * Simple int-to-int key-value-store that is to be lazily initialized with the given
 * {@link IntUnaryOperator}.
 * {@link IntUnaryOperator}.
 */
 */
@VisibleForTesting
final class LazyIntToIntMap {
public final class LazyIntToIntMap {


    private final SparseIntArray mMap = new SparseIntArray();
    private final SparseIntArray mMap = new SparseIntArray();


+0 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.internal.textservice.ISpellCheckerSession;
import com.android.internal.textservice.ISpellCheckerSessionListener;
import com.android.internal.textservice.ISpellCheckerSessionListener;
import com.android.internal.textservice.ITextServicesManager;
import com.android.internal.textservice.ITextServicesManager;
import com.android.internal.textservice.ITextServicesSessionListener;
import com.android.internal.textservice.ITextServicesSessionListener;
import com.android.internal.textservice.LazyIntToIntMap;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils;
import com.android.server.SystemService;
import com.android.server.SystemService;


+3 −3
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.internal.textservice;
package com.android.server.textservices;


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -25,8 +25,8 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.when;


import android.support.test.filters.SmallTest;
import androidx.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.runner.AndroidJUnit4;


import org.junit.Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;