Merge "Stop throwing exception when re-starting MediaProjection"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7e0404f1d3
@@ -90,6 +90,8 @@ public final class MediaProjectionManager {
|
||||
* int, android.content.Intent)}
|
||||
* @param resultData The resulting data from {@link android.app.Activity#onActivityResult(int,
|
||||
* int, android.content.Intent)}
|
||||
* @throws IllegalStateException on pre-Q devices if a previously gotten MediaProjection
|
||||
* from the same {@code resultData} has not yet been stopped
|
||||
*/
|
||||
public MediaProjection getMediaProjection(int resultCode, @NonNull Intent resultData) {
|
||||
if (resultCode != Activity.RESULT_OK || resultData == null) {
|
||||
|
||||
@@ -396,8 +396,9 @@ public final class MediaProjectionManagerService extends SystemService
|
||||
}
|
||||
synchronized (mLock) {
|
||||
if (isValidMediaProjection(asBinder())) {
|
||||
throw new IllegalStateException(
|
||||
"Cannot start already started MediaProjection");
|
||||
Slog.w(TAG, "UID " + Binder.getCallingUid()
|
||||
+ " attempted to start already started MediaProjection");
|
||||
return;
|
||||
}
|
||||
mCallback = callback;
|
||||
registerCallback(mCallback);
|
||||
|
||||
Reference in New Issue
Block a user