系统初次启动时,延长启动时间

nx2024
XI.CHEN 4 months ago
parent cbd9bef46f
commit ac8fbff0c6

@ -23,6 +23,7 @@ import androidx.core.app.ActivityCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.os.SystemClock;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@ -192,7 +193,12 @@ public class MainActivity extends AppCompatActivity {
};
Handler handler = new Handler();
handler.postDelayed(runnable, 5000);
long boottime = SystemClock.elapsedRealtime();
Log.i(TAG, "System boot time =" + boottime );
if(boottime <= 60000)
handler.postDelayed(runnable, 15000);
else
handler.postDelayed(runnable, 5000);
}
}

Loading…
Cancel
Save