mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 03:25:03 +00:00
Return the FakeContext as application context
This avoids getApplicationContext() to return null and cause NullPointerException. Fixes #4392 <https://github.com/Genymobile/scrcpy/issues/4392#issuecomment-1792806080>
This commit is contained in:
parent
8d76b3e06d
commit
4e4ddc499f
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@ package com.genymobile.scrcpy;
|
|||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.AttributionSource;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
|
@ -44,4 +45,9 @@ public final class FakeContext extends ContextWrapper {
|
|||
public int getDeviceId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getApplicationContext() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue