mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 05:23:40 +00:00
Get SubscriptionManager by name due to ContextCompat bug for API 22.
Fixes #8826
This commit is contained in:
parent
56848fb83d
commit
156fe37a60
@ -12,7 +12,6 @@ import android.os.Vibrator;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.annotation.RequiresApi;
|
import android.support.annotation.RequiresApi;
|
||||||
import android.support.v4.content.ContextCompat;
|
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@ -57,6 +56,6 @@ public class ServiceUtil {
|
|||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP_MR1)
|
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP_MR1)
|
||||||
public static @Nullable SubscriptionManager getSubscriptionManager(@NonNull Context context) {
|
public static @Nullable SubscriptionManager getSubscriptionManager(@NonNull Context context) {
|
||||||
return ContextCompat.getSystemService(context, SubscriptionManager.class);
|
return (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user