Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
feat(app): use ActivityThread directly to get the system context
Browse files Browse the repository at this point in the history
Signed-off-by: YuutaW <17158086+Trumeet@users.noreply.github.com>
  • Loading branch information
Trumeet committed Mar 29, 2019
1 parent 3640576 commit f2b6da6
Showing 1 changed file with 2 additions and 1 deletion.
@@ -1,6 +1,7 @@
package moe.yuuta.sysuicontroller.core;

import android.annotation.SuppressLint;
import android.app.ActivityThread;
import android.app.StatusBarManager;
import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -55,7 +56,7 @@ public static void main (String... args) throws Throwable {
private void run (String... args) throws Throwable {
Looper.prepare();
Log.i(TAG, "Version: " + BuildConfig.VERSION_CODE);
mContext = RootJava.getSystemContext();
mContext = ActivityThread.systemMain().getSystemContext();
mManager = (StatusBarManager) mContext.getSystemService("statusbar");
@SuppressLint("PrivateApi") Method mGetService = StatusBarManager.class.getDeclaredMethod("getService");
mGetService.setAccessible(true);
Expand Down

0 comments on commit f2b6da6

Please sign in to comment.