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

Commit b84db1de authored by Jiakai Zhang's avatar Jiakai Zhang Committed by Kelvin Zhang
Browse files

Expose UpdateEngine.triggerPostinstall to modules.

This is needed for ART to use the triggerPostinstall API.

Bug: 377557752
Change-Id: I94b0e1a2fab0d134cf04c4e83e7f46f49ea20321
Test: m
parent a8b10c99
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -463,6 +463,10 @@ package android.os {
    field public static final long TRACE_TAG_NETWORK = 2097152L; // 0x200000L
    field public static final long TRACE_TAG_NETWORK = 2097152L; // 0x200000L
  }
  }


  public class UpdateEngine {
    method @FlaggedApi("android.os.update_engine_api") public void triggerPostinstall(@NonNull String);
  }

}
}


package android.os.storage {
package android.os.storage {
+20 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.os;
package android.os;


import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
@@ -667,4 +668,23 @@ public class UpdateEngine {
            throw e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
        }
    }
    }

    /**
     * Run postinstall script for specified partition |partition|
     *
     * @param partition The partition to trigger postinstall runs
     *
     * @throws ServiceSpecificException error code of this exception would be one of
     * https://cs.android.com/android/platform/superproject/main/+/main:system/update_engine/common/error_code.h
     * @hide
     */
    @FlaggedApi(Flags.FLAG_UPDATE_ENGINE_API)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public void triggerPostinstall(@NonNull String partition) {
        try {
            mUpdateEngine.triggerPostinstall(partition);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
}