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

Commit 0e7d966b authored by rambowang's avatar rambowang
Browse files

Introduce @TestApi BUGREPORT_MODE_MAX_VALUE

This cl introduces test API BUGREPORT_MODE_MAX_VALUE to make
bugreport mode validation more stable.

CtsCarrierApiTestCases has a test case to validate the supported
bugreport mode in AOSP. Without a reference to the range of supported
bugreport modes, the  test case can only use a hard-coded value which
is prone of failure when new mode is introduced.

Bug: 297892537
Test: atest BugreportManagerTest
Change-Id: I9369367ee4fcfb274f14c96bf501e9cd3eb98cbf
parent be049246
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2245,6 +2245,10 @@ package android.os {
    method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void unplugBattery(boolean);
  }

  public final class BugreportParams {
    field public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7
  }

  public class Build {
    method public static boolean is64BitAbi(String);
    method public static boolean isDebuggable();
+8 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.os;

import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.annotation.TestApi;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -126,6 +127,13 @@ public final class BugreportParams {
     */
    public static final int BUGREPORT_MODE_ONBOARDING = IDumpstate.BUGREPORT_MODE_ONBOARDING;

    /**
     * The maximum value of supported bugreport mode.
     * @hide
     */
    @TestApi
    public static final int BUGREPORT_MODE_MAX_VALUE = BUGREPORT_MODE_ONBOARDING;

    /**
     * Defines acceptable flags for customizing bugreport requests.
     * @hide