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

Commit ebebe239 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Expose UpdateEngine.triggerPostinstall to modules." into main am: e34e8dd5

parents f39da314 e34e8dd5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -506,6 +506,10 @@ package android.os {
    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 {
+20 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.os;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
@@ -667,4 +668,23 @@ public class UpdateEngine {
            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();
        }
    }
}