Introduce an interface to listen to user actions while uninstalling
Every dialog will use this interface to pass user actions to the view. Implementations of these abstract methods will be done in subsequent changes.
Bug: 182205982
Test: builds successfully
Test: No CTS Tests. Flag to use new app is turned off by default
Change-Id: Ib85867b82267a62937cce77c80bc3b1c4f6b085e
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallActionListener.java b/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallActionListener.java
new file mode 100644
index 0000000..3d535ae
--- /dev/null
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallActionListener.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.packageinstaller.v2.ui;
+
+public interface UninstallActionListener {
+
+ void onPositiveResponse();
+
+ void onNegativeResponse();
+}
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallLaunch.java b/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallLaunch.java
index 7b010d4..8e9038e 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallLaunch.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/v2/ui/UninstallLaunch.java
@@ -30,7 +30,7 @@
import com.android.packageinstaller.v2.viewmodel.UninstallViewModel;
import com.android.packageinstaller.v2.viewmodel.UninstallViewModelFactory;
-public class UninstallLaunch extends FragmentActivity{
+public class UninstallLaunch extends FragmentActivity implements UninstallActionListener {
public static final String EXTRA_CALLING_PKG_UID =
UninstallLaunch.class.getPackageName() + ".callingPkgUid";
@@ -70,4 +70,12 @@
*/
private void onUninstallStageChange(UninstallStage uninstallStage) {
}
+
+ @Override
+ public void onPositiveResponse() {
+ }
+
+ @Override
+ public void onNegativeResponse() {
+ }
}