summaryrefslogtreecommitdiff
path: root/packages/Shell/src
diff options
context:
space:
mode:
authorNandana Dutt <nandana@google.com>2019-06-14 14:26:10 +0100
committerNandana Dutt <nandana@google.com>2019-08-06 17:43:11 +0000
commit47c5ecc50ad6b9a87e6c8876f4a215dcd72f1daa (patch)
tree69fc90b2b342c79ec12e4ccd191c0ff1b48475d3 /packages/Shell/src
parent0a4baeae84caaf4dc8f4f558237d99dc5d8ef767 (diff)
Remove obsolete methods from DumpstateListener implementations
Note that with the new Bugreporting API, SystemServer is the only expected DumpstateListener implementation. Once we fully migrate Shell app, we can remove the implementation in BugreportService as well. BUG: 128980174 Test: bugreport from power menu, observe progress bar Change-Id: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9 Merged-In: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
Diffstat (limited to 'packages/Shell/src')
-rw-r--r--packages/Shell/src/com/android/shell/BugreportProgressService.java51
1 files changed, 7 insertions, 44 deletions
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 1060c7b7ce79..3750a8a1ae75 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -175,9 +175,9 @@ public class BugreportProgressService extends Service {
// Passed to Message.obtain() when msg.arg2 is not used.
private static final int UNUSED_ARG2 = -2;
- // Maximum progress displayed (like 99.00%).
- private static final int CAPPED_PROGRESS = 9900;
- private static final int CAPPED_MAX = 10000;
+ // Maximum progress displayed in %.
+ private static final int CAPPED_PROGRESS = 99;
+ private static final int CAPPED_MAX = 100;
/** Show the progress log every this percent. */
private static final int LOG_PROGRESS_STEP = 10;
@@ -1954,7 +1954,10 @@ public class BugreportProgressService extends Service {
@Override
public void onProgress(int progress) throws RemoteException {
- updateProgressInfo(progress, 100 /* progress is already a percentage; so max = 100 */);
+ if (progress > CAPPED_PROGRESS) {
+ progress = CAPPED_PROGRESS;
+ }
+ updateProgressInfo(progress, CAPPED_MAX);
}
@Override
@@ -1967,46 +1970,6 @@ public class BugreportProgressService extends Service {
// TODO(b/111441001): implement
}
- @Override
- public void onProgressUpdated(int progress) throws RemoteException {
- /*
- * Checks whether the progress changed in a way that should be displayed to the user:
- * - info.progress / info.max represents the displayed progress
- * - info.realProgress / info.realMax represents the real progress
- * - since the real progress can decrease, the displayed progress is only updated if it
- * increases
- * - the displayed progress is capped at a maximum (like 99%)
- */
- info.realProgress = progress;
- final int oldPercentage = (CAPPED_MAX * info.progress) / info.max;
- int newPercentage = (CAPPED_MAX * info.realProgress) / info.realMax;
- int max = info.realMax;
-
- if (newPercentage > CAPPED_PROGRESS) {
- progress = newPercentage = CAPPED_PROGRESS;
- max = CAPPED_MAX;
- }
-
- if (newPercentage > oldPercentage) {
- updateProgressInfo(progress, max);
- }
- }
-
- @Override
- public void onMaxProgressUpdated(int maxProgress) throws RemoteException {
- Log.d(TAG, "onMaxProgressUpdated: " + maxProgress);
- info.realMax = maxProgress;
- }
-
- @Override
- public void onSectionComplete(String title, int status, int size, int durationMs)
- throws RemoteException {
- if (DEBUG) {
- Log.v(TAG, "Title: " + title + " Status: " + status + " Size: " + size
- + " Duration: " + durationMs + "ms");
- }
- }
-
public void dump(String prefix, PrintWriter pw) {
pw.print(prefix); pw.print("token: "); pw.println(token);
}