Loading core/java/android/app/IActivityManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,7 @@ interface IActivityManager { int getLaunchedFromUid(in IBinder activityToken); void unstableProviderDied(in IBinder connection); boolean isIntentSenderAnActivity(in IIntentSender sender); boolean isIntentSenderAForegroundService(in IIntentSender sender); int startActivityAsUser(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, Loading core/java/android/app/PendingIntent.java +16 −4 Original line number Diff line number Diff line Loading @@ -20,18 +20,17 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.Intent; import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.Intent; import android.content.IntentSender; import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.AndroidException; Loading Loading @@ -1010,6 +1009,19 @@ public final class PendingIntent implements Parcelable { } } /** * @hide * Check whether this PendingIntent will launch a foreground service */ public boolean isForegroundService() { try { return ActivityManager.getService() .isIntentSenderAForegroundService(mTarget); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Return the Intent of this PendingIntent. Loading services/core/java/com/android/server/AlarmManagerService.java +282 −11 File changed.Preview size limit exceeded, changes collapsed. Show changes services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -7872,6 +7872,15 @@ public class ActivityManagerService extends IActivityManager.Stub return false; } @Override public boolean isIntentSenderAForegroundService(IIntentSender pendingResult) { if (pendingResult instanceof PendingIntentRecord) { final PendingIntentRecord res = (PendingIntentRecord) pendingResult; return res.key.type == ActivityManager.INTENT_SENDER_FOREGROUND_SERVICE; } return false; } @Override public Intent getIntentForIntentSender(IIntentSender pendingResult) { enforceCallingPermission(Manifest.permission.GET_INTENT_SENDER_INTENT, Loading
core/java/android/app/IActivityManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -314,6 +314,7 @@ interface IActivityManager { int getLaunchedFromUid(in IBinder activityToken); void unstableProviderDied(in IBinder connection); boolean isIntentSenderAnActivity(in IIntentSender sender); boolean isIntentSenderAForegroundService(in IIntentSender sender); int startActivityAsUser(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, Loading
core/java/android/app/PendingIntent.java +16 −4 Original line number Diff line number Diff line Loading @@ -20,18 +20,17 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.Intent; import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.Intent; import android.content.IntentSender; import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.AndroidException; Loading Loading @@ -1010,6 +1009,19 @@ public final class PendingIntent implements Parcelable { } } /** * @hide * Check whether this PendingIntent will launch a foreground service */ public boolean isForegroundService() { try { return ActivityManager.getService() .isIntentSenderAForegroundService(mTarget); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide * Return the Intent of this PendingIntent. Loading
services/core/java/com/android/server/AlarmManagerService.java +282 −11 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -7872,6 +7872,15 @@ public class ActivityManagerService extends IActivityManager.Stub return false; } @Override public boolean isIntentSenderAForegroundService(IIntentSender pendingResult) { if (pendingResult instanceof PendingIntentRecord) { final PendingIntentRecord res = (PendingIntentRecord) pendingResult; return res.key.type == ActivityManager.INTENT_SENDER_FOREGROUND_SERVICE; } return false; } @Override public Intent getIntentForIntentSender(IIntentSender pendingResult) { enforceCallingPermission(Manifest.permission.GET_INTENT_SENDER_INTENT,