diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 26 | ||||
-rw-r--r-- | core/java/android/app/IActivityManager.java | 6 | ||||
-rw-r--r-- | core/java/android/app/PendingIntent.java | 14 | ||||
-rw-r--r-- | core/java/android/os/BatteryProperties.java | 19 | ||||
-rw-r--r-- | core/java/android/os/BatteryStats.java | 10 | ||||
-rw-r--r-- | core/java/android/os/IPowerManager.aidl | 6 | ||||
-rw-r--r-- | core/java/android/os/PowerManager.java | 9 |
7 files changed, 81 insertions, 9 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 04155b5..ea0ddc1 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1843,6 +1843,17 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } + case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + IIntentSender r = IIntentSender.Stub.asInterface( + data.readStrongBinder()); + String prefix = data.readString(); + String tag = getTagForIntentSender(r, prefix); + reply.writeNoException(); + reply.writeString(tag); + return true; + } + case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); Configuration config = Configuration.CREATOR.createFromParcel(data); @@ -4435,6 +4446,21 @@ class ActivityManagerProxy implements IActivityManager return res; } + public String getTagForIntentSender(IIntentSender sender, String prefix) + throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + data.writeStrongBinder(sender.asBinder()); + data.writeString(prefix); + mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); + reply.readException(); + String res = reply.readString(); + data.recycle(); + reply.recycle(); + return res; + } + public void updatePersistentConfiguration(Configuration values) throws RemoteException { Parcel data = Parcel.obtain(); diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index bbf2ecc..4412261 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -367,6 +367,8 @@ public interface IActivityManager extends IInterface { public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException; + public String getTagForIntentSender(IIntentSender sender, String prefix) throws RemoteException; + public void updatePersistentConfiguration(Configuration values) throws RemoteException; public long[] getProcessPss(int[] pids) throws RemoteException; @@ -709,4 +711,8 @@ public interface IActivityManager extends IInterface { int GET_HOME_ACTIVITY_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+183; int GET_ACTIVITY_CONTAINER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+184; int DELETE_ACTIVITY_CONTAINER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+185; + + + // Start of L transactions + int GET_TAG_FOR_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+210; } diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index d4de112..8efc14f 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -889,6 +889,20 @@ public final class PendingIntent implements Parcelable { } /** + * @hide + * Return descriptive tag for this PendingIntent. + */ + public String getTag(String prefix) { + try { + return ActivityManagerNative.getDefault() + .getTagForIntentSender(mTarget, prefix); + } catch (RemoteException e) { + // Should never happen. + return null; + } + } + + /** * Comparison operator on two PendingIntent objects, such that true * is returned then they both represent the same operation from the * same package. This allows you to use {@link #getActivity}, diff --git a/core/java/android/os/BatteryProperties.java b/core/java/android/os/BatteryProperties.java index 2d67264..8f5cf8b 100644 --- a/core/java/android/os/BatteryProperties.java +++ b/core/java/android/os/BatteryProperties.java @@ -15,9 +15,6 @@ package android.os; -import android.os.Parcel; -import android.os.Parcelable; - /** * {@hide} */ @@ -33,6 +30,22 @@ public class BatteryProperties implements Parcelable { public int batteryTemperature; public String batteryTechnology; + public BatteryProperties() { + } + + public void set(BatteryProperties other) { + chargerAcOnline = other.chargerAcOnline; + chargerUsbOnline = other.chargerUsbOnline; + chargerWirelessOnline = other.chargerWirelessOnline; + batteryStatus = other.batteryStatus; + batteryHealth = other.batteryHealth; + batteryPresent = other.batteryPresent; + batteryLevel = other.batteryLevel; + batteryVoltage = other.batteryVoltage; + batteryTemperature = other.batteryTemperature; + batteryTechnology = other.batteryTechnology; + } + /* * Parcel read/write code must be kept in sync with * frameworks/native/services/batteryservice/BatteryProperties.cpp diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index dfba208..e91f7d7 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -588,8 +588,10 @@ public abstract class BatteryStats implements Parcelable { public static final int EVENT_FOREGROUND = 0x0002; // Event is about an application package that is at the top of the screen. public static final int EVENT_TOP = 0x0003; + // Event is about an application package that is at the top of the screen. + public static final int EVENT_SYNC = 0x0004; // Number of event types. - public static final int EVENT_COUNT = 0x0004; + public static final int EVENT_COUNT = 0x0005; public static final int EVENT_PROC_START = EVENT_PROC | EVENT_FLAG_START; public static final int EVENT_PROC_FINISH = EVENT_PROC | EVENT_FLAG_FINISH; @@ -597,6 +599,8 @@ public abstract class BatteryStats implements Parcelable { public static final int EVENT_FOREGROUND_FINISH = EVENT_FOREGROUND | EVENT_FLAG_FINISH; public static final int EVENT_TOP_START = EVENT_TOP | EVENT_FLAG_START; public static final int EVENT_TOP_FINISH = EVENT_TOP | EVENT_FLAG_FINISH; + public static final int EVENT_SYNC_START = EVENT_SYNC | EVENT_FLAG_START; + public static final int EVENT_SYNC_FINISH = EVENT_SYNC | EVENT_FLAG_FINISH; // For CMD_EVENT. public int eventCode; @@ -975,11 +979,11 @@ public abstract class BatteryStats implements Parcelable { }; public static final String[] HISTORY_EVENT_NAMES = new String[] { - "null", "proc", "fg", "top" + "null", "proc", "fg", "top", "sync" }; public static final String[] HISTORY_EVENT_CHECKIN_NAMES = new String[] { - "Nl", "Pr", "Fg", "Tp" + "Enl", "Epr", "Efg", "Etp", "Esy" }; /** diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 56176a4..069285a 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -25,8 +25,10 @@ interface IPowerManager { // WARNING: The first four methods must remain the first three methods because their // transaction numbers must not change unless IPowerManager.cpp is also updated. - void acquireWakeLock(IBinder lock, int flags, String tag, String packageName, in WorkSource ws); - void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName, int uidtoblame); + void acquireWakeLock(IBinder lock, int flags, String tag, String packageName, in WorkSource ws, + String historyTag); + void acquireWakeLockWithUid(IBinder lock, int flags, String tag, String packageName, + int uidtoblame); void releaseWakeLock(IBinder lock, int flags); void updateWakeLockUids(IBinder lock, in int[] uids); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 4d4c337..74ca3bb 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -662,6 +662,7 @@ public final class PowerManager { private boolean mRefCounted = true; private boolean mHeld; private WorkSource mWorkSource; + private String mHistoryTag; private final Runnable mReleaser = new Runnable() { public void run() { @@ -748,7 +749,8 @@ public final class PowerManager { // been explicitly released by the keyguard. mHandler.removeCallbacks(mReleaser); try { - mService.acquireWakeLock(mToken, mFlags, mTag, mPackageName, mWorkSource); + mService.acquireWakeLock(mToken, mFlags, mTag, mPackageName, mWorkSource, + mHistoryTag); } catch (RemoteException e) { } mHeld = true; @@ -855,6 +857,11 @@ public final class PowerManager { } /** @hide */ + public void setHistoryTag(String tag) { + mHistoryTag = tag; + } + + /** @hide */ public void setUnimportantForLogging(boolean state) { if (state) mFlags |= UNIMPORTANT_FOR_LOGGING; else mFlags &= ~UNIMPORTANT_FOR_LOGGING; |