| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.server; |
| 18 |
|
| 19 |
import android.annotation.Nullable; |
| 20 |
import android.os.PowerExemptionManager; |
| 21 |
import android.os.PowerExemptionManager.ReasonCode; |
| 22 |
import android.os.PowerExemptionManager.TempAllowListType; |
| 23 |
|
| 24 |
import com.android.server.deviceidle.IDeviceIdleConstraint; |
| 25 |
|
| 26 |
public interface DeviceIdleInternal { |
| 27 |
void onConstraintStateChanged(IDeviceIdleConstraint constraint, boolean active); |
| 28 |
|
| 29 |
void registerDeviceIdleConstraint(IDeviceIdleConstraint constraint, String name, |
| 30 |
@IDeviceIdleConstraint.MinimumState int minState); |
| 31 |
|
| 32 |
void unregisterDeviceIdleConstraint(IDeviceIdleConstraint constraint); |
| 33 |
|
| 34 |
void exitIdle(String reason); |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
void addPowerSaveTempWhitelistApp(int callingUid, String packageName, |
| 41 |
long durationMs, int userId, boolean sync, @ReasonCode int reasonCode, |
| 42 |
@Nullable String reason); |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
void addPowerSaveTempWhitelistApp(int callingUid, String packageName, |
| 48 |
long durationMs, @TempAllowListType int tempAllowListType, int userId, boolean sync, |
| 49 |
@ReasonCode int reasonCode, @Nullable String reason); |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
void addPowerSaveTempWhitelistAppDirect(int uid, long duration, |
| 63 |
@TempAllowListType int type, boolean sync, @ReasonCode int reasonCode, |
| 64 |
@Nullable String reason, int callingUid); |
| 65 |
|
| 66 |
|
| 67 |
long getNotificationAllowlistDuration(); |
| 68 |
|
| 69 |
void setJobsActive(boolean active); |
| 70 |
|
| 71 |
|
| 72 |
void setAlarmsActive(boolean active); |
| 73 |
|
| 74 |
boolean isAppOnWhitelist(int appid); |
| 75 |
|
| 76 |
int[] getPowerSaveWhitelistUserAppIds(); |
| 77 |
|
| 78 |
int[] getPowerSaveTempWhitelistAppIds(); |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
interface StationaryListener { |
| 85 |
void onDeviceStationaryChanged(boolean isStationary); |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
void registerStationaryListener(StationaryListener listener); |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
void unregisterStationaryListener(StationaryListener listener); |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
@TempAllowListType int getTempAllowListType(@ReasonCode int reasonCode, |
| 107 |
@TempAllowListType int defaultType); |
| 108 |
} |