Merge "Move OnGoingUsage dialog out of debug folder" into rvc-qpr-dev
diff --git a/PermissionController/AndroidManifest.xml b/PermissionController/AndroidManifest.xml
index 54b7436..08d4d0b 100644
--- a/PermissionController/AndroidManifest.xml
+++ b/PermissionController/AndroidManifest.xml
@@ -164,7 +164,7 @@
                   android:excludeFromRecents="true"
                   android:theme="@style/PermissionDialog.FilterTouches" />
 
-        <activity android:name="com.android.permissioncontroller.permission.debug.ReviewOngoingUsageActivity"
+        <activity android:name="com.android.permissioncontroller.permission.ui.ReviewOngoingUsageActivity"
                   android:excludeFromRecents="true"
                   android:theme="@style/PermissionDialog"
                   android:launchMode="singleInstance"
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragment.java
index b0831df..0888b63 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragment.java
@@ -63,7 +63,8 @@
 import androidx.preference.PreferenceViewHolder;
 
 import com.android.permissioncontroller.R;
-import com.android.permissioncontroller.permission.debug.AppPermissionUsage.GroupUsage;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage.GroupUsage;
 import com.android.permissioncontroller.permission.model.AppPermissionGroup;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps.PermissionApp;
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsages.java b/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsages.java
index dfba512..4f06132 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsages.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/debug/PermissionUsages.java
@@ -39,7 +39,8 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
-import com.android.permissioncontroller.permission.debug.AppPermissionUsage.Builder;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage.Builder;
 import com.android.permissioncontroller.permission.model.AppPermissionGroup;
 import com.android.permissioncontroller.permission.model.Permission;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps.PermissionApp;
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/Utils.kt b/PermissionController/src/com/android/permissioncontroller/permission/debug/Utils.kt
index a6a9126..fd75d3b 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/Utils.kt
+++ b/PermissionController/src/com/android/permissioncontroller/permission/debug/Utils.kt
@@ -22,7 +22,7 @@
 import android.text.format.DateFormat.getMediumDateFormat
 import android.text.format.DateFormat.getTimeFormat
 import com.android.permissioncontroller.R
-import com.android.permissioncontroller.permission.debug.AppPermissionUsage.GroupUsage
+import com.android.permissioncontroller.permission.model.AppPermissionUsage.GroupUsage
 import java.util.Locale
 
 /** Whether to show the Permissions Hub.  */
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/AppPermissionUsage.java b/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionUsage.java
similarity index 97%
rename from PermissionController/src/com/android/permissioncontroller/permission/debug/AppPermissionUsage.java
rename to PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionUsage.java
index 7d75641..d45e9b4 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/AppPermissionUsage.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionUsage.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.permissioncontroller.permission.debug;
+package com.android.permissioncontroller.permission.model;
 
 import static android.Manifest.permission_group.MICROPHONE;
 
@@ -28,8 +28,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
-import com.android.permissioncontroller.permission.model.AppPermissionGroup;
-import com.android.permissioncontroller.permission.model.Permission;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps.PermissionApp;
 
 import java.util.ArrayList;
@@ -124,7 +122,7 @@
         private final @Nullable PackageOps mLastUsage;
         private final @Nullable HistoricalPackageOps mHistoricalUsage;
 
-        GroupUsage(@NonNull AppPermissionGroup group, @Nullable PackageOps lastUsage,
+        public GroupUsage(@NonNull AppPermissionGroup group, @Nullable PackageOps lastUsage,
                 @Nullable HistoricalPackageOps historicalUsage) {
             mGroup = group;
             mLastUsage = lastUsage;
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageActivity.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/ReviewOngoingUsageActivity.java
similarity index 91%
rename from PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageActivity.java
rename to PermissionController/src/com/android/permissioncontroller/permission/ui/ReviewOngoingUsageActivity.java
index 62d3009..2082b76 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageActivity.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/ReviewOngoingUsageActivity.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.permissioncontroller.permission.debug;
+package com.android.permissioncontroller.permission.ui;
 
 import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
 
@@ -26,6 +26,8 @@
 import androidx.fragment.app.FragmentActivity;
 
 import com.android.permissioncontroller.DeviceUtils;
+import com.android.permissioncontroller.permission.ui.handheld.ReviewOngoingUsageFragment;
+import com.android.permissioncontroller.permission.debug.UtilsKt;
 
 /**
  * A dialog listing the currently uses of camera, microphone, and location.
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionControlPreference.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionControlPreference.java
index 72a0668..fe6ee35 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionControlPreference.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionControlPreference.java
@@ -44,7 +44,7 @@
 import androidx.preference.PreferenceViewHolder;
 
 import com.android.permissioncontroller.permission.model.AppPermissionGroup;
-import com.android.permissioncontroller.permission.debug.AppPermissionUsage.GroupUsage;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage.GroupUsage;
 import com.android.permissioncontroller.R;
 import com.android.permissioncontroller.permission.ui.LocationProviderInterceptDialog;
 import com.android.permissioncontroller.permission.utils.LocationUtils;
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragment.java
similarity index 97%
rename from PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragment.java
rename to PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragment.java
index 0330dd1..89e804c 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragment.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.permissioncontroller.permission.debug;
+package com.android.permissioncontroller.permission.ui.handheld;
 
 import static android.Manifest.permission_group.CAMERA;
 import static android.Manifest.permission_group.LOCATION;
@@ -44,7 +44,9 @@
 
 import com.android.permissioncontroller.PermissionControllerStatsLog;
 import com.android.permissioncontroller.R;
-import com.android.permissioncontroller.permission.debug.AppPermissionUsage.GroupUsage;
+import com.android.permissioncontroller.permission.debug.PermissionUsages;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage;
+import com.android.permissioncontroller.permission.model.AppPermissionUsage.GroupUsage;
 import com.android.permissioncontroller.permission.model.AppPermissionGroup;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps;
 import com.android.permissioncontroller.permission.model.legacy.PermissionApps.PermissionApp;
diff --git a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionHub2Test.kt b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/PermissionHub2Test.kt
similarity index 97%
rename from PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionHub2Test.kt
rename to PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/PermissionHub2Test.kt
index aaf7b61..da43d20 100644
--- a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionHub2Test.kt
+++ b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/PermissionHub2Test.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.permissioncontroller.permission.debug
+package com.android.permissioncontroller.permission
 
 import android.app.AppOpsManager
 import android.app.AppOpsManager.MODE_ALLOWED
diff --git a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragmentTest.kt b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragmentTest.kt
index f3e4d9d..ecffcb2 100644
--- a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragmentTest.kt
+++ b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/PermissionUsageFragmentTest.kt
@@ -26,11 +26,11 @@
 import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
 import androidx.test.espresso.matcher.ViewMatchers.withText
 import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
 import androidx.test.rule.ActivityTestRule
 import com.android.compatibility.common.util.SystemUtil.eventually
 import com.android.permissioncontroller.R
 import com.android.permissioncontroller.getPreferenceSummary
+import com.android.permissioncontroller.permission.PermissionHub2Test
 import com.android.permissioncontroller.permission.ui.ManagePermissionsActivity
 import com.android.permissioncontroller.scrollToPreference
 import com.google.common.truth.Truth.assertThat
diff --git a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragmentTest.kt b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragmentTest.kt
similarity index 90%
rename from PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragmentTest.kt
rename to PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragmentTest.kt
index d315f50..bd0d1f2 100644
--- a/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/debug/ReviewOngoingUsageFragmentTest.kt
+++ b/PermissionController/tests/inprocess/src/com/android/permissioncontroller/permission/ui/handheld/ReviewOngoingUsageFragmentTest.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.permissioncontroller.permission.debug
+package com.android.permissioncontroller.permission.ui.handheld
 
 import android.Manifest.permission.CAMERA
 import android.permission.cts.PermissionUtils.grantPermission
@@ -25,6 +25,8 @@
 import androidx.test.espresso.matcher.RootMatchers.isDialog
 import androidx.test.espresso.matcher.ViewMatchers.withText
 import androidx.test.rule.ActivityTestRule
+import com.android.permissioncontroller.permission.PermissionHub2Test
+import com.android.permissioncontroller.permission.ui.ReviewOngoingUsageActivity
 import org.junit.After
 import org.junit.Rule
 import org.junit.Test