diff options
| author | 2020-07-18 16:38:46 +0000 | |
|---|---|---|
| committer | 2020-07-18 16:38:46 +0000 | |
| commit | e179b819cd705ae3761b6f0a9288f40bbdbac055 (patch) | |
| tree | 1077cc0dd4b7689c6083a52937bb651bd0438db8 | |
| parent | a99806ee78de9dbcee9dbbc5e79a86fe75a38f3d (diff) | |
| parent | fa22f61036e33413e7ae9dc3cd437cdcdcf46741 (diff) | |
Merge changes from topic "b160781930-upgrade-dagger-rvc-dev-plus-aosp" into rvc-dev-plus-aosp
* changes:
Update Dagger2 dependencies.
Remove duplicate binding of RowContentBindStage
6 files changed, 33 insertions, 28 deletions
diff --git a/packages/CarSystemUI/Android.bp b/packages/CarSystemUI/Android.bp index 32b33a758535..8598f74e1441 100644 --- a/packages/CarSystemUI/Android.bp +++ b/packages/CarSystemUI/Android.bp @@ -49,7 +49,7 @@ android_library { "androidx.lifecycle_lifecycle-extensions", "SystemUI-tags", "SystemUI-proto", - "dagger2-2.19", + "dagger2", "//external/kotlinc:kotlin-annotations", ], @@ -59,7 +59,7 @@ android_library { manifest: "AndroidManifest.xml", - plugins: ["dagger2-compiler-2.19"], + plugins: ["dagger2-compiler"], } @@ -104,7 +104,7 @@ android_library { "mockito-target-inline-minus-junit4", "testables", "truth-prebuilt", - "dagger2-2.19", + "dagger2", "//external/kotlinc:kotlin-annotations", ], libs: [ @@ -118,7 +118,7 @@ android_library { "com.android.systemui", ], - plugins: ["dagger2-compiler-2.19"], + plugins: ["dagger2-compiler"], } android_app { @@ -157,7 +157,7 @@ android_app { kotlincflags: ["-Xjvm-default=enable"], - plugins: ["dagger2-compiler-2.19"], + plugins: ["dagger2-compiler"], required: ["privapp_whitelist_com.android.systemui"], } diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp index 7a27676237a1..6ecf303c6dc8 100644 --- a/packages/SystemUI/Android.bp +++ b/packages/SystemUI/Android.bp @@ -68,14 +68,14 @@ android_library { "iconloader_base", "SystemUI-tags", "SystemUI-proto", - "dagger2-2.19", + "dagger2", "jsr330" ], manifest: "AndroidManifest.xml", kotlincflags: ["-Xjvm-default=enable"], - plugins: ["dagger2-compiler-2.19"], + plugins: ["dagger2-compiler"], } filegroup { @@ -139,7 +139,7 @@ android_library { "mockito-target-extended-minus-junit4", "testables", "truth-prebuilt", - "dagger2-2.19", + "dagger2", "jsr330" ], libs: [ @@ -151,7 +151,7 @@ android_library { "--extra-packages", "com.android.systemui", ], - plugins: ["dagger2-compiler-2.19"], + plugins: ["dagger2-compiler"], } android_app { diff --git a/packages/SystemUI/docs/dagger.md b/packages/SystemUI/docs/dagger.md index c440fba10135..bb68647ceb00 100644 --- a/packages/SystemUI/docs/dagger.md +++ b/packages/SystemUI/docs/dagger.md @@ -206,11 +206,31 @@ public CustomView(@Named(VIEW_CONTEXT) Context themedViewContext, AttributeSet a ## Updating Dagger2 +We depend on the Dagger source found in external/dagger2. We should automatically pick up on updates +when that repository is updated. + +*Deprecated:* + Binaries can be downloaded from https://repo1.maven.org/maven2/com/google/dagger/ and then loaded into [/prebuilts/tools/common/m2/repository/com/google/dagger/](http://cs/android/prebuilts/tools/common/m2/repository/com/google/dagger/) +The following commands should work, substituting in the version that you are looking for: + +```` +cd prebuilts/tools/common/m2/repository/com/google/dagger/ + +wget -r -np -nH --cut-dirs=4 -erobots=off -R "index.html*" -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36" https://repo1.maven.org/maven2/com/google/dagger/dagger/2.28.1/ + +wget -r -np -nH --cut-dirs=4 -erobots=off -R "index.html*" -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36" https://repo1.maven.org/maven2/com/google/dagger/dagger-compiler/2.28.1/ + +wget -r -np -nH --cut-dirs=4 -erobots=off -R "index.html*" -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36" https://repo1.maven.org/maven2/com/google/dagger/dagger-spi/2.28.1/ + +wget -r -np -nH --cut-dirs=4 -erobots=off -R "index.html*" -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36" https://repo1.maven.org/maven2/com/google/dagger/dagger-producers/2.28.1/ +```` +Then update `prebuilts/tools/common/m2/Android.bp` to point at your new jars. + ## TODO List - Eliminate usages of Dependency#get diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java index 673aa3903156..85a3bc91dc7e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java @@ -142,7 +142,6 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { .expandableNotificationRow(row) .notificationEntry(entry) .onDismissRunnable(onDismissRunnable) - .rowContentBindStage(mRowContentBindStage) .onExpandClickListener(mPresenter) .build(); ExpandableNotificationRowController rowController = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java index 9846f2dcd170..321656df504a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java @@ -25,7 +25,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ActivatableNotificationView; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowController; -import com.android.systemui.statusbar.notification.row.RowContentBindStage; import com.android.systemui.statusbar.phone.StatusBar; import dagger.Binds; @@ -57,8 +56,6 @@ public interface ExpandableNotificationRowComponent { @BindsInstance Builder onDismissRunnable(@DismissRunnable Runnable runnable); @BindsInstance - Builder rowContentBindStage(RowContentBindStage rowContentBindStage); - @BindsInstance Builder onExpandClickListener(ExpandableNotificationRow.OnExpandClickListener presenter); ExpandableNotificationRowComponent build(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java index 7dfead7575a9..bedbec6aadce 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationEntryManagerInflationTest.java @@ -86,6 +86,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Answers; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; @@ -120,8 +121,8 @@ public class NotificationEntryManagerInflationTest extends SysuiTestCase { @Mock private NotificationGutsManager mGutsManager; @Mock private NotificationRemoteInputManager mRemoteInputManager; @Mock private NotificationMediaManager mNotificationMediaManager; - @Mock private ExpandableNotificationRowComponent.Builder - mExpandableNotificationRowComponentBuilder; + @Mock(answer = Answers.RETURNS_SELF) + private ExpandableNotificationRowComponent.Builder mExpandableNotificationRowComponentBuilder; @Mock private ExpandableNotificationRowComponent mExpandableNotificationRowComponent; @Mock private FalsingManager mFalsingManager; @Mock private KeyguardBypassController mKeyguardBypassController; @@ -209,21 +210,9 @@ public class NotificationEntryManagerInflationTest extends SysuiTestCase { when(mExpandableNotificationRowComponentBuilder .expandableNotificationRow(viewCaptor.capture())) .thenReturn(mExpandableNotificationRowComponentBuilder); - when(mExpandableNotificationRowComponentBuilder - .notificationEntry(any())) - .thenReturn(mExpandableNotificationRowComponentBuilder); - when(mExpandableNotificationRowComponentBuilder - .onDismissRunnable(any())) - .thenReturn(mExpandableNotificationRowComponentBuilder); - when(mExpandableNotificationRowComponentBuilder - .rowContentBindStage(any())) - .thenReturn(mExpandableNotificationRowComponentBuilder); - when(mExpandableNotificationRowComponentBuilder - .onExpandClickListener(any())) - .thenReturn(mExpandableNotificationRowComponentBuilder); - when(mExpandableNotificationRowComponentBuilder.build()) .thenReturn(mExpandableNotificationRowComponent); + when(mExpandableNotificationRowComponent.getExpandableNotificationRowController()) .thenAnswer((Answer<ExpandableNotificationRowController>) invocation -> new ExpandableNotificationRowController( |