2022-10-02 23:06:56 +02:00
|
|
|
package android.app;
|
|
|
|
|
|
2025-10-04 13:05:00 +02:00
|
|
|
import android.content.Context;
|
2024-04-14 21:48:13 +02:00
|
|
|
import android.content.pm.ConfigurationInfo;
|
2024-10-04 16:15:44 +02:00
|
|
|
import android.graphics.Bitmap;
|
2024-11-01 14:21:15 +01:00
|
|
|
import android.os.Parcel;
|
|
|
|
|
import android.os.Parcelable;
|
2025-10-04 13:05:00 +02:00
|
|
|
import android.os.Process;
|
2024-10-04 16:15:44 +02:00
|
|
|
|
2024-11-01 14:21:15 +01:00
|
|
|
import java.util.ArrayList;
|
2025-10-04 13:05:00 +02:00
|
|
|
import java.util.Arrays;
|
2023-09-12 23:18:47 +02:00
|
|
|
import java.util.List;
|
2024-10-28 19:06:17 +01:00
|
|
|
import java.util.Collections;
|
2023-09-12 23:18:47 +02:00
|
|
|
|
2022-10-02 23:06:56 +02:00
|
|
|
public class ActivityManager {
|
|
|
|
|
|
2024-06-15 22:32:01 +02:00
|
|
|
public static class RunningAppProcessInfo{
|
|
|
|
|
public int importance;
|
2025-10-04 13:05:00 +02:00
|
|
|
public int pid;
|
|
|
|
|
public String processName;
|
|
|
|
|
|
|
|
|
|
private RunningAppProcessInfo(int pid, String processName) {
|
|
|
|
|
this.pid = pid;
|
|
|
|
|
this.processName = processName;
|
|
|
|
|
}
|
2024-06-15 22:32:01 +02:00
|
|
|
}
|
2023-09-12 23:18:47 +02:00
|
|
|
|
2024-10-04 16:15:44 +02:00
|
|
|
public static class TaskDescription {
|
|
|
|
|
public TaskDescription(String name, Bitmap icon, int color) {}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-12 23:18:47 +02:00
|
|
|
public List<RunningAppProcessInfo> getRunningAppProcesses() {
|
2025-10-04 13:05:00 +02:00
|
|
|
return Arrays.asList(new RunningAppProcessInfo(Process.myPid(), Context.this_application.getPackageName()));
|
2023-09-12 23:18:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isLowRamDevice() {return false;}
|
|
|
|
|
|
2024-03-16 17:10:38 +00:00
|
|
|
public static class MemoryInfo {
|
|
|
|
|
/* For now, just always report there's 10GB free RAM */
|
|
|
|
|
public long availMem = 10000;
|
2024-06-15 22:32:01 +02:00
|
|
|
|
|
|
|
|
public long totalMem = 10000;
|
2024-08-25 11:20:01 +02:00
|
|
|
|
|
|
|
|
public long threshold = 200;
|
|
|
|
|
|
|
|
|
|
public boolean lowMemory = false;
|
2024-03-16 17:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
2024-04-14 21:48:13 +02:00
|
|
|
public void getMemoryInfo(MemoryInfo outInfo)
|
2024-03-16 17:10:38 +00:00
|
|
|
{
|
|
|
|
|
outInfo = new MemoryInfo();
|
|
|
|
|
}
|
2024-04-14 21:48:13 +02:00
|
|
|
|
|
|
|
|
public ConfigurationInfo getDeviceConfigurationInfo() {
|
|
|
|
|
return new ConfigurationInfo();
|
|
|
|
|
}
|
2024-06-15 22:32:01 +02:00
|
|
|
|
|
|
|
|
public int getMemoryClass() {return 20;} // suggested heap size in MB
|
2025-01-02 22:18:45 +01:00
|
|
|
public int getLargeMemoryClass() {return 60;} // value chosen arbitrarily
|
2024-06-15 22:32:01 +02:00
|
|
|
|
|
|
|
|
public static void getMyMemoryState(RunningAppProcessInfo outInfo) {}
|
2024-06-24 18:44:31 +02:00
|
|
|
|
|
|
|
|
public boolean clearApplicationUserData() {return false;}
|
2024-11-01 14:21:15 +01:00
|
|
|
|
|
|
|
|
public static class AppTask {}
|
|
|
|
|
public List<ActivityManager.AppTask> getAppTasks() {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
2025-01-02 22:18:45 +01:00
|
|
|
|
2024-11-01 14:21:15 +01:00
|
|
|
public static class RunningServiceInfo implements Parcelable {
|
|
|
|
|
public RunningServiceInfo() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int describeContents() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void writeToParcel(Parcel dest, int flags) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void readFromParcel(Parcel source) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-01-02 22:18:45 +01:00
|
|
|
}
|
2024-11-01 14:21:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<RunningServiceInfo> getRunningServices(int maxNum)
|
|
|
|
|
throws SecurityException {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
2024-11-22 18:02:54 +01:00
|
|
|
|
2024-10-28 19:06:17 +01:00
|
|
|
public List<ApplicationExitInfo> getHistoricalProcessExitReasons(String pkgname, int pid, int maxNum) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
2025-01-11 18:01:43 +01:00
|
|
|
|
|
|
|
|
public static boolean isUserAMonkey() {return false;}
|
2022-10-02 23:06:56 +02:00
|
|
|
}
|