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

Commit baa2cea8 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge changes from topic "RefactorAppOpAccessCounters"

* changes:
  Encapusale running app-ops in an object
  Refactor app-op access/reject counters
parents df5a727a 6c6403e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4308,7 +4308,7 @@ package android.app {
    method public static String permissionToOp(String);
    method public void setNotedAppOpsCollector(@Nullable android.app.AppOpsManager.AppOpsCollector);
    method @Deprecated public int startOp(@NonNull String, int, @NonNull String);
    method public int startOp(@NonNull String, int, @Nullable String, @NonNull String, @Nullable String);
    method public int startOp(@NonNull String, int, @Nullable String, @Nullable String, @Nullable String);
    method @Deprecated public int startOpNoThrow(@NonNull String, int, @NonNull String);
    method public int startOpNoThrow(@NonNull String, int, @NonNull String, @NonNull String, @Nullable String);
    method public void startWatchingActive(@NonNull String[], @NonNull java.util.concurrent.Executor, @NonNull android.app.AppOpsManager.OnOpActiveChangedListener);
+27 −12
Original line number Diff line number Diff line
@@ -475,15 +475,20 @@ package android.app {
  public static final class AppOpsManager.OpEntry implements android.os.Parcelable {
    method public int describeContents();
    method public long getDuration();
    method @Deprecated public long getDuration();
    method @NonNull public java.util.Map<java.lang.String,android.app.AppOpsManager.OpFeatureEntry> getFeatures();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
@@ -491,34 +496,44 @@ package android.app {
    method public int getMode();
    method @NonNull public String getOpStr();
    method @Deprecated @Nullable public String getProxyPackageName();
    method @Nullable public String getProxyPackageName(int, int);
    method @Deprecated @Nullable public String getProxyPackageName(int, int);
    method @Deprecated public int getProxyUid();
    method public int getProxyUid(int, int);
    method @Deprecated public int getProxyUid(int, int);
    method public boolean isRunning();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEntry> CREATOR;
  }
  public static final class AppOpsManager.OpFeatureEntry {
    method public long getDuration();
  public static final class AppOpsManager.OpEventProxyInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFeatureId();
    method @Nullable public String getPackageName();
    method @IntRange(from=0) public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEventProxyInfo> CREATOR;
  }
  public static final class AppOpsManager.OpFeatureEntry implements android.os.Parcelable {
    method public int describeContents();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
    method public long getLastRejectTime(int, int, int);
    method @Nullable public String getProxyFeatureId();
    method @Nullable public String getProxyFeatureId(int, int);
    method @Nullable public String getProxyPackageName();
    method @Nullable public String getProxyPackageName(int, int);
    method public int getProxyUid();
    method public int getProxyUid(int, int);
    method public boolean isRunning();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpFeatureEntry> CREATOR;
  }
  public static final class AppOpsManager.PackageOps implements android.os.Parcelable {
@@ -526,7 +541,7 @@ package android.app {
    method @NonNull public java.util.List<android.app.AppOpsManager.OpEntry> getOps();
    method @NonNull public String getPackageName();
    method public int getUid();
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.PackageOps> CREATOR;
  }
+36 −11
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ package android.app {
    method @RequiresPermission("android.permission.MANAGE_APPOPS") public void getHistoricalOpsFromDiskRaw(@NonNull android.app.AppOpsManager.HistoricalOpsRequest, @Nullable java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.AppOpsManager.HistoricalOps>);
    method public static int getNumOps();
    method public static String[] getOpStrs();
    method @NonNull @RequiresPermission("android.permission.GET_APP_OPS_STATS") public java.util.List<android.app.AppOpsManager.PackageOps> getOpsForPackage(int, @NonNull String, @Nullable java.lang.String...);
    method public boolean isOperationActive(int, int, String);
    method @RequiresPermission("android.permission.MANAGE_APPOPS") public void offsetHistory(long);
    method public static int opToDefaultMode(@NonNull String);
@@ -308,15 +309,20 @@ package android.app {

  public static final class AppOpsManager.OpEntry implements android.os.Parcelable {
    method public int describeContents();
    method public long getDuration();
    method @Deprecated public long getDuration();
    method @NonNull public java.util.Map<java.lang.String,android.app.AppOpsManager.OpFeatureEntry> getFeatures();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
@@ -324,34 +330,53 @@ package android.app {
    method public int getMode();
    method @NonNull public String getOpStr();
    method @Deprecated @Nullable public String getProxyPackageName();
    method @Nullable public String getProxyPackageName(int, int);
    method @Deprecated @Nullable public String getProxyPackageName(int, int);
    method @Deprecated public int getProxyUid();
    method public int getProxyUid(int, int);
    method @Deprecated public int getProxyUid(int, int);
    method public boolean isRunning();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEntry> CREATOR;
  }

  public static final class AppOpsManager.OpFeatureEntry {
    method public long getDuration();
  public static final class AppOpsManager.OpEventProxyInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFeatureId();
    method @Nullable public String getPackageName();
    method @IntRange(from=0) public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEventProxyInfo> CREATOR;
  }

  public static final class AppOpsManager.OpFeatureEntry implements android.os.Parcelable {
    method public int describeContents();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
    method public long getLastRejectTime(int, int, int);
    method @Nullable public String getProxyFeatureId();
    method @Nullable public String getProxyFeatureId(int, int);
    method @Nullable public String getProxyPackageName();
    method @Nullable public String getProxyPackageName(int, int);
    method public int getProxyUid();
    method public int getProxyUid(int, int);
    method public boolean isRunning();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpFeatureEntry> CREATOR;
  }

  public static final class AppOpsManager.PackageOps implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.app.AppOpsManager.OpEntry> getOps();
    method @NonNull public String getPackageName();
    method public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.PackageOps> CREATOR;
  }

  public class DownloadManager {
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
package android.app;

parcelable AppOpsManager.PackageOps;
parcelable AppOpsManager.NoteOpEventProxyInfo;
parcelable AppOpsManager.NoteOpEvent;
parcelable AppOpsManager.OpFeatureEntry;
parcelable AppOpsManager.OpEntry;

parcelable AppOpsManager.HistoricalOp;
+1131 −795

File changed.

Preview size limit exceeded, changes collapsed.

Loading