AOSP/Launcher3 - Update language to comply with Android's inclusive language guidance. DO NOT MERGE

Fixed check-style errors.

These files are AOSP specific files and they don't exist in the internal code.

See https://source.android.com/setup/contribute/respectful-code for reference

BUG=161896447

Test: m and Launcher3Tests
$ find out -name "Launcher*.apk" -print -exec ls -l {} \;
  out/target/product/bonito/testcases/Launcher3Tests/arm64/Launcher3Tests.apk
  -rw-r----- 1 rtenneti primarygroup 947525 Aug  4 16:22 out/target/product/bonito/testcases/Launcher3Tests/arm64/Launcher3Tests.apk

  out/target/product/bonito/system_ext/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk
  -rw-r----- 1 rtenneti primarygroup 9249956 Aug  4 16:20 out/target/product/bonito/system_ext/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk

Change-Id: I428eaa50ada96567a3b583eca1aa8ee2d8b85e6b
This commit is contained in:
Raman Tenneti
2020-08-04 16:22:40 -07:00
parent ea991a4be5
commit d0a660cf22
7 changed files with 50 additions and 45 deletions

View File

@@ -104,7 +104,7 @@ public abstract class BaseIconCache {
if (inMemoryCache) {
mCache = new HashMap<>(INITIAL_ICON_CACHE_CAPACITY);
} else {
// Use a dummy cache
// Use a placeholder cache
mCache = new AbstractMap<ComponentKey, CacheEntry>() {
@Override
public Set<Entry<ComponentKey, CacheEntry>> entrySet() {

View File

@@ -161,9 +161,9 @@ public class RecentsAnimationWrapper {
private void disableInputProxy() {
if (mInputConsumer != null && mTouchInProgress) {
long now = SystemClock.uptimeMillis();
MotionEvent dummyCancel = MotionEvent.obtain(now, now, ACTION_CANCEL, 0, 0, 0);
mInputConsumer.onMotionEvent(dummyCancel);
dummyCancel.recycle();
MotionEvent tempCancel = MotionEvent.obtain(now, now, ACTION_CANCEL, 0, 0, 0);
mInputConsumer.onMotionEvent(tempCancel);
tempCancel.recycle();
}
mInputConsumerController.setInputListener(null);
}

View File

@@ -17,6 +17,7 @@
package com.android.quickstep;
import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP;
import android.app.Activity;
@@ -85,19 +86,19 @@ public class TaskSystemShortcut<T extends SystemShortcut> extends SystemShortcut
public View.OnClickListener getOnClickListener(BaseDraggingActivity activity, TaskView view) {
Task task = view.getTask();
WorkspaceItemInfo dummyInfo = new WorkspaceItemInfo();
dummyInfo.intent = new Intent();
WorkspaceItemInfo stubItemInfo = new WorkspaceItemInfo();
stubItemInfo.intent = new Intent();
ComponentName component = task.getTopComponent();
dummyInfo.intent.setComponent(component);
dummyInfo.user = UserHandle.of(task.key.userId);
dummyInfo.title = TaskUtils.getTitle(activity, task);
stubItemInfo.intent.setComponent(component);
stubItemInfo.user = UserHandle.of(task.key.userId);
stubItemInfo.title = TaskUtils.getTitle(activity, task);
return getOnClickListenerForTask(activity, task, dummyInfo);
return getOnClickListenerForTask(activity, task, stubItemInfo);
}
protected View.OnClickListener getOnClickListenerForTask(
BaseDraggingActivity activity, Task task, ItemInfo dummyInfo) {
return mSystemShortcut.getOnClickListener(activity, dummyInfo);
BaseDraggingActivity activity, Task task, ItemInfo stubItemInfo) {
return mSystemShortcut.getOnClickListener(activity, stubItemInfo);
}
public static class AppInfo extends TaskSystemShortcut<SystemShortcut.AppInfo> {

View File

@@ -42,7 +42,7 @@ public abstract class BaseGridChangesTestCase {
}
/**
* Adds a dummy item in the DB.
* Adds a mock item in the DB.
* @param type {@link #APP_ICON} or {@link #SHORTCUT} or >= 2 for
* folder (where the type represents the number of items in the folder).
*/
@@ -82,7 +82,7 @@ public abstract class BaseGridChangesTestCase {
}
/**
* Initializes the DB with dummy elements to represent the provided grid structure.
* Initializes the DB with mock elements to represent the provided grid structure.
* @param typeArray A 3d array of item types. {@see #addItem(int, long, long, int, int)} for
* type definitions. The first dimension represents the screens and the next
* two represent the workspace grid.

View File

@@ -214,7 +214,7 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
if (cn == null && (itemType == Favorites.ITEM_TYPE_SHORTCUT
|| hasStatusFlag(FLAG_SUPPORTS_WEB_UI|FLAG_AUTOINSTALL_ICON|FLAG_RESTORED_ICON))) {
// Legacy shortcuts and promise icons with web UI may not have a componentName but just
// a packageName. In that case create a dummy componentName instead of adding additional
// a packageName. In that case create a empty componentName instead of adding additional
// check everywhere.
String pkg = intent.getPackage();
return pkg == null ? null : new ComponentName(pkg, IconCache.EMPTY_CLASS_NAME);

View File

@@ -1,29 +1,5 @@
package com.android.launcher3.model;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.database.MatrixCursor;
import android.graphics.Bitmap;
import android.os.Process;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.util.PackageManagerHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static com.android.launcher3.LauncherSettings.Favorites.INTENT;
import static com.android.launcher3.LauncherSettings.Favorites.CELLX;
import static com.android.launcher3.LauncherSettings.Favorites.CELLY;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER;
@@ -32,6 +8,7 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
import static com.android.launcher3.LauncherSettings.Favorites.ICON;
import static com.android.launcher3.LauncherSettings.Favorites.ICON_PACKAGE;
import static com.android.launcher3.LauncherSettings.Favorites.ICON_RESOURCE;
import static com.android.launcher3.LauncherSettings.Favorites.INTENT;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
@@ -40,15 +17,41 @@ import static com.android.launcher3.LauncherSettings.Favorites.RESTORED;
import static com.android.launcher3.LauncherSettings.Favorites.SCREEN;
import static com.android.launcher3.LauncherSettings.Favorites.TITLE;
import static com.android.launcher3.LauncherSettings.Favorites._ID;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.database.MatrixCursor;
import android.graphics.Bitmap;
import android.os.Process;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.WorkspaceItemInfo;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.util.PackageManagerHelper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for {@link LoaderCursor}
*/
@@ -100,7 +103,7 @@ public class LoaderCursorTest {
public void getAppShortcutInfo_dontAllowMissing_invalidComponent() {
initCursor(ITEM_TYPE_APPLICATION, "");
assertTrue(mLoaderCursor.moveToNext());
ComponentName cn = new ComponentName(mContext.getPackageName(), "dummy-do");
ComponentName cn = new ComponentName(mContext.getPackageName(), "placeholder-do");
assertNull(mLoaderCursor.getAppShortcutInfo(
new Intent().setComponent(cn), false /* allowMissingTarget */, true));
}
@@ -123,7 +126,7 @@ public class LoaderCursorTest {
initCursor(ITEM_TYPE_APPLICATION, "");
assertTrue(mLoaderCursor.moveToNext());
ComponentName cn = new ComponentName(mContext.getPackageName(), "dummy-do");
ComponentName cn = new ComponentName(mContext.getPackageName(), "placeholder-do");
WorkspaceItemInfo info = mLoaderCursor.getAppShortcutInfo(
new Intent().setComponent(cn), true /* allowMissingTarget */, true);
assertNotNull(info);

View File

@@ -1,8 +1,11 @@
package com.android.launcher3.provider;
import static org.junit.Assert.assertEquals;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
@@ -13,8 +16,6 @@ import com.android.launcher3.LauncherSettings.Favorites;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
/**
* Tests for {@link RestoreDbTask}
*/
@@ -31,7 +32,7 @@ public class RestoreDbTaskTest {
@Test
public void testMigrateProfileId() throws Exception {
SQLiteDatabase db = new MyDatabaseHelper(42).getWritableDatabase();
// Add some dummy data
// Add some mock data
for (int i = 0; i < 5; i++) {
ContentValues values = new ContentValues();
values.put(Favorites._ID, i);
@@ -51,7 +52,7 @@ public class RestoreDbTaskTest {
@Test
public void testChangeDefaultColumn() throws Exception {
SQLiteDatabase db = new MyDatabaseHelper(42).getWritableDatabase();
// Add some dummy data
// Add some mock data
for (int i = 0; i < 5; i++) {
ContentValues values = new ContentValues();
values.put(Favorites._ID, i);