Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc099277 authored by Bookatz's avatar Bookatz Committed by Adam Bookatz
Browse files

Remove BatteryStats ref from BackupRecord

BackupRecord currently maintains a record of
BatteryStatsImpl.Uid.Pkg.Serv, but never uses it, so the reference may
as well be removed.

Bug: 111763012
Test: Still compiles
Change-Id: I9c850a4aebf43a85b94a545fe6dbbfa7686c5ae0
parent 63796b8a
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -15466,12 +15466,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        synchronized(this) {
            // !!! TODO: currently no check here that we're already bound
            BatteryStatsImpl.Uid.Pkg.Serv ss = null;
            BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics();
            synchronized (stats) {
                ss = stats.getServiceStatsLocked(app.uid, app.packageName, app.name);
            }
            // Backup agent is now in use, its package can't be stopped.
            try {
                AppGlobals.getPackageManager().setPackageStoppedState(
@@ -15482,7 +15476,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                        + app.packageName + ": " + e);
            }
            BackupRecord r = new BackupRecord(ss, app, backupMode);
            BackupRecord r = new BackupRecord(app, backupMode);
            ComponentName hostingName =
                    (backupMode == ApplicationThreadConstants.BACKUP_MODE_INCREMENTAL)
                            ? new ComponentName(app.packageName, app.backupAgentName)
+1 −6
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.server.am;

import com.android.internal.os.BatteryStatsImpl;

import android.content.pm.ApplicationInfo;

/** @hide */
@@ -28,7 +26,6 @@ final class BackupRecord {
    public static final int RESTORE = 2;
    public static final int RESTORE_FULL = 3;
    
    final BatteryStatsImpl.Uid.Pkg.Serv stats;
    String stringName;                     // cached toString() output
    final ApplicationInfo appInfo;         // information about BackupAgent's app
    final int backupMode;                  // full backup / incremental / restore
@@ -36,9 +33,7 @@ final class BackupRecord {

    // ----- Implementation -----

    BackupRecord(BatteryStatsImpl.Uid.Pkg.Serv _agentStats, ApplicationInfo _appInfo,
            int _backupMode) {
        stats = _agentStats;
    BackupRecord(ApplicationInfo _appInfo, int _backupMode) {
        appInfo = _appInfo;
        backupMode = _backupMode;
    }