Loading core/java/android/app/ComponentOptions.java +30 −0 Original line number Diff line number Diff line Loading @@ -38,7 +38,15 @@ public class ComponentOptions { public static final String KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED = "android.pendingIntent.backgroundActivityAllowed"; /** * PendingIntent caller allows activity to be started if caller has BAL permission. * @hide */ public static final String KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION = "android.pendingIntent.backgroundActivityAllowedByPermission"; private boolean mPendingIntentBalAllowed = PENDING_INTENT_BAL_ALLOWED_DEFAULT; private boolean mPendingIntentBalAllowedByPermission = false; ComponentOptions() { } Loading @@ -50,6 +58,9 @@ public class ComponentOptions { setPendingIntentBackgroundActivityLaunchAllowed( opts.getBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, PENDING_INTENT_BAL_ALLOWED_DEFAULT)); setPendingIntentBackgroundActivityLaunchAllowedByPermission( opts.getBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, false)); } /** Loading @@ -68,9 +79,28 @@ public class ComponentOptions { return mPendingIntentBalAllowed; } /** * Set PendingIntent activity can be launched from background if caller has BAL permission. * @hide */ public void setPendingIntentBackgroundActivityLaunchAllowedByPermission(boolean allowed) { mPendingIntentBalAllowedByPermission = allowed; } /** * Get PendingIntent activity is allowed to be started in the background if the caller * has BAL permission. * @hide */ public boolean isPendingIntentBackgroundActivityLaunchAllowedByPermission() { return mPendingIntentBalAllowedByPermission; } public Bundle toBundle() { Bundle b = new Bundle(); b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, mPendingIntentBalAllowed); b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, mPendingIntentBalAllowedByPermission); return b; } } core/java/android/app/TaskInfo.java +0 −17 Original line number Diff line number Diff line Loading @@ -34,10 +34,7 @@ import android.graphics.Rect; import android.os.Build; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; import android.util.Log; import android.view.DisplayCutout; import android.window.TaskSnapshot; import android.window.WindowContainerToken; import java.lang.annotation.Retention; Loading Loading @@ -355,20 +352,6 @@ public class TaskInfo { return isVisible; } /** * @param isLowResolution * @return * @hide */ public TaskSnapshot getTaskSnapshot(boolean isLowResolution) { try { return ActivityTaskManager.getService().getTaskSnapshot(taskId, isLowResolution); } catch (RemoteException e) { Log.e(TAG, "Failed to get task snapshot, taskId=" + taskId, e); return null; } } /** @hide */ @NonNull @TestApi Loading core/java/android/service/voice/AbstractHotwordDetector.java +11 −0 Original line number Diff line number Diff line Loading @@ -198,5 +198,16 @@ abstract class AbstractHotwordDetector implements HotwordDetector { HotwordDetector.Callback::onError, mCallback)); } @Override public void onRejected(@Nullable HotwordRejectedResult result) { if (result == null) { result = new HotwordRejectedResult.Builder().build(); } mHandler.sendMessage(obtainMessage( HotwordDetector.Callback::onRejected, mCallback, result)); } } } core/java/android/service/voice/IMicrophoneHotwordDetectionVoiceInteractionCallback.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.service.voice; import android.media.AudioFormat; import android.service.voice.HotwordDetectedResult; import android.service.voice.HotwordRejectedResult; /** * Callback for returning the detected result from the HotwordDetectionService. Loading @@ -38,4 +39,10 @@ oneway interface IMicrophoneHotwordDetectionVoiceInteractionCallback { * Called when the detection fails due to an error. */ void onError(); /** * Called when the detected result was not detected. */ void onRejected( in HotwordRejectedResult hotwordRejectedResult); } core/java/android/service/voice/SoftwareHotwordDetector.java +11 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,17 @@ class SoftwareHotwordDetector extends AbstractHotwordDetector { HotwordDetector.Callback::onError, mCallback)); } @Override public void onRejected(@Nullable HotwordRejectedResult result) { if (result == null) { result = new HotwordRejectedResult.Builder().build(); } mHandler.sendMessage(obtainMessage( HotwordDetector.Callback::onRejected, mCallback, result)); } } private static class InitializationStateListener Loading Loading
core/java/android/app/ComponentOptions.java +30 −0 Original line number Diff line number Diff line Loading @@ -38,7 +38,15 @@ public class ComponentOptions { public static final String KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED = "android.pendingIntent.backgroundActivityAllowed"; /** * PendingIntent caller allows activity to be started if caller has BAL permission. * @hide */ public static final String KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION = "android.pendingIntent.backgroundActivityAllowedByPermission"; private boolean mPendingIntentBalAllowed = PENDING_INTENT_BAL_ALLOWED_DEFAULT; private boolean mPendingIntentBalAllowedByPermission = false; ComponentOptions() { } Loading @@ -50,6 +58,9 @@ public class ComponentOptions { setPendingIntentBackgroundActivityLaunchAllowed( opts.getBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, PENDING_INTENT_BAL_ALLOWED_DEFAULT)); setPendingIntentBackgroundActivityLaunchAllowedByPermission( opts.getBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, false)); } /** Loading @@ -68,9 +79,28 @@ public class ComponentOptions { return mPendingIntentBalAllowed; } /** * Set PendingIntent activity can be launched from background if caller has BAL permission. * @hide */ public void setPendingIntentBackgroundActivityLaunchAllowedByPermission(boolean allowed) { mPendingIntentBalAllowedByPermission = allowed; } /** * Get PendingIntent activity is allowed to be started in the background if the caller * has BAL permission. * @hide */ public boolean isPendingIntentBackgroundActivityLaunchAllowedByPermission() { return mPendingIntentBalAllowedByPermission; } public Bundle toBundle() { Bundle b = new Bundle(); b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, mPendingIntentBalAllowed); b.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, mPendingIntentBalAllowedByPermission); return b; } }
core/java/android/app/TaskInfo.java +0 −17 Original line number Diff line number Diff line Loading @@ -34,10 +34,7 @@ import android.graphics.Rect; import android.os.Build; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; import android.util.Log; import android.view.DisplayCutout; import android.window.TaskSnapshot; import android.window.WindowContainerToken; import java.lang.annotation.Retention; Loading Loading @@ -355,20 +352,6 @@ public class TaskInfo { return isVisible; } /** * @param isLowResolution * @return * @hide */ public TaskSnapshot getTaskSnapshot(boolean isLowResolution) { try { return ActivityTaskManager.getService().getTaskSnapshot(taskId, isLowResolution); } catch (RemoteException e) { Log.e(TAG, "Failed to get task snapshot, taskId=" + taskId, e); return null; } } /** @hide */ @NonNull @TestApi Loading
core/java/android/service/voice/AbstractHotwordDetector.java +11 −0 Original line number Diff line number Diff line Loading @@ -198,5 +198,16 @@ abstract class AbstractHotwordDetector implements HotwordDetector { HotwordDetector.Callback::onError, mCallback)); } @Override public void onRejected(@Nullable HotwordRejectedResult result) { if (result == null) { result = new HotwordRejectedResult.Builder().build(); } mHandler.sendMessage(obtainMessage( HotwordDetector.Callback::onRejected, mCallback, result)); } } }
core/java/android/service/voice/IMicrophoneHotwordDetectionVoiceInteractionCallback.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.service.voice; import android.media.AudioFormat; import android.service.voice.HotwordDetectedResult; import android.service.voice.HotwordRejectedResult; /** * Callback for returning the detected result from the HotwordDetectionService. Loading @@ -38,4 +39,10 @@ oneway interface IMicrophoneHotwordDetectionVoiceInteractionCallback { * Called when the detection fails due to an error. */ void onError(); /** * Called when the detected result was not detected. */ void onRejected( in HotwordRejectedResult hotwordRejectedResult); }
core/java/android/service/voice/SoftwareHotwordDetector.java +11 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,17 @@ class SoftwareHotwordDetector extends AbstractHotwordDetector { HotwordDetector.Callback::onError, mCallback)); } @Override public void onRejected(@Nullable HotwordRejectedResult result) { if (result == null) { result = new HotwordRejectedResult.Builder().build(); } mHandler.sendMessage(obtainMessage( HotwordDetector.Callback::onRejected, mCallback, result)); } } private static class InitializationStateListener Loading