Android - 在4.2.2(Nexus 10)上显示/隐藏系统栏

goo*_*odm 3 android root android-4.2-jelly-bean nexus-10

我遇到了Nexus 10 - 4.2.2的问题.我正在使用4.0.4在Galaxy Tab 10.1上测试下面的代码并且它工作正常:

try 
{
    Process proc = Runtime.getRuntime().exec(new String[]{"sh","startservice","-n","com.android.systemui/.SystemUIService"});
    proc.waitFor();
} 
catch (Exception e) 
{
    e.printStackTrace();
}

try
{
    //REQUIRES ROOT
    Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"}); //WAS 79
    proc.waitFor();
}
catch(Exception ex)
{
    //Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)

但是在Nexus 10系统栏后不会显示,只需隐藏.

goo*_*odm 10

要显示和隐藏4.2.2和其他系统栏和通知栏:

隐藏:

    try
    {
        String command;
        command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib service call activity 42 s16 com.android.systemui";
        Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", command }, envp);
        proc.waitFor();
    }
    catch(Exception ex)
    {
        Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
    }
Run Code Online (Sandbox Code Playgroud)

节目:

    try 
    {
         String command;
         command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib am startservice -n com.android.systemui/.SystemUIService";
         Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", command }, envp);
         proc.waitFor();
    } 
    catch (Exception e) 
    {
          e.printStackTrace();
    }
Run Code Online (Sandbox Code Playgroud)

  • 这需要Root吗? (2认同)